Meteor-Community-Packages / meteor-publish-composite

Meteor.publishComposite provides a flexible way to publish a set of related documents from various collections using a reactive join
https://atmospherejs.com/reywood/publish-composite
MIT License
553 stars 58 forks source link

Replaces underscore references with native one #161

Closed Nandika-A closed 1 year ago

Nandika-A commented 1 year ago

Resolves #158

Underscore references in certain files where possible are replaced with native ones as referenced in https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore. Currently, the native version isn't available for .any() and .isEqual() in lines 69 and 70 in lib/subscription.js, so these are skipped for now. The following changes are made-

  1. _.each(list, function) to Object.entries(object).forEach(function) https://github.com/Nandika-A/meteor-publish-composite/commit/da63cfa39553d673530226e27056c5d4fce12a59
  2. _.extend(destination, sources) to Object.assign(destination, sources)
    https://github.com/Nandika-A/meteor-publish-composite/commit/6d5f2a0c63968a13a7e5c29c820169f68a7a7b76 https://github.com/Nandika-A/meteor-publish-composite/commit/da3aff7c6490db37d72a57d33fa7cc20c18f67da
  3. _.keys(object) to Object.keys(object) https://github.com/Nandika-A/meteor-publish-composite/commit/6d5f2a0c63968a13a7e5c29c820169f68a7a7b76

The changes are made in a separate branch Replaces underscore references with native one. The remaining underscore functions will be tackled in other pr.