Merge pull request #8746 from murgatroid99/node_lodash_compat

Make Node library compatible with lodash 3
pull/8751/head
Michael Lumish 8 years ago committed by GitHub
commit 7466ae732e
  1. 12
      src/node/src/common.js

@ -141,8 +141,14 @@ exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service,
binaryAsBase64 = options.binaryAsBase64;
longsAsStrings = options.longsAsStrings;
}
return _.fromPairs(_.map(service.children, function(method) {
return [_.camelCase(method.name), {
/* This slightly awkward construction is used to make sure we only use
lodash@3.10.1-compatible functions. A previous version used
_.fromPairs, which would be cleaner, but was introduced in lodash
version 4 */
return _.zipObject(_.map(service.children, function(method) {
return _.camelCase(method.name);
}), _.map(service.children, function(method) {
return {
path: prefix + method.name,
requestStream: method.requestStream,
responseStream: method.responseStream,
@ -154,7 +160,7 @@ exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service,
responseSerialize: serializeCls(method.resolvedResponseType.build()),
responseDeserialize: deserializeCls(method.resolvedResponseType.build(),
binaryAsBase64, longsAsStrings)
}];
};
}));
};

Loading…
Cancel
Save