Join algorithms for JavaScript Arrays using lodash
APACHE-2.0 License
The switch from babel to typescript dropped the babel-plugin-add-module-exports with this commit. This corrects that same issue for Typescript where an import would return an object with a single default
key. Instead it now correctly returns the default export.
Published by mtraynham over 3 years ago
Fixes a bug with the typings and upgrades to Webpack 5 for client bundling.
Published by mtraynham over 4 years ago
index.lodash.d.ts
in the install, #19Published by mtraynham over 4 years ago
This release is a full restructure and migration of the project to using TypeScript. Some other additions are:
dist/joins.js
. This is a bundle that does not wrap the join functions in a new lodash context. You instead require each join independently (import {hashLeftOuterJoin} from 'lodash-joins/dist/joins
). I eventually plan to move the project to this import structure, as it's much more modular.merger
. Originally, lodash-joins would just assign both the left and right row to an object, but now users can provide a merger function to return whatever they want. This has been defaulted to the old assign method for compatibility.Published by mtraynham about 7 years ago
#10 - update package.json to connect typings d.ts file (thanks goes to @breath103)
Published by mtraynham over 7 years ago
The merger function offers an alternative to handling merge type joins (outer/inner/left-outer/right-outer). Instead of using lodash's _.assign
to create a new row, users can now provide a function that will create a merged row.
function defaultMerger (left: LeftType, right: RightType): LeftType & RightType {
return Object.assign({}, left, right);
}
function leftRightMerger (left: LeftType, right: RightType): {left: LeftType, right: RightType} {
return {left, right};
}
The merge function will be called for all records of the output array, including rows that are not merged. In those cases, either the left or right record will be null
.
Published by mtraynham over 7 years ago
No significant code changes.
Published by mtraynham almost 8 years ago
No major code changes, just dependency updates and test suite enhancements.
Published by mtraynham over 8 years ago
Minor changes to actual code. Changes to documentation and code style (using ESLint with AirBnB config).
Published by mtraynham over 8 years ago
Lodash 4 is out and this release reflects those changes. On the browser, most of Lodash hasn't changed, but the node (modular) version has. Other than that, there have only been small optimizations to code since the last release.
Published by mtraynham almost 9 years ago
Seems the folks on the Babel codebase have changed how default exports work. This release is a temporary patch fix for that.
For more information:
https://phabricator.babeljs.io/T2212
https://www.npmjs.com/package/babel-plugin-add-module-exports
Published by mtraynham almost 9 years ago
Upgrade to Babel 6.
Published by mtraynham over 9 years ago
This release moves to a modular lodash structure. This should improve load times with module loaders when requiring the join implementations directly. If you require the base module of this library, it will use the full lodash module because it re-exports every join function as mixins.
If you wish to use you're own lodash custom build, it can be generated with:
lodash modern include=flatten,every,filter,groupBy,indexBy,map,reduce,reduceRight,some,sortBy,isUndefined,assign,has,values
Published by mtraynham over 9 years ago
assert
functions from Chai.Published by mtraynham over 9 years ago
This release migrates all code to ES6, using babel. Everything should still work the same, minus the ability to require functions independently by path within node (which is not encouraged). If you need to do that, see the README note.
Other changes include:
Published by mtraynham over 9 years ago
Published by mtraynham over 9 years ago
The join wrapper handles missing input values. The first two parameters (the left array and the left accessor) are required. An error will be thrown if they are missing. The right array and right accessor are now optional. This allows one to define self-joins fairly easily.
_.hashLeftOuterJoin([{id: 'a'}], function (d) { return d['id']; });
or
_([{id: 'a'}]).hashLeftOuterJoin(function (d) { return d['id']; }).value();
Webpack offers quite a few advantages of Browserify. Just to mention one, the amount of dev dependencies this library requires was reduced by 1/3.
Published by mtraynham over 9 years ago
gulp release
task as the bower distribution will always have source maps now.Published by mtraynham over 9 years ago
Upgrade lodash to 3.2.0. Moved all feature work to a separate branch.
Published by mtraynham almost 10 years ago