Open shockey opened 6 years ago
Hey @shockey, I can't merge this in because all users shouldn't be forced to take a performance hit to support the lowest common denominator. If you can modify it so someone can import/require a transpiled ES5 version separately, then I'll merge. e.g. var es5 = require("object-assign-deep/es5");
or import { es5 as objectAssignDeep } from "object-assign-deep";
.
Note that this fix wouldn't only be for Node v4. Having this issue on the frontend for Node v8 build. This would fix minification errors across many frontend builds.
@saikojosh, it appears that the transpired form of the module doesn't have any significant differences with the original source, when benchmarked in Chrome:
JSPerf here: https://jsperf.com/object-assign-deep-transpilation
The benchmark passes two objects with 5 levels of nested objects, randomly keyed.
Addresses (possibly fixes) #4.
This PR adds Babel as a devDependency, using it to build a JavaScript artifact for release that is compatible down to Node.js 4 and IE11 (not quite ES5, but this should be enough compatibility for almost anyone).
Here's what the output looks like, vs the original source: https://www.diffchecker.com/DBqpq8i4