Comparing version 2.8.1 to 2.9.0
@@ -49,6 +49,4 @@ 'use strict'; | ||
var Arrays = new WeakMap(); | ||
var Dodo = function () { | ||
function Dodo(array) { | ||
function Dodo(source) { | ||
var index = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; | ||
@@ -61,8 +59,8 @@ var actions = arguments.length <= 2 || arguments[2] === undefined ? noActions : arguments[2]; | ||
(0, _invariant2.default)(Array.isArray(array), 'new Dodo(arr, index) - arr is required'); | ||
(0, _invariant2.default)(index === false || actions !== noActions || Object.keys(index).length == array[0].length, 'new Dodo(arr, index) - index length (' + Object.keys(index).length + ') != array[0].length (' + array[0].length + ')'); | ||
(0, _invariant2.default)(source, 'new Dodo(source, index) - source is required'); | ||
if (Array.isArray(source) && index !== false && actions === noActions) (0, _invariant2.default)(Object.keys(index).length == source[0].length, 'new Dodo(arr, index) - index length (' + Object.keys(index).length + ') != array[0].length (' + source[0].length + ')'); | ||
this.index = index; | ||
this.actions = actions; | ||
Arrays.set(this, array); | ||
this.source = source; | ||
} | ||
@@ -78,3 +76,3 @@ | ||
value: function toArray() { | ||
if (this.actions != noActions) return (this.actions.some(_helpers.needSlowCase) ? _transducers.transduce : _helpers.transduceNoBreak)(Arrays.get(this), (0, _helpers.compose)(this.actions), _helpers.arrayReducer, []);else return Arrays.get(this); | ||
if (this.actions != noActions || !Array.isArray(this.source)) return this.reduce(_helpers.push, []);else return this.source; | ||
} | ||
@@ -91,3 +89,3 @@ }, { | ||
return new Dodo(Arrays.get(this), index, [].concat(_toConsumableArray(this.actions), [transformer])); | ||
return new Dodo(this.source, index, [].concat(_toConsumableArray(this.actions), [transformer])); | ||
} | ||
@@ -181,6 +179,6 @@ }, { | ||
var fn = (0, _transducers.map)(new Function('row', 'return [' + indices.map(function (i) { | ||
var fn = new Function('row', 'return [' + indices.map(function (i) { | ||
return 'row[' + i + ']'; | ||
}).join(',') + ']')); | ||
return this.transform(fn, names); | ||
}).join(',') + ']'); | ||
return this.transform((0, _transducers.map)(fn), names); | ||
} | ||
@@ -206,3 +204,3 @@ }, { | ||
value: function reduce(fn, init) { | ||
var _ref; | ||
var _doer; | ||
@@ -215,3 +213,5 @@ var final = arguments.length <= 2 || arguments[2] === undefined ? _helpers.identity : arguments[2]; | ||
return (this.actions.some(_helpers.needSlowCase) ? _transducers.transduce : _helpers.transduceNoBreak)(Arrays.get(this), (0, _helpers.compose)(this.actions), (_ref = {}, _defineProperty(_ref, '@@transducer/step', fn), _defineProperty(_ref, '@@transducer/result', final), _ref), init); | ||
var doer = !Array.isArray(this.source) || this.actions.some(_helpers.needSlowCase) ? _transducers.transduce : _helpers.transduceNoBreak; | ||
return doer(this.source, (0, _helpers.compose)(this.actions), (_doer = {}, _defineProperty(_doer, '@@transducer/step', fn), _defineProperty(_doer, '@@transducer/result', final), _doer), init); | ||
} | ||
@@ -335,3 +335,3 @@ }, { | ||
get: function get() { | ||
return this.toArray().length; | ||
return this.reduce(_helpers.REDUCERS.count[0], _helpers.REDUCERS.count[1](), _helpers.REDUCERS.count[2]); | ||
} | ||
@@ -441,2 +441,2 @@ }]); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kb2RvLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztRQXNNZ0I7O0FBdE1oQjs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7O0FBRUE7Ozs7Ozs7Ozs7QUFNQSxJQUFNLFlBQVksRUFBWjs7QUFFTixJQUFNLFNBQVMsSUFBSSxPQUFKLEVBQVQ7O0lBRWU7QUFDbkIsV0FEbUIsSUFDbkIsQ0FBWSxLQUFaLEVBQW1EO1FBQWhDLDhEQUFNLHFCQUEwQjtRQUFuQixnRUFBUSx5QkFBVzs7MEJBRGhDLE1BQ2dDOztBQUNqRCxRQUFJLE1BQU0sT0FBTixDQUFjLEtBQWQsQ0FB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ICgrK2kgPCBsZW4pIHtcbiAgICBsZXQgZW50cnkgPSBlbnRyaWVzW2ldXG4gICAgZW50cmllc1tpXSA9IGZuKGVudHJ5WzFdLCBlbnRyeVswXSwgdGhpcylcbiAgfVxuICByZXR1cm4gZW50cmllc1xufVxuIl19 |
@@ -6,12 +6,11 @@ 'use strict'; | ||
}); | ||
exports.needSlowCase = exports.arrayToIndex = exports.isfunc = exports.REDUCERS = exports.arrayReducer = exports.identity = undefined; | ||
exports.needSlowCase = exports.arrayToIndex = exports.isfunc = exports.REDUCERS = exports.identity = undefined; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var _arrayReducer; | ||
exports.compose = compose; | ||
exports.spread = spread; | ||
exports.push = push; | ||
exports.transduceNoBreak = transduceNoBreak; | ||
exports.combineReducers = combineReducers; | ||
exports.spread = spread; | ||
exports.createGrouper = createGrouper; | ||
@@ -28,4 +27,2 @@ exports.dispatchReduce = dispatchReduce; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var identity = exports.identity = function identity(a) { | ||
@@ -35,2 +32,45 @@ return a; | ||
var REDUCERS = exports.REDUCERS = { | ||
max: [function (max, el) { | ||
return max > el ? max : el; | ||
}, function () { | ||
return -Infinity; | ||
}, identity], | ||
min: [function (min, el) { | ||
return min < el ? min : el; | ||
}, function () { | ||
return Infinity; | ||
}, identity], | ||
sum: [function (sum, el) { | ||
return sum + el; | ||
}, function () { | ||
return 0; | ||
}, identity], | ||
mean: [function (stats, el) { | ||
++stats[0]; | ||
stats[1] += el; | ||
return stats; | ||
}, function () { | ||
return [0, 0]; | ||
}, function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
var count = _ref2[0]; | ||
var sum = _ref2[1]; | ||
return sum / count; | ||
}], | ||
count: [function (count) { | ||
return ++count; | ||
}, function () { | ||
return 0; | ||
}, identity], | ||
countUniq: [function (set, el) { | ||
return set.add(el); | ||
}, function () { | ||
return new Set(); | ||
}, function (set) { | ||
return set.size; | ||
}] | ||
}; | ||
function compose(funcs) { | ||
@@ -48,17 +88,6 @@ var len = funcs.length; | ||
function spread(fns) { | ||
var len = fns.length; | ||
return function (value) { | ||
var i = -1; | ||
while (++i < len) { | ||
value[i] = fns[i](value[i]); | ||
} | ||
return value; | ||
}; | ||
} | ||
var arrayReducer = exports.arrayReducer = (_arrayReducer = {}, _defineProperty(_arrayReducer, '@@transducer/result', identity), _defineProperty(_arrayReducer, '@@transducer/step', function transducerStep(arr, v) { | ||
function push(arr, v) { | ||
arr.push(v); | ||
return arr; | ||
}), _arrayReducer); | ||
} | ||
@@ -97,45 +126,13 @@ function transduceNoBreak(coll, xform, reducer, init) { | ||
var REDUCERS = exports.REDUCERS = { | ||
max: [function (max, el) { | ||
return max > el ? max : el; | ||
}, function () { | ||
return -Infinity; | ||
}, identity], | ||
min: [function (min, el) { | ||
return min < el ? min : el; | ||
}, function () { | ||
return Infinity; | ||
}, identity], | ||
sum: [function (sum, el) { | ||
return sum + el; | ||
}, function () { | ||
return 0; | ||
}, identity], | ||
mean: [function (stats, el) { | ||
++stats[0]; | ||
stats[1] += el; | ||
return stats; | ||
}, function () { | ||
return [0, 0]; | ||
}, function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
function spread(fns) { | ||
var len = fns.length; | ||
return function (value) { | ||
var i = -1; | ||
while (++i < len) { | ||
value[i] = fns[i](value[i]); | ||
} | ||
return value; | ||
}; | ||
} | ||
var count = _ref2[0]; | ||
var sum = _ref2[1]; | ||
return sum / count; | ||
}], | ||
count: [function (count) { | ||
return ++count; | ||
}, function () { | ||
return 0; | ||
}, identity], | ||
countUniq: [function (set, el) { | ||
return set.add(el); | ||
}, function () { | ||
return new Set(); | ||
}, function (set) { | ||
return set.size; | ||
}] | ||
}; | ||
function createGrouper(fn, col) { | ||
@@ -188,2 +185,2 @@ if (fn) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9oZWxwZXJzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O1FBSWdCO1FBWUE7UUFvQkE7UUFXQTtRQXNDQTtRQStDQTs7QUFwSWhCOzs7Ozs7Ozs7O0FBRU8sSUFBTSw4QkFBVyxTQUFYLFFBQVc7U0FBSztDQUFMOztBQUVqQixTQUFTLE9BQVQsQ0FBaUIsS0FBakIsRUFBd0I7QUFDN0IsTUFBSSxNQUFNLE1BQU0sTUFBTixDQURtQjtBQUU3QixTQUFPLFVBQVMsQ0FBVCxFQUFZO0FBQ2pCLFFBQUksUUFBUSxDQUFSLENBRGE7QUFFakIsUUFBSSxJQUFJLEdBQUosQ0FGYTtBQUdqQixXQUFPLEdBQVAsRUFBWTtBQUNWLGNBQVEsTUFBTSxDQUFOLEVBQVMsS0FBVCxDQUFSLENBRFU7S0FBWjtBQUdBLFdBQU8sS0FBUCxDQU5pQjtHQUFaLENBRnNCO0NBQXhCOztBQVlBLFNBQVMsTUFBVCxDQUFnQixHQUFoQixFQUFxQjtBQUMxQixNQUFNLE1BQU0sSUFBSSxNQUFKLENBRGM7QUFFMUIsU0FBTyxVQUFTLEtBQVQsRUFBZ0I7QUFDckIsUUFBSSxJQUFJLENBQUMsQ0FBRCxDQURhO0FBRXJCLFdBQU8sRUFBRSxDQUFGLEdBQU0sR0FBTixFQUFXO0FB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SBhcnIgPT4gemlwT2JqZWN0KGFyciwgWy4uLmFyci5rZXlzKCldKVxuXG5leHBvcnQgY29uc3QgbmVlZFNsb3dDYXNlID0gYSA9PlxuICBhLnRvU3RyaW5nKCkuaW5jbHVkZXMoJ25ldyBUYWtlJykgfHwgYS50b1N0cmluZygpLmluY2x1ZGVzKCduZXcgRHJvcCcpXG5cbmV4cG9ydCBmdW5jdGlvbiBkaXNwYXRjaFJlZHVjZShmbiwgaW5pdEZhY3RvcnksIGZpbmFsKSB7XG4gIGlmICh0aGlzLmluZGV4KVxuICAgIHJldHVybiB0aGlzLnJlZHVjZUVhY2goZm4sIGluaXRGYWN0b3J5LCBmaW5hbClcbiAgZWxzZVxuICAgIHJldHVybiB0aGlzLnJlZHVjZShmbiwgaW5pdEZhY3RvcnkoKSwgZmluYWwpXG59XG4iXX0= |
{ | ||
"name": "dodos", | ||
"version": "2.8.1", | ||
"version": "2.9.0", | ||
"description": "Pandas-inspired iterator-based data wrangling library for js", | ||
@@ -37,11 +37,11 @@ "main": "lib/dodo.js", | ||
"ava": "~0.14.0", | ||
"babel-cli": "~6.7.5", | ||
"babel-core": "~6.7.2", | ||
"babel-eslint": "~6.0.0", | ||
"babel-cli": "~6.7.7", | ||
"babel-core": "~6.7.7", | ||
"babel-eslint": "~6.0.3", | ||
"babel-loader": "~6.2.4", | ||
"babel-polyfill": "~6.7.2", | ||
"babel-polyfill": "~6.7.4", | ||
"babel-preset-es2015": "~6.6.0", | ||
"babel-require": "~1.0.1", | ||
"benchmark": "~2.1.0", | ||
"d3-dsv": "~0.3.1", | ||
"d3-dsv": "~0.3.2", | ||
"eslint": "~2.8.0", | ||
@@ -48,0 +48,0 @@ "husky": "~0.11.4", |
@@ -10,3 +10,3 @@ import invariant from 'invariant' | ||
identity, combineReducers, REDUCERS, spread, createGrouper, isfunc, | ||
arrayToIndex, compose, transduceNoBreak, arrayReducer, needSlowCase, | ||
arrayToIndex, compose, transduceNoBreak, push, needSlowCase, | ||
dispatchReduce | ||
@@ -17,16 +17,15 @@ } from './helpers' | ||
const Arrays = new WeakMap() | ||
export default class Dodo { | ||
constructor(array, index=false, actions=noActions) { | ||
constructor(source, index=false, actions=noActions) { | ||
if (Array.isArray(index)) | ||
index = arrayToIndex(index) | ||
invariant(Array.isArray(array), `new Dodo(arr, index) - arr is required`) | ||
invariant(index === false || actions !== noActions || Object.keys(index).length == array[0].length, | ||
`new Dodo(arr, index) - index length (${Object.keys(index).length}) != array[0].length (${array[0].length})`) | ||
invariant(source, `new Dodo(source, index) - source is required`) | ||
if (Array.isArray(source) && index !== false && actions === noActions) | ||
invariant(Object.keys(index).length == source[0].length, | ||
`new Dodo(arr, index) - index length (${Object.keys(index).length}) != array[0].length (${source[0].length})`) | ||
this.index = index | ||
this.actions = actions | ||
Arrays.set(this, array) | ||
this.source = source | ||
} | ||
@@ -41,14 +40,11 @@ | ||
toArray() { | ||
if (this.actions != noActions) | ||
return (this.actions.some(needSlowCase) ? transduce : transduceNoBreak)( | ||
Arrays.get(this), | ||
compose(this.actions), | ||
arrayReducer, | ||
[] | ||
) | ||
if (this.actions != noActions || !Array.isArray(this.source)) | ||
return this.reduce(push, []) | ||
else | ||
return Arrays.get(this) | ||
return this.source | ||
} | ||
get length() { return this.toArray().length } | ||
get length() { | ||
return this.reduce(REDUCERS.count[0], REDUCERS.count[1](), REDUCERS.count[2]) | ||
} | ||
@@ -58,3 +54,3 @@ uniq() { return [...new Set(this)] } | ||
transform(transformer, index=this.index) { | ||
return new Dodo(Arrays.get(this), index, [...this.actions, transformer]) | ||
return new Dodo(this.source, index, [...this.actions, transformer]) | ||
} | ||
@@ -109,4 +105,4 @@ | ||
const fn = map(new Function('row',`return [${indices.map(i => `row[${i}]`).join(',')}]`)) | ||
return this.transform(fn, names) | ||
const fn = new Function('row',`return [${indices.map(i => `row[${i}]`).join(',')}]`) | ||
return this.transform(map(fn), names) | ||
} | ||
@@ -136,4 +132,8 @@ | ||
return (this.actions.some(needSlowCase) ? transduce : transduceNoBreak)( | ||
Arrays.get(this), | ||
const doer = (!Array.isArray(this.source) || this.actions.some(needSlowCase)) | ||
? transduce | ||
: transduceNoBreak | ||
return doer( | ||
this.source, | ||
compose(this.actions), | ||
@@ -140,0 +140,0 @@ { |
@@ -5,2 +5,19 @@ import zipObject from 'lodash/zipObject' | ||
export const REDUCERS = { | ||
max: [(max, el) => max > el ? max : el, () => -Infinity, identity], | ||
min: [(min, el) => min < el ? min : el, () => Infinity, identity], | ||
sum: [(sum, el) => sum + el, () => 0, identity], | ||
mean: [ | ||
(stats, el) => { | ||
++stats[0] | ||
stats[1] += el | ||
return stats | ||
}, | ||
() => [0, 0], | ||
([count, sum]) => sum / count | ||
], | ||
count: [count => ++count, () => 0, identity], | ||
countUniq: [(set, el) => set.add(el), () => new Set(), set => set.size], | ||
} | ||
export function compose(funcs) { | ||
@@ -18,22 +35,7 @@ var len = funcs.length | ||
export function spread(fns) { | ||
const len = fns.length | ||
return function(value) { | ||
let i = -1 | ||
while (++i < len) { | ||
value[i] = fns[i](value[i]) | ||
} | ||
return value | ||
} | ||
export function push(arr, v) { | ||
arr.push(v) | ||
return arr | ||
} | ||
export const arrayReducer = { | ||
['@@transducer/result']: identity, | ||
['@@transducer/step'](arr, v) { | ||
arr.push(v) | ||
return arr | ||
}, | ||
} | ||
export function transduceNoBreak(coll, xform, reducer, init) { | ||
@@ -71,17 +73,11 @@ xform = xform(reducer) | ||
export const REDUCERS = { | ||
max: [(max, el) => max > el ? max : el, () => -Infinity, identity], | ||
min: [(min, el) => min < el ? min : el, () => Infinity, identity], | ||
sum: [(sum, el) => sum + el, () => 0, identity], | ||
mean: [ | ||
(stats, el) => { | ||
++stats[0] | ||
stats[1] += el | ||
return stats | ||
}, | ||
() => [0, 0], | ||
([count, sum]) => sum / count | ||
], | ||
count: [count => ++count, () => 0, identity], | ||
countUniq: [(set, el) => set.add(el), () => new Set(), set => set.size], | ||
export function spread(fns) { | ||
const len = fns.length | ||
return function(value) { | ||
let i = -1 | ||
while (++i < len) { | ||
value[i] = fns[i](value[i]) | ||
} | ||
return value | ||
} | ||
} | ||
@@ -88,0 +84,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
167815
3290