Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash-contrib

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash-contrib - npm Package Compare versions

Comparing version 31001.0.0 to 31001.1.0

test/mocha/function.arity.js

5

bower.json

@@ -10,2 +10,7 @@ {

"main": "dist/lodash-contrib.js",
"moduleType": [
"amd",
"globals",
"node"
],
"scripts": [

@@ -12,0 +17,0 @@ "dist/lodash-contrib.js"

6

common-js/_.array.builders.js

@@ -37,3 +37,3 @@ module.exports = function(_) {

// not sufficient to build chunks of the same size.
chunk: function(array, n, pad) {
chunkContrib: function(array, n, pad) {
var args = arguments;

@@ -49,3 +49,3 @@ var p = function(array) {

else if (args.length === 3) {
pad = _.isArray(pad) ? pad : _.repeat(n, pad);
pad = _.isArray(pad) ? pad : _.repeatContrib(n, pad);
return [_.take(_.cat(part, pad), n)];

@@ -109,3 +109,3 @@ }

// times.
repeat: function(t, elem) {
repeatContrib: function(t, elem) {
return _.times(t, function() { return elem; });

@@ -112,0 +112,0 @@ },

@@ -60,31 +60,2 @@ module.exports = function(_) {

// Takes all items in an array while a given predicate returns truthy.
takeWhile: function(array, pred) {
if (!isSeq(array)) throw new TypeError;
var sz = _.size(array);
for (var index = 0; index < sz; index++) {
if(!truthy(pred(array[index]))) {
break;
}
}
return _.take(array, index);
},
// Drops all items from an array while a given predicate returns truthy.
dropWhile: function(array, pred) {
if (!isSeq(array)) throw new TypeError;
var sz = _.size(array);
for (var index = 0; index < sz; index++) {
if(!truthy(pred(array[index])))
break;
}
return _.drop(array, index);
},
// Returns an array with two internal arrays built from

@@ -91,0 +62,0 @@ // taking an original array and spliting it at the index

@@ -6,4 +6,4 @@ module.exports = function (_) {

function enforcesUnary (fn) {
return function mustBeUnary () {
function enforcesUnary(fn) {
return function mustBeUnary() {
if (arguments.length === 1) {

@@ -34,3 +34,4 @@ return fn.apply(this, arguments);

}
return function curry (func, reverse) {
return function curry(func, reverse) {
var that = this;

@@ -47,3 +48,3 @@ return enforcesUnary(function () {

var CACHE = [];
return function enforce (func) {
return function enforce(func) {
if (typeof func !== 'function') {

@@ -99,11 +100,11 @@ throw new Error('Argument 1 must be a function.');

// the presence of values and the `_` placeholder.
fix: function(fun) {
fix: function (fun) {
var fixArgs = _.rest(arguments);
var f = function() {
var f = function () {
var args = fixArgs.slice();
var arg = 0;
for ( var i = 0; i < (args.length || arg < arguments.length); i++ ) {
if ( args[i] === _ ) {
for (var i = 0; i < (args.length || arg < arguments.length); i++) {
if (args[i] === _) {
args[i] = arguments[arg++];

@@ -122,3 +123,3 @@ }

unary: function (fun) {
return function unary (a) {
return function unary(a) {
return fun.call(this, a);

@@ -129,3 +130,3 @@ };

binary: function (fun) {
return function binary (a, b) {
return function binary(a, b) {
return fun.call(this, a, b);

@@ -136,3 +137,3 @@ };

ternary: function (fun) {
return function ternary (a, b, c) {
return function ternary(a, b, c) {
return fun.call(this, a, b, c);

@@ -143,3 +144,3 @@ };

quaternary: function (fun) {
return function quaternary (a, b, c, d) {
return function quaternary(a, b, c, d) {
return fun.call(this, a, b, c, d);

@@ -149,14 +150,6 @@ };

// Flexible curry function with strict arity.
// Argument application left to right.
// source: https://github.com/eborden/js-curry
curry: curry,
// Flexible right to left curry with strict arity.
curryRight: curryRight,
rCurry: curryRight, // alias for backwards compatibility
curry2: function (fun) {
return enforcesUnary(function curried (first) {
return enforcesUnary(function curried(first) {
return enforcesUnary(function (last) {

@@ -186,27 +179,28 @@ return fun.call(this, first, last);

// Dynamic decorator to enforce function arity and defeat varargs.
enforce: enforce
});
enforce: enforce,
_.arity = (function () {
// Allow 'new Function', as that is currently the only reliable way
// to manipulate function.length
/* jshint -W054 */
var FUNCTIONS = {};
return function arity (numberOfArgs, fun) {
if (FUNCTIONS[numberOfArgs] == null) {
var parameters = new Array(numberOfArgs);
for (var i = 0; i < numberOfArgs; ++i) {
parameters[i] = "__" + i;
arity: (function () {
// Allow 'new Function', as that is currently the only reliable way
// to manipulate function.length
/* jshint -W054 */
var FUNCTIONS = {};
return function arity(numberOfArgs, fun) {
if (FUNCTIONS[numberOfArgs] == null) {
var parameters = new Array(numberOfArgs);
for (var i = 0; i < numberOfArgs; ++i) {
parameters[i] = "__" + i;
}
var pstr = parameters.join();
var code = "return function (" + pstr + ") { return fun.apply(this, arguments); };";
FUNCTIONS[numberOfArgs] = new Function(['fun'], code);
}
var pstr = parameters.join();
var code = "return function ("+pstr+") { return fun.apply(this, arguments); };";
FUNCTIONS[numberOfArgs] = new Function(['fun'], code);
}
if (fun == null) {
return function (fun) { return arity(numberOfArgs, fun); };
}
else return FUNCTIONS[numberOfArgs](fun);
};
})();
if (fun == null) {
return function (fun) { return arity(numberOfArgs, fun); };
}
else return FUNCTIONS[numberOfArgs](fun);
};
})()
});
};

@@ -25,15 +25,2 @@ module.exports = function (_) {

_.mixin({
// Merges two or more objects starting with the left-most and
// applying the keys right-word
// {any:any}* -> {any:any}
merge: function(/* objs */){
var dest = _.some(arguments) ? {} : null;
if (truthy(dest)) {
_.extend.apply(null, concat.call([dest], _.toArray(arguments)));
}
return dest;
},
// Takes an object and another object of strings to strings where the second

@@ -40,0 +27,0 @@ // object describes the key renaming to occur in the first object.

@@ -0,0 +0,0 @@ module.exports = function(_) {

@@ -129,3 +129,3 @@ module.exports = function (_) {

_.mixin({
add: variadicMath(add),
addContrib: variadicMath(add),
sub: variadicMath(sub),

@@ -138,3 +138,3 @@ mul: variadicMath(mul),

neg: neg,
eq: variadicComparator(eq),
eqContrib: variadicComparator(eq),
seq: variadicComparator(seq),

@@ -144,6 +144,6 @@ neq: invert(variadicComparator(eq)),

not: not,
gt: variadicComparator(gt),
lt: variadicComparator(lt),
gte: variadicComparator(gte),
lte: variadicComparator(lte),
gtContrib: variadicComparator(gt),
ltContrib: variadicComparator(lt),
gteContrib: variadicComparator(gte),
lteContrib: variadicComparator(lte),
bitwiseAnd: variadicMath(bitwiseAnd),

@@ -150,0 +150,0 @@ bitwiseOr: variadicMath(bitwiseOr),

@@ -8,3 +8,2 @@ var _ = module.exports = require("lodash").runInContext();

require("../common-js/_.function.combinators.js")(_);
require("../common-js/_.function.dispatch.js")(_);
require("../common-js/_.function.iterators.js")(_);

@@ -56,2 +55,3 @@ require("../common-js/_.function.predicates.js")(_);

module.exports.chunkAll = _.chunkAll;
module.exports.chunkContrib = _.chunkContrib;
module.exports.clone = _.clone;

@@ -279,2 +279,3 @@ module.exports.cloneDeep = _.cloneDeep;

module.exports.repeat = _.repeat;
module.exports.repeatContrib = _.repeatContrib;
module.exports.rest = _.rest;

@@ -281,0 +282,0 @@ module.exports.restParam = _.restParam;

@@ -38,3 +38,3 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

// not sufficient to build chunks of the same size.
chunk: function(array, n, pad) {
chunkContrib: function(array, n, pad) {
var args = arguments;

@@ -50,3 +50,3 @@ var p = function(array) {

else if (args.length === 3) {
pad = _.isArray(pad) ? pad : _.repeat(n, pad);
pad = _.isArray(pad) ? pad : _.repeatContrib(n, pad);
return [_.take(_.cat(part, pad), n)];

@@ -110,3 +110,3 @@ }

// times.
repeat: function(t, elem) {
repeatContrib: function(t, elem) {
return _.times(t, function() { return elem; });

@@ -285,31 +285,2 @@ },

// Takes all items in an array while a given predicate returns truthy.
takeWhile: function(array, pred) {
if (!isSeq(array)) throw new TypeError;
var sz = _.size(array);
for (var index = 0; index < sz; index++) {
if(!truthy(pred(array[index]))) {
break;
}
}
return _.take(array, index);
},
// Drops all items from an array while a given predicate returns truthy.
dropWhile: function(array, pred) {
if (!isSeq(array)) throw new TypeError;
var sz = _.size(array);
for (var index = 0; index < sz; index++) {
if(!truthy(pred(array[index])))
break;
}
return _.drop(array, index);
},
// Returns an array with two internal arrays built from

@@ -551,4 +522,4 @@ // taking an original array and spliting it at the index

function enforcesUnary (fn) {
return function mustBeUnary () {
function enforcesUnary(fn) {
return function mustBeUnary() {
if (arguments.length === 1) {

@@ -579,3 +550,4 @@ return fn.apply(this, arguments);

}
return function curry (func, reverse) {
return function curry(func, reverse) {
var that = this;

@@ -592,3 +564,3 @@ return enforcesUnary(function () {

var CACHE = [];
return function enforce (func) {
return function enforce(func) {
if (typeof func !== 'function') {

@@ -644,11 +616,11 @@ throw new Error('Argument 1 must be a function.');

// the presence of values and the `_` placeholder.
fix: function(fun) {
fix: function (fun) {
var fixArgs = _.rest(arguments);
var f = function() {
var f = function () {
var args = fixArgs.slice();
var arg = 0;
for ( var i = 0; i < (args.length || arg < arguments.length); i++ ) {
if ( args[i] === _ ) {
for (var i = 0; i < (args.length || arg < arguments.length); i++) {
if (args[i] === _) {
args[i] = arguments[arg++];

@@ -667,3 +639,3 @@ }

unary: function (fun) {
return function unary (a) {
return function unary(a) {
return fun.call(this, a);

@@ -674,3 +646,3 @@ };

binary: function (fun) {
return function binary (a, b) {
return function binary(a, b) {
return fun.call(this, a, b);

@@ -681,3 +653,3 @@ };

ternary: function (fun) {
return function ternary (a, b, c) {
return function ternary(a, b, c) {
return fun.call(this, a, b, c);

@@ -688,3 +660,3 @@ };

quaternary: function (fun) {
return function quaternary (a, b, c, d) {
return function quaternary(a, b, c, d) {
return fun.call(this, a, b, c, d);

@@ -694,14 +666,6 @@ };

// Flexible curry function with strict arity.
// Argument application left to right.
// source: https://github.com/eborden/js-curry
curry: curry,
// Flexible right to left curry with strict arity.
curryRight: curryRight,
rCurry: curryRight, // alias for backwards compatibility
curry2: function (fun) {
return enforcesUnary(function curried (first) {
return enforcesUnary(function curried(first) {
return enforcesUnary(function (last) {

@@ -731,27 +695,28 @@ return fun.call(this, first, last);

// Dynamic decorator to enforce function arity and defeat varargs.
enforce: enforce
});
enforce: enforce,
_.arity = (function () {
// Allow 'new Function', as that is currently the only reliable way
// to manipulate function.length
/* jshint -W054 */
var FUNCTIONS = {};
return function arity (numberOfArgs, fun) {
if (FUNCTIONS[numberOfArgs] == null) {
var parameters = new Array(numberOfArgs);
for (var i = 0; i < numberOfArgs; ++i) {
parameters[i] = "__" + i;
arity: (function () {
// Allow 'new Function', as that is currently the only reliable way
// to manipulate function.length
/* jshint -W054 */
var FUNCTIONS = {};
return function arity(numberOfArgs, fun) {
if (FUNCTIONS[numberOfArgs] == null) {
var parameters = new Array(numberOfArgs);
for (var i = 0; i < numberOfArgs; ++i) {
parameters[i] = "__" + i;
}
var pstr = parameters.join();
var code = "return function (" + pstr + ") { return fun.apply(this, arguments); };";
FUNCTIONS[numberOfArgs] = new Function(['fun'], code);
}
var pstr = parameters.join();
var code = "return function ("+pstr+") { return fun.apply(this, arguments); };";
FUNCTIONS[numberOfArgs] = new Function(['fun'], code);
}
if (fun == null) {
return function (fun) { return arity(numberOfArgs, fun); };
}
else return FUNCTIONS[numberOfArgs](fun);
};
})();
if (fun == null) {
return function (fun) { return arity(numberOfArgs, fun); };
}
else return FUNCTIONS[numberOfArgs](fun);
};
})()
});
};

@@ -1024,27 +989,2 @@

// Create quick reference variable for speed.
var slice = Array.prototype.slice;
// Mixing in the attempt function
// ------------------------
_.mixin({
// If object is not undefined or null then invoke the named `method` function
// with `object` as context and arguments; otherwise, return undefined.
attempt: function(object, method) {
if (object == null) return void 0;
var func = object[method];
var args = slice.call(arguments, 2);
return _.isFunction(func) ? func.apply(object, args) : void 0;
}
});
};
},{}],7:[function(require,module,exports){
module.exports = function (_) {
// Helpers
// -------
var HASNTBEENRUN = {};

@@ -1370,3 +1310,3 @@

},{}],8:[function(require,module,exports){
},{}],7:[function(require,module,exports){
module.exports = function (_) {

@@ -1468,3 +1408,3 @@

},{}],9:[function(require,module,exports){
},{}],8:[function(require,module,exports){
module.exports = function (_) {

@@ -1494,15 +1434,2 @@

_.mixin({
// Merges two or more objects starting with the left-most and
// applying the keys right-word
// {any:any}* -> {any:any}
merge: function(/* objs */){
var dest = _.some(arguments) ? {} : null;
if (truthy(dest)) {
_.extend.apply(null, concat.call([dest], _.toArray(arguments)));
}
return dest;
},
// Takes an object and another object of strings to strings where the second

@@ -1582,3 +1509,3 @@ // object describes the key renaming to occur in the first object.

},{}],10:[function(require,module,exports){
},{}],9:[function(require,module,exports){
module.exports = function (_) {

@@ -1685,3 +1612,3 @@

},{}],11:[function(require,module,exports){
},{}],10:[function(require,module,exports){
module.exports = function(_) {

@@ -1711,3 +1638,3 @@

},{}],12:[function(require,module,exports){
},{}],11:[function(require,module,exports){
module.exports = function (_) {

@@ -1841,3 +1768,2 @@

_.mixin({
add: variadicMath(add),
sub: variadicMath(sub),

@@ -1850,3 +1776,2 @@ mul: variadicMath(mul),

neg: neg,
eq: variadicComparator(eq),
seq: variadicComparator(seq),

@@ -1856,6 +1781,2 @@ neq: invert(variadicComparator(eq)),

not: not,
gt: variadicComparator(gt),
lt: variadicComparator(lt),
gte: variadicComparator(gte),
lte: variadicComparator(lte),
bitwiseAnd: variadicMath(bitwiseAnd),

@@ -1871,3 +1792,3 @@ bitwiseOr: variadicMath(bitwiseOr),

},{}],13:[function(require,module,exports){
},{}],12:[function(require,module,exports){
module.exports = function (_) {

@@ -2027,3 +1948,3 @@

},{}],14:[function(require,module,exports){
},{}],13:[function(require,module,exports){
module.exports = function (_) {

@@ -2059,3 +1980,3 @@

},{}],15:[function(require,module,exports){
},{}],14:[function(require,module,exports){
require("../common-js/_.array.builders.js")(_);

@@ -2066,3 +1987,2 @@ require("../common-js/_.array.selectors.js")(_);

require("../common-js/_.function.combinators.js")(_);
require("../common-js/_.function.dispatch.js")(_);
require("../common-js/_.function.iterators.js")(_);

@@ -2077,2 +1997,2 @@ require("../common-js/_.function.predicates.js")(_);

},{"../common-js/_.array.builders.js":1,"../common-js/_.array.selectors.js":2,"../common-js/_.collections.walk.js":3,"../common-js/_.function.arity.js":4,"../common-js/_.function.combinators.js":5,"../common-js/_.function.dispatch.js":6,"../common-js/_.function.iterators.js":7,"../common-js/_.function.predicates.js":8,"../common-js/_.object.builders.js":9,"../common-js/_.object.selectors.js":10,"../common-js/_.util.existential.js":11,"../common-js/_.util.operators.js":12,"../common-js/_.util.strings.js":13,"../common-js/_.util.trampolines.js":14}]},{},[15]);
},{"../common-js/_.array.builders.js":1,"../common-js/_.array.selectors.js":2,"../common-js/_.collections.walk.js":3,"../common-js/_.function.arity.js":4,"../common-js/_.function.combinators.js":5,"../common-js/_.function.iterators.js":6,"../common-js/_.function.predicates.js":7,"../common-js/_.object.builders.js":8,"../common-js/_.object.selectors.js":9,"../common-js/_.util.existential.js":10,"../common-js/_.util.operators.js":11,"../common-js/_.util.strings.js":12,"../common-js/_.util.trampolines.js":13}]},{},[14]);

@@ -1,1 +0,1 @@

!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){b.exports=function(a){var b=Array.prototype.slice,c=Array.prototype.concat,d=Array.prototype.sort,e=function(a){return null!=a};a.mixin({cat:function(){return a.reduce(arguments,function(d,e){return a.isArguments(e)?c.call(d,b.call(e)):c.call(d,e)},[])},cons:function(b,c){return a.cat([b],c)},chunk:function(b,c,d){var e=arguments,f=function(b){if(null==b)return[];var g=a.take(b,c);return c===a.size(g)?a.cons(g,f(a.drop(b,c))):3===e.length?(d=a.isArray(d)?d:a.repeat(c,d),[a.take(a.cat(g,d),c)]):[]};return f(b)},chunkAll:function(b,c,d){d=null!=d?d:c;var e=function(b,c,d){return a.isEmpty(b)?[]:a.cons(a.take(b,c),e(a.drop(b,d),c,d))};return e(b,c,d)},mapcat:function(b,c){return a.cat.apply(null,a.map(b,c))},interpose:function(c,d){if(!a.isArray(c))throw new TypeError;var e=a.size(c);return 0===e?c:1===e?c:b.call(a.mapcat(c,function(b){return a.cons(b,[d])}),0,-1)},weave:function(){return a.some(arguments)?1==arguments.length?arguments[0]:a.filter(a.flatten(a.zip.apply(null,arguments),!1),function(a){return null!=a}):[]},interleave:a.weave,repeat:function(b,c){return a.times(b,function(){return c})},cycle:function(b,c){return a.flatten(a.times(b,function(){return c}),!0)},splitAt:function(b,c){return[a.take(b,c),a.drop(b,c)]},iterateUntil:function(a,b,c){for(var d=[],e=a(c);b(e);)d.push(e),e=a(e);return d},takeSkipping:function(b,c){var d=[],e=a.size(b);if(0>=c)return[];if(1===c)return b;for(var f=0;e>f;f+=c)d.push(b[f]);return d},reductions:function(b,c,d){var e=[],f=d;return a.each(b,function(a,d){f=c(f,b[d]),e.push(f)}),e},keepIndexed:function(b,c){return a.filter(a.map(a.range(a.size(b)),function(a){return c(a,b[a])}),e)},reverseOrder:function(a){if("string"==typeof a)throw new TypeError("Strings cannot be reversed by _.reverseOrder");return b.call(a).reverse()},collate:function(b,c,f){if(!a.isArray(b))throw new TypeError("expected an array as the first argument");if(!a.isArray(c))throw new TypeError("expected an array as the second argument");return d.call(b,function(b,d){a.isFunction(f)?(valA=f.call(b),valB=f.call(d)):e(f)?(valA=b[f],valB=d[f]):(valA=b,valB=d);var g=a.indexOf(c,valA),h=a.indexOf(c,valB);return-1===g?1:-1===h?-1:g-h})}})}},{}],2:[function(a,b,c){b.exports=function(a){function b(d,e){return null==d?void 0:g(e)?a(e).map(function(a){return d[a]}).valueOf():b(d,c.call(arguments,1))}var c=Array.prototype.slice,d=Array.prototype.concat,e=function(a){return null!=a},f=function(a){return a!==!1&&e(a)},g=function(b){return a.isArray(b)||a.isArguments(b)};a.mixin({second:function(a,b,d){return null==a?void 0:null==b||d?a[1]:c.call(a,1,b)},third:function(a,b,d){return null==a?void 0:null==b||d?a[2]:c.call(a,2,b)},nth:function(a,b,c){return null==b||c?void 0:a[b]},nths:b,valuesAt:b,binPick:function h(b,d){return null==b?void 0:g(d)?a.nths(b,a.range(d.length).filter(function(a){return d[a]})):h(b,c.call(arguments,1))},takeWhile:function(b,c){if(!g(b))throw new TypeError;for(var d=a.size(b),e=0;d>e&&f(c(b[e]));e++);return a.take(b,e)},dropWhile:function(b,c){if(!g(b))throw new TypeError;for(var d=a.size(b),e=0;d>e&&f(c(b[e]));e++);return a.drop(b,e)},splitWith:function(b,c){return[a.takeWhile(b,c),a.dropWhile(b,c)]},partitionBy:function(b,c){if(a.isEmpty(b)||!e(b))return[];var f=a.first(b),g=c(f),h=d.call([f],a.takeWhile(a.rest(b),function(b){return a.isEqual(g,c(b))}));return d.call([h],a.partitionBy(a.drop(b,a.size(h)),c))},best:function(b,c){return a.reduce(b,function(a,b){return c(a,b)?a:b})},keep:function(b,c){if(!g(b))throw new TypeError("expected an array as the first argument");return a.filter(a.map(b,function(a){return c(a)}),e)}})}},{}],3:[function(a,b,c){b.exports=function(a){function b(b){return a.isElement(b)?b.children:b}function c(b,c,d,e,i,j){var k=[];return function l(b,m,n){if(a.isObject(b)){if(k.indexOf(b)>=0)throw new TypeError(h);k.push(b)}if(d){var o=d.call(i,b,m,n);if(o===g)return g;if(o===f)return}var p,q=c(b);if(a.isObject(q)&&!a.isEmpty(q)){j&&(p=a.isArray(b)?[]:{});var r=a.any(q,function(a,c){var d=l(a,c,b);return d===g?!0:void(p&&(p[c]=d))});if(r)return g}return e?e.call(i,b,m,n,p):void 0}(b)}function d(b,c,d){var e=[];return this.preorder(b,function(b,g){return d||g!=c?void(a.has(b,c)&&(e[e.length]=b[c])):f}),e}function e(c){var d=a.clone(i);return a.bindAll.apply(null,[d].concat(a.keys(d))),d._traversalStrategy=c||b,d}var f={},g={},h="Not a tree: same object found in two different branches",i={find:function(a,b,c){var d;return this.preorder(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,g):void 0},c),d},filter:function(a,b,c,d){var e=[];return null==a?e:(b(a,function(a,b,f){c.call(d,a,b,f)&&e.push(a)},null,this._traversalStrategy),e)},reject:function(a,b,c,d){return this.filter(a,b,function(a,b,e){return!c.call(d,a,b,e)})},map:function(a,b,c,d){var e=[];return b(a,function(a,b,f){e[e.length]=c.call(d,a,b,f)},null,this._traversalStrategy),e},pluck:function(a,b){return d.call(this,a,b,!1)},pluckRec:function(a,b){return d.call(this,a,b,!0)},postorder:function(a,b,d,e){e=e||this._traversalStrategy,c(a,e,null,b,d)},preorder:function(a,b,d,e){e=e||this._traversalStrategy,c(a,e,b,null,d)},reduce:function(a,b,d,e){var f=function(a,c,e,f){return b(f||d,a,c,e)};return c(a,this._traversalStrategy,null,f,e,!0)}};i.collect=i.map,i.detect=i.find,i.select=i.filter,a.extend(e,e()),a.mixin({walk:e})}},{}],4:[function(a,b,c){b.exports=function(a){function b(a){return function(){if(1===arguments.length)return a.apply(this,arguments);throw new RangeError("Only a single argument may be accepted.")}}var c=function(){function a(c,d,e,f,g,h){return h===!0?f.unshift(g):f.push(g),f.length==e?c.apply(d,f):b(function(){return a(c,d,e,f.slice(0),arguments[0],h)})}return function(c,d){var e=this;return b(function(){return a(c,e,c.length,[],arguments[0],d)})}}(),d=function(){var a=[];return function(b){if("function"!=typeof b)throw new Error("Argument 1 must be a function.");var c=b.length;return void 0===a[c]&&(a[c]=function(a){return function(){if(arguments.length!==c)throw new RangeError(c+" arguments must be applied.");return a.apply(this,arguments)}}),a[c](b)}}(),e=function(a){return c.call(this,a,!0)},f=function(a){return b(function(c){return b(function(b){return a.call(this,b,c)})})},g=function(a){return b(function(c){return b(function(d){return b(function(b){return a.call(this,b,d,c)})})})};a.mixin({fix:function(b){var c=a.rest(arguments),d=function(){for(var d=c.slice(),e=0,f=0;f<(d.length||e<arguments.length);f++)d[f]===a&&(d[f]=arguments[e++]);return b.apply(null,d)};return d._original=b,d},unary:function(a){return function(b){return a.call(this,b)}},binary:function(a){return function(b,c){return a.call(this,b,c)}},ternary:function(a){return function(b,c,d){return a.call(this,b,c,d)}},quaternary:function(a){return function(b,c,d,e){return a.call(this,b,c,d,e)}},curry:c,curryRight:e,rCurry:e,curry2:function(a){return b(function(c){return b(function(b){return a.call(this,c,b)})})},curry3:function(a){return b(function(c){return b(function(d){return b(function(b){return a.call(this,c,d,b)})})})},curryRight2:f,rcurry2:f,curryRight3:g,rcurry3:g,enforce:d}),a.arity=function(){var a={};return function b(c,d){if(null==a[c]){for(var e=new Array(c),f=0;c>f;++f)e[f]="__"+f;var g=e.join(),h="return function ("+g+") { return fun.apply(this, arguments); };";a[c]=new Function(["fun"],h)}return null==d?function(a){return b(c,a)}:a[c](d)}}()}},{}],5:[function(a,b,c){b.exports=function(a){function b(b,c){return a.arity(b.length,function(){return b.apply(this,g.call(arguments,c))})}var c=function(a){return null!=a},d=function(a){return a!==!1&&c(a)},e=[].reverse,f=[].slice,g=[].map,h=function(a){return function(b,c){return 1===arguments.length?function(c){return a(b,c)}:a(b,c)}};a.mixin({always:a.constant,pipeline:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return function(c){return a.reduce(b,function(a,b){return b(a)},c)}},composeRight:a.pipeline,conjoin:function(){var b=arguments;return function(c){return a.every(c,function(c){return a.every(b,function(a){return a(c)})})}},disjoin:function(){var b=arguments;return function(c){return a.some(c,function(c){return a.some(b,function(a){return a(c)})})}},comparator:function(a){return function(b,c){return d(a(b,c))?-1:d(a(c,b))?1:0}},complement:function(a){return function(){return!a.apply(this,arguments)}},splat:function(a){return function(b){return a.apply(this,b)}},unsplat:function(a){var b=a.length;return 1>b?a:1===b?function(){return a.call(this,f.call(arguments,0))}:function(){var c=arguments.length,d=f.call(arguments,0,b-1),e=Math.max(b-c-1,0),g=new Array(e),h=f.call(arguments,a.length-1);return a.apply(this,d.concat(g).concat([h]))}},unsplatl:function(a){var b=a.length;return 1>b?a:1===b?function(){return a.call(this,f.call(arguments,0))}:function(){var c=arguments.length,d=f.call(arguments,Math.max(c-b+1,0)),e=f.call(arguments,0,Math.max(c-b+1,0));return a.apply(this,[e].concat(d))}},mapArgs:h(b),juxt:function(){var b=arguments;return function(){var c=arguments;return a.map(b,function(a){return a.apply(this,c)},this)}},fnull:function(b){var d=a.rest(arguments);return function(){for(var e=a.toArray(arguments),f=a.size(d),g=0;f>g;g++)c(e[g])||(e[g]=d[g]);return b.apply(this,e)}},flip2:function(a){return function(){var b=f.call(arguments);return b[0]=arguments[1],b[1]=arguments[0],a.apply(this,b)}},flip:function(a){return function(){var b=e.call(arguments);return a.apply(this,b)}},functionalize:function(b){return function(c){return b.apply(c,a.rest(arguments))}},methodize:function(b){return function(){return b.apply(null,a.cons(this,arguments))}},k:a.always,t:a.pipeline}),a.unsplatr=a.unsplat,a.mapArgsWith=h(a.flip(b)),a.bound=function(b,c){var d=b[c];if(!a.isFunction(d))throw new TypeError("Expected property to be a function");return a.bind(d,b)}}},{}],6:[function(a,b,c){b.exports=function(a){var b=Array.prototype.slice;a.mixin({attempt:function(c,d){if(null==c)return void 0;var e=c[d],f=b.call(arguments,2);return a.isFunction(e)?e.apply(c,f):void 0}})}},{}],7:[function(a,b,c){b.exports=function(a){function b(a){return function(b){return a.call(this,b)}}function c(a,b,c){var d,e;for(d=void 0!==c?c:a(),e=a();null!=e;)d=b.call(e,d,e),e=a();return d}function d(a,b){var c=w;return function(){return c===w?c=a:null!=c&&(c=b.call(c,c)),c}}function e(a,b){var c,d,e=a;return function(){return null!=e?(c=b.call(e,e),d=c[1],e=null!=d?c[0]:void 0,d):void 0}}function f(a,b,c){var d=c;return function(){var c=a();return null==c?c:d=void 0===d?c:b.call(c,d,c)}}function g(a,b,c){var d,e,f=c;return function(){return e=a(),null==e?e:void 0===f?f=e:(d=b.call(e,f,e),f=d[0],d[1])}}function h(a,b){return function(){var c;return c=a(),null!=c?b.call(c,c):void 0}}function i(a,b){var c=null;return function(){var d,e;if(null==c){if(e=a(),null==e)return void(c=null);c=b.call(e,e)}for(;null==d;)if(d=c(),null==d){if(e=a(),null==e)return void(c=null);c=b.call(e,e)}return d}}function j(a,b){return function(){var c;for(c=a();null!=c;){if(b.call(c,c))return c;c=a()}return void 0}}function l(a,b){return j(a,function(a){return!b(a)})}function m(a,b){return j(a,b)()}function n(a,b,c){for(var d=0;b-->0;)a();return null!=c?function(){return++d<=c?a():void 0}:a}function o(a,b){return n(a,null==b?1:b)}function p(a,b){return n(a,0,null==b?1:b)}function q(a){var b=0;return function(){return a[b++]}}function r(a){var b,c,d;return b=0,d=[],c=function(){var e,f;return e=a[b++],e instanceof Array?(d.push({array:a,index:b}),a=e,b=0,c()):void 0===e?d.length>0?(f=d.pop(),a=f.array,b=f.index,c()):void 0:e}}function s(a){return function(){return a}}function t(a,b,c){return function(){var d;return a>b?void 0:(d=a,a+=c,d)}}function u(a,b,c){return function(){var d;return b>a?void 0:(d=a,a-=c,d)}}function v(a,b,c){return null==a?t(1,1/0,1):null==b?t(a,1/0,1):null==c?b>=a?t(a,b,1):u(a,b,1):c>0?t(a,b,c):0>c?u(a,b,Math.abs(c)):k(a)}var w={},x=b(v);a.iterators={accumulate:f,accumulateWithReturn:g,foldl:c,reduce:c,unfold:d,unfoldWithReturn:e,map:h,mapcat:i,select:j,reject:l,filter:j,find:m,slice:n,drop:o,take:p,List:q,Tree:r,constant:s,K:s,numbers:x,range:v}}},{}],8:[function(a,b,c){b.exports=function(a){a.mixin({isInstanceOf:function(a,b){return a instanceof b},isAssociative:function(b){return a.isArray(b)||a.isObject(b)||a.isArguments(b)},isIndexed:function(b){return a.isArray(b)||a.isString(b)||a.isArguments(b)},isSequential:function(b){return a.isArray(b)||a.isArguments(b)},isZero:function(a){return 0===a},isEven:function(b){return a.isFinite(b)&&0===(1&b)},isOdd:function(b){return a.isFinite(b)&&!a.isEven(b)},isPositive:function(a){return a>0},isNegative:function(a){return 0>a},isValidDate:function(b){return a.isDate(b)&&!a.isNaN(b.getTime())},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},isInteger:function(b){return a.isNumeric(b)&&b%1===0},isFloat:function(b){return a.isNumeric(b)&&!a.isInteger(b)},isJSON:function(a){try{JSON.parse(a)}catch(b){return!1}return!0},isIncreasing:function(){var b=a.size(arguments);if(1===b)return!0;if(2===b)return arguments[0]<arguments[1];for(var c=1;b>c;c++)if(arguments[c-1]>=arguments[c])return!1;return!0},isDecreasing:function(){var b=a.size(arguments);if(1===b)return!0;if(2===b)return arguments[0]>arguments[1];for(var c=1;b>c;c++)if(arguments[c-1]<=arguments[c])return!1;return!0}})}},{}],9:[function(a,b,c){b.exports=function(a){var b=(Array.prototype.slice,Array.prototype.concat),c=function(a){return null!=a},d=function(a){return a!==!1&&c(a)},e=function(b){return a.isArray(b)||a.isObject(b)},f=function(a){return function(b){return function(c){return a(c,b)}}};a.mixin({merge:function(){var c=a.some(arguments)?{}:null;return d(c)&&a.extend.apply(null,b.call([c],a.toArray(arguments))),c},renameKeys:function(d,e){return a.reduce(e,function(a,b,e){return c(d[e])?(a[b]=d[e],a):a},a.omit.apply(null,b.call([d],a.keys(e))))},snapshot:function(b){if(null==b||"object"!=typeof b)return b;var c=new b.constructor;for(var d in b)b.hasOwnProperty(d)&&(c[d]=a.snapshot(b[d]));return c},updatePath:function(b,d,f,g){if(!e(b))throw new TypeError("Attempted to update a non-associative object.");if(!c(f))return d(b);var h=a.isArray(f),i=h?f:[f],j=h?a.snapshot(b):a.clone(b),k=a.last(i),l=j;return a.each(a.initial(i),function(b){g&&!a.has(l,b)&&(l[b]=a.clone(g)),l=l[b]}),l[k]=d(l[k]),j},setPath:function(b,d,e,f){if(!c(e))throw new TypeError("Attempted to set a property at a null path.");return a.updatePath(b,function(){return d},e,f)},frequencies:f(a.countBy)(a.identity)})}},{}],10:[function(a,b,c){b.exports=function(a){var b=Array.prototype.concat,c=Array.prototype;c.slice;a.mixin({accessor:function(a){return function(b){return b&&b[a]}},dictionary:function(a){return function(b){return a&&b&&a[b]}},selectKeys:function(c,d){return a.pick.apply(null,b.call([c],d))},kv:function(b,c){return a.has(b,c)?[c,b[c]]:void 0},getPath:function d(b,c){return"string"==typeof c&&(c=c.split(".")),void 0===b?void 0:0===c.length?b:null===b?void 0:d(b[a.first(c)],a.rest(c))},hasPath:function e(b,c){"string"==typeof c&&(c=c.split("."));var d=c.length;return null==b&&d>0?!1:a.contains(["boolean","string","number"],typeof b)?!1:c[0]in b?1===d?!0:e(b[a.first(c)],a.rest(c)):!1},pickWhen:function(b,c){var d={};return a.each(b,function(a,e){c(b[e])&&(d[e]=b[e])}),d},omitWhen:function(b,c){return a.pickWhen(b,function(a){return!c(a)})}})}},{}],11:[function(a,b,c){b.exports=function(a){a.mixin({exists:function(a){return null!=a},truthy:function(b){return b!==!1&&a.exists(b)},falsey:function(b){return!a.truthy(b)},not:function(a){return!a},existsAll:function(){return a.every(arguments,a.exists)},truthyAll:function(){return a.every(arguments,a.truthy)},falseyAll:function(){return a.every(arguments,a.falsey)},firstExisting:function(){for(var b=0;b<arguments.length;b++)if(a.exists(arguments[b]))return arguments[b]}})}},{}],12:[function(a,b,c){b.exports=function(a){function b(b){return function(){return a.reduce(arguments,b)}}function c(a){return function(){for(var b,c=0;c<arguments.length-1;c++)if(b=a(arguments[c],arguments[c+1]),b===!1)return b;return b}}function d(a){return function(){return!a.apply(this,arguments)}}function e(a,b){return a+b}function f(a,b){return a-b}function g(a,b){return a*b}function h(a,b){return a/b}function i(a,b){return a%b}function j(a){return++a}function k(a){return--a}function l(a){return-a}function m(a,b){return a&b}function n(a,b){return a|b}function o(a,b){return a^b}function p(a,b){return a<<b}function q(a,b){return a>>b}function r(a,b){return a>>>b}function s(a){return~a}function t(a,b){return a==b}function u(a,b){return a===b}function v(a){return!a}function w(a,b){return a>b}function x(a,b){return b>a}function y(a,b){return a>=b}function z(a,b){return b>=a}a.mixin({add:b(e),sub:b(f),mul:b(g),div:b(h),mod:i,inc:j,dec:k,neg:l,eq:c(t),seq:c(u),neq:d(c(t)),sneq:d(c(u)),not:v,gt:c(w),lt:c(x),gte:c(y),lte:c(z),bitwiseAnd:b(m),bitwiseOr:b(n),bitwiseXor:b(o),bitwiseNot:s,bitwiseLeft:b(p),bitwiseRight:b(q),bitwiseZ:b(r)})}},{}],13:[function(a,b,c){b.exports=function(a){var b={boundary:/(\b.)/g,bracket:/(?:([^\[]+))|(?:\[(.*?)\])/g,capitalLetters:/([A-Z])/g,dot:/\./g,htmlTags:/<\/?[^<>]*>/gi,lowerThenUpper:/([a-z])([A-Z])/g,nonCamelCase:/[-_\s](\w)/g,plus:/\+/g,regex:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,space:/ /g,underscore:/_/g,upperThenLower:/\b([A-Z]+)([A-Z])([a-z])/g},c=function(a){return decodeURIComponent(a.replace(b.plus,"%20"))},d=function(b,c,e){return a.isUndefined(e)&&(e=!0),a.isArray(c)?a.map(c,function(a,c){return d(e?c:b+"[]",a,!1)}).join("&"):a.isObject(c)?a.map(c,function(a,c){return d(e?c:b+"["+c+"]",a,!1)}).join("&"):encodeURIComponent(b)+"="+encodeURIComponent(c)};a.mixin({explode:function(a){return a.split("")},fromQuery:function(d){var e,f,g,h,i,j=d.split("&"),k={};return a.each(j,function(d){for(d=d.split("="),e=c(d[0]),g=e,i=k,b.bracket.lastIndex=0;null!==(f=b.bracket.exec(e));)a.isUndefined(f[1])?(h=f[2],i[g]=i[g]||(h?{}:[]),i=i[g]):h=f[1],g=h||a.size(i);i[g]=c(d[1])}),k},implode:function(a){return a.join("")},toDash:function(a){return a=a.replace(b.capitalLetters,function(a){return"-"+a.toLowerCase()}),"-"==a.charAt(0)?a.substr(1):a},toQuery:function(a){return d("",a)},strContains:function(a,b){if("string"!=typeof a)throw new TypeError("First argument to strContains must be a string");return-1!=a.indexOf(b)},titleCase:function(a){return a.replace(b.boundary,function(a){return a.toUpperCase()})},slugify:function(a){return a.replace(b.lowerThenUpper,"$1-$2").replace(b.space,"-").replace(b.dot,"-").toLowerCase()},humanize:function(c){return a.capitalize(c.replace(b.underscore," ").replace(b.lowerThenUpper,"$1 $2").replace(b.upperThenLower,"$1 $2$3"))},stripTags:function(a){var c=a.replace(b.htmlTags,"");return c}})}},{}],14:[function(a,b,c){b.exports=function(a){a.mixin({done:function(b){var c=a(b);return c.stopTrampoline=!0,c},trampoline:function(b){for(var c=b.apply(b,a.rest(arguments));a.isFunction(c)&&(c=c(),!(c instanceof a&&c.stopTrampoline)););return c.value()}})}},{}],15:[function(a,b,c){a("../common-js/_.array.builders.js")(_),a("../common-js/_.array.selectors.js")(_),a("../common-js/_.collections.walk.js")(_),a("../common-js/_.function.arity.js")(_),a("../common-js/_.function.combinators.js")(_),a("../common-js/_.function.dispatch.js")(_),a("../common-js/_.function.iterators.js")(_),a("../common-js/_.function.predicates.js")(_),a("../common-js/_.object.builders.js")(_),a("../common-js/_.object.selectors.js")(_),a("../common-js/_.util.existential.js")(_),a("../common-js/_.util.operators.js")(_),a("../common-js/_.util.strings.js")(_),a("../common-js/_.util.trampolines.js")(_)},{"../common-js/_.array.builders.js":1,"../common-js/_.array.selectors.js":2,"../common-js/_.collections.walk.js":3,"../common-js/_.function.arity.js":4,"../common-js/_.function.combinators.js":5,"../common-js/_.function.dispatch.js":6,"../common-js/_.function.iterators.js":7,"../common-js/_.function.predicates.js":8,"../common-js/_.object.builders.js":9,"../common-js/_.object.selectors.js":10,"../common-js/_.util.existential.js":11,"../common-js/_.util.operators.js":12,"../common-js/_.util.strings.js":13,"../common-js/_.util.trampolines.js":14}]},{},[15]);
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){b.exports=function(a){var b=Array.prototype.slice,c=Array.prototype.concat,d=Array.prototype.sort,e=function(a){return null!=a};a.mixin({cat:function(){return a.reduce(arguments,function(d,e){return a.isArguments(e)?c.call(d,b.call(e)):c.call(d,e)},[])},cons:function(b,c){return a.cat([b],c)},chunkContrib:function(b,c,d){var e=arguments,f=function(b){if(null==b)return[];var g=a.take(b,c);return c===a.size(g)?a.cons(g,f(a.drop(b,c))):3===e.length?(d=a.isArray(d)?d:a.repeatContrib(c,d),[a.take(a.cat(g,d),c)]):[]};return f(b)},chunkAll:function(b,c,d){d=null!=d?d:c;var e=function(b,c,d){return a.isEmpty(b)?[]:a.cons(a.take(b,c),e(a.drop(b,d),c,d))};return e(b,c,d)},mapcat:function(b,c){return a.cat.apply(null,a.map(b,c))},interpose:function(c,d){if(!a.isArray(c))throw new TypeError;var e=a.size(c);return 0===e?c:1===e?c:b.call(a.mapcat(c,function(b){return a.cons(b,[d])}),0,-1)},weave:function(){return a.some(arguments)?1==arguments.length?arguments[0]:a.filter(a.flatten(a.zip.apply(null,arguments),!1),function(a){return null!=a}):[]},interleave:a.weave,repeatContrib:function(b,c){return a.times(b,function(){return c})},cycle:function(b,c){return a.flatten(a.times(b,function(){return c}),!0)},splitAt:function(b,c){return[a.take(b,c),a.drop(b,c)]},iterateUntil:function(a,b,c){for(var d=[],e=a(c);b(e);)d.push(e),e=a(e);return d},takeSkipping:function(b,c){var d=[],e=a.size(b);if(0>=c)return[];if(1===c)return b;for(var f=0;e>f;f+=c)d.push(b[f]);return d},reductions:function(b,c,d){var e=[],f=d;return a.each(b,function(a,d){f=c(f,b[d]),e.push(f)}),e},keepIndexed:function(b,c){return a.filter(a.map(a.range(a.size(b)),function(a){return c(a,b[a])}),e)},reverseOrder:function(a){if("string"==typeof a)throw new TypeError("Strings cannot be reversed by _.reverseOrder");return b.call(a).reverse()},collate:function(b,c,f){if(!a.isArray(b))throw new TypeError("expected an array as the first argument");if(!a.isArray(c))throw new TypeError("expected an array as the second argument");return d.call(b,function(b,d){a.isFunction(f)?(valA=f.call(b),valB=f.call(d)):e(f)?(valA=b[f],valB=d[f]):(valA=b,valB=d);var g=a.indexOf(c,valA),h=a.indexOf(c,valB);return-1===g?1:-1===h?-1:g-h})}})}},{}],2:[function(a,b,c){b.exports=function(a){function b(d,e){return null==d?void 0:f(e)?a(e).map(function(a){return d[a]}).valueOf():b(d,c.call(arguments,1))}var c=Array.prototype.slice,d=Array.prototype.concat,e=function(a){return null!=a},f=function(b){return a.isArray(b)||a.isArguments(b)};a.mixin({second:function(a,b,d){return null==a?void 0:null==b||d?a[1]:c.call(a,1,b)},third:function(a,b,d){return null==a?void 0:null==b||d?a[2]:c.call(a,2,b)},nth:function(a,b,c){return null==b||c?void 0:a[b]},nths:b,valuesAt:b,binPick:function g(b,d){return null==b?void 0:f(d)?a.nths(b,a.range(d.length).filter(function(a){return d[a]})):g(b,c.call(arguments,1))},splitWith:function(b,c){return[a.takeWhile(b,c),a.dropWhile(b,c)]},partitionBy:function(b,c){if(a.isEmpty(b)||!e(b))return[];var f=a.first(b),g=c(f),h=d.call([f],a.takeWhile(a.rest(b),function(b){return a.isEqual(g,c(b))}));return d.call([h],a.partitionBy(a.drop(b,a.size(h)),c))},best:function(b,c){return a.reduce(b,function(a,b){return c(a,b)?a:b})},keep:function(b,c){if(!f(b))throw new TypeError("expected an array as the first argument");return a.filter(a.map(b,function(a){return c(a)}),e)}})}},{}],3:[function(a,b,c){b.exports=function(a){function b(b){return a.isElement(b)?b.children:b}function c(b,c,d,e,i,j){var k=[];return function l(b,m,n){if(a.isObject(b)){if(k.indexOf(b)>=0)throw new TypeError(h);k.push(b)}if(d){var o=d.call(i,b,m,n);if(o===g)return g;if(o===f)return}var p,q=c(b);if(a.isObject(q)&&!a.isEmpty(q)){j&&(p=a.isArray(b)?[]:{});var r=a.any(q,function(a,c){var d=l(a,c,b);return d===g?!0:void(p&&(p[c]=d))});if(r)return g}return e?e.call(i,b,m,n,p):void 0}(b)}function d(b,c,d){var e=[];return this.preorder(b,function(b,g){return d||g!=c?void(a.has(b,c)&&(e[e.length]=b[c])):f}),e}function e(c){var d=a.clone(i);return a.bindAll.apply(null,[d].concat(a.keys(d))),d._traversalStrategy=c||b,d}var f={},g={},h="Not a tree: same object found in two different branches",i={find:function(a,b,c){var d;return this.preorder(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,g):void 0},c),d},filter:function(a,b,c,d){var e=[];return null==a?e:(b(a,function(a,b,f){c.call(d,a,b,f)&&e.push(a)},null,this._traversalStrategy),e)},reject:function(a,b,c,d){return this.filter(a,b,function(a,b,e){return!c.call(d,a,b,e)})},map:function(a,b,c,d){var e=[];return b(a,function(a,b,f){e[e.length]=c.call(d,a,b,f)},null,this._traversalStrategy),e},pluck:function(a,b){return d.call(this,a,b,!1)},pluckRec:function(a,b){return d.call(this,a,b,!0)},postorder:function(a,b,d,e){e=e||this._traversalStrategy,c(a,e,null,b,d)},preorder:function(a,b,d,e){e=e||this._traversalStrategy,c(a,e,b,null,d)},reduce:function(a,b,d,e){var f=function(a,c,e,f){return b(f||d,a,c,e)};return c(a,this._traversalStrategy,null,f,e,!0)}};i.collect=i.map,i.detect=i.find,i.select=i.filter,a.extend(e,e()),a.mixin({walk:e})}},{}],4:[function(a,b,c){b.exports=function(a){function b(a){return function(){if(1===arguments.length)return a.apply(this,arguments);throw new RangeError("Only a single argument may be accepted.")}}var c=function(){function a(c,d,e,f,g,h){return h===!0?f.unshift(g):f.push(g),f.length==e?c.apply(d,f):b(function(){return a(c,d,e,f.slice(0),arguments[0],h)})}return function(c,d){var e=this;return b(function(){return a(c,e,c.length,[],arguments[0],d)})}}(),d=function(){var a=[];return function(b){if("function"!=typeof b)throw new Error("Argument 1 must be a function.");var c=b.length;return void 0===a[c]&&(a[c]=function(a){return function(){if(arguments.length!==c)throw new RangeError(c+" arguments must be applied.");return a.apply(this,arguments)}}),a[c](b)}}(),e=function(a){return c.call(this,a,!0)},f=function(a){return b(function(c){return b(function(b){return a.call(this,b,c)})})},g=function(a){return b(function(c){return b(function(d){return b(function(b){return a.call(this,b,d,c)})})})};a.mixin({fix:function(b){var c=a.rest(arguments),d=function(){for(var d=c.slice(),e=0,f=0;f<(d.length||e<arguments.length);f++)d[f]===a&&(d[f]=arguments[e++]);return b.apply(null,d)};return d._original=b,d},unary:function(a){return function(b){return a.call(this,b)}},binary:function(a){return function(b,c){return a.call(this,b,c)}},ternary:function(a){return function(b,c,d){return a.call(this,b,c,d)}},quaternary:function(a){return function(b,c,d,e){return a.call(this,b,c,d,e)}},rCurry:e,curry2:function(a){return b(function(c){return b(function(b){return a.call(this,c,b)})})},curry3:function(a){return b(function(c){return b(function(d){return b(function(b){return a.call(this,c,d,b)})})})},curryRight2:f,rcurry2:f,curryRight3:g,rcurry3:g,enforce:d,arity:function(){var a={};return function b(c,d){if(null==a[c]){for(var e=new Array(c),f=0;c>f;++f)e[f]="__"+f;var g=e.join(),h="return function ("+g+") { return fun.apply(this, arguments); };";a[c]=new Function(["fun"],h)}return null==d?function(a){return b(c,a)}:a[c](d)}}()})}},{}],5:[function(a,b,c){b.exports=function(a){function b(b,c){return a.arity(b.length,function(){return b.apply(this,g.call(arguments,c))})}var c=function(a){return null!=a},d=function(a){return a!==!1&&c(a)},e=[].reverse,f=[].slice,g=[].map,h=function(a){return function(b,c){return 1===arguments.length?function(c){return a(b,c)}:a(b,c)}};a.mixin({always:a.constant,pipeline:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return function(c){return a.reduce(b,function(a,b){return b(a)},c)}},composeRight:a.pipeline,conjoin:function(){var b=arguments;return function(c){return a.every(c,function(c){return a.every(b,function(a){return a(c)})})}},disjoin:function(){var b=arguments;return function(c){return a.some(c,function(c){return a.some(b,function(a){return a(c)})})}},comparator:function(a){return function(b,c){return d(a(b,c))?-1:d(a(c,b))?1:0}},complement:function(a){return function(){return!a.apply(this,arguments)}},splat:function(a){return function(b){return a.apply(this,b)}},unsplat:function(a){var b=a.length;return 1>b?a:1===b?function(){return a.call(this,f.call(arguments,0))}:function(){var c=arguments.length,d=f.call(arguments,0,b-1),e=Math.max(b-c-1,0),g=new Array(e),h=f.call(arguments,a.length-1);return a.apply(this,d.concat(g).concat([h]))}},unsplatl:function(a){var b=a.length;return 1>b?a:1===b?function(){return a.call(this,f.call(arguments,0))}:function(){var c=arguments.length,d=f.call(arguments,Math.max(c-b+1,0)),e=f.call(arguments,0,Math.max(c-b+1,0));return a.apply(this,[e].concat(d))}},mapArgs:h(b),juxt:function(){var b=arguments;return function(){var c=arguments;return a.map(b,function(a){return a.apply(this,c)},this)}},fnull:function(b){var d=a.rest(arguments);return function(){for(var e=a.toArray(arguments),f=a.size(d),g=0;f>g;g++)c(e[g])||(e[g]=d[g]);return b.apply(this,e)}},flip2:function(a){return function(){var b=f.call(arguments);return b[0]=arguments[1],b[1]=arguments[0],a.apply(this,b)}},flip:function(a){return function(){var b=e.call(arguments);return a.apply(this,b)}},functionalize:function(b){return function(c){return b.apply(c,a.rest(arguments))}},methodize:function(b){return function(){return b.apply(null,a.cons(this,arguments))}},k:a.always,t:a.pipeline}),a.unsplatr=a.unsplat,a.mapArgsWith=h(a.flip(b)),a.bound=function(b,c){var d=b[c];if(!a.isFunction(d))throw new TypeError("Expected property to be a function");return a.bind(d,b)}}},{}],6:[function(a,b,c){b.exports=function(a){function b(a){return function(b){return a.call(this,b)}}function c(a,b,c){var d,e;for(d=void 0!==c?c:a(),e=a();null!=e;)d=b.call(e,d,e),e=a();return d}function d(a,b){var c=w;return function(){return c===w?c=a:null!=c&&(c=b.call(c,c)),c}}function e(a,b){var c,d,e=a;return function(){return null!=e?(c=b.call(e,e),d=c[1],e=null!=d?c[0]:void 0,d):void 0}}function f(a,b,c){var d=c;return function(){var c=a();return null==c?c:d=void 0===d?c:b.call(c,d,c)}}function g(a,b,c){var d,e,f=c;return function(){return e=a(),null==e?e:void 0===f?f=e:(d=b.call(e,f,e),f=d[0],d[1])}}function h(a,b){return function(){var c;return c=a(),null!=c?b.call(c,c):void 0}}function i(a,b){var c=null;return function(){var d,e;if(null==c){if(e=a(),null==e)return void(c=null);c=b.call(e,e)}for(;null==d;)if(d=c(),null==d){if(e=a(),null==e)return void(c=null);c=b.call(e,e)}return d}}function j(a,b){return function(){var c;for(c=a();null!=c;){if(b.call(c,c))return c;c=a()}return void 0}}function l(a,b){return j(a,function(a){return!b(a)})}function m(a,b){return j(a,b)()}function n(a,b,c){for(var d=0;b-->0;)a();return null!=c?function(){return++d<=c?a():void 0}:a}function o(a,b){return n(a,null==b?1:b)}function p(a,b){return n(a,0,null==b?1:b)}function q(a){var b=0;return function(){return a[b++]}}function r(a){var b,c,d;return b=0,d=[],c=function(){var e,f;return e=a[b++],e instanceof Array?(d.push({array:a,index:b}),a=e,b=0,c()):void 0===e?d.length>0?(f=d.pop(),a=f.array,b=f.index,c()):void 0:e}}function s(a){return function(){return a}}function t(a,b,c){return function(){var d;return a>b?void 0:(d=a,a+=c,d)}}function u(a,b,c){return function(){var d;return b>a?void 0:(d=a,a-=c,d)}}function v(a,b,c){return null==a?t(1,1/0,1):null==b?t(a,1/0,1):null==c?b>=a?t(a,b,1):u(a,b,1):c>0?t(a,b,c):0>c?u(a,b,Math.abs(c)):k(a)}var w={},x=b(v);a.iterators={accumulate:f,accumulateWithReturn:g,foldl:c,reduce:c,unfold:d,unfoldWithReturn:e,map:h,mapcat:i,select:j,reject:l,filter:j,find:m,slice:n,drop:o,take:p,List:q,Tree:r,constant:s,K:s,numbers:x,range:v}}},{}],7:[function(a,b,c){b.exports=function(a){a.mixin({isInstanceOf:function(a,b){return a instanceof b},isAssociative:function(b){return a.isArray(b)||a.isObject(b)||a.isArguments(b)},isIndexed:function(b){return a.isArray(b)||a.isString(b)||a.isArguments(b)},isSequential:function(b){return a.isArray(b)||a.isArguments(b)},isZero:function(a){return 0===a},isEven:function(b){return a.isFinite(b)&&0===(1&b)},isOdd:function(b){return a.isFinite(b)&&!a.isEven(b)},isPositive:function(a){return a>0},isNegative:function(a){return 0>a},isValidDate:function(b){return a.isDate(b)&&!a.isNaN(b.getTime())},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},isInteger:function(b){return a.isNumeric(b)&&b%1===0},isFloat:function(b){return a.isNumeric(b)&&!a.isInteger(b)},isJSON:function(a){try{JSON.parse(a)}catch(b){return!1}return!0},isIncreasing:function(){var b=a.size(arguments);if(1===b)return!0;if(2===b)return arguments[0]<arguments[1];for(var c=1;b>c;c++)if(arguments[c-1]>=arguments[c])return!1;return!0},isDecreasing:function(){var b=a.size(arguments);if(1===b)return!0;if(2===b)return arguments[0]>arguments[1];for(var c=1;b>c;c++)if(arguments[c-1]<=arguments[c])return!1;return!0}})}},{}],8:[function(a,b,c){b.exports=function(a){var b=(Array.prototype.slice,Array.prototype.concat),c=function(a){return null!=a},d=function(b){return a.isArray(b)||a.isObject(b)},e=function(a){return function(b){return function(c){return a(c,b)}}};a.mixin({renameKeys:function(d,e){return a.reduce(e,function(a,b,e){return c(d[e])?(a[b]=d[e],a):a},a.omit.apply(null,b.call([d],a.keys(e))))},snapshot:function(b){if(null==b||"object"!=typeof b)return b;var c=new b.constructor;for(var d in b)b.hasOwnProperty(d)&&(c[d]=a.snapshot(b[d]));return c},updatePath:function(b,e,f,g){if(!d(b))throw new TypeError("Attempted to update a non-associative object.");if(!c(f))return e(b);var h=a.isArray(f),i=h?f:[f],j=h?a.snapshot(b):a.clone(b),k=a.last(i),l=j;return a.each(a.initial(i),function(b){g&&!a.has(l,b)&&(l[b]=a.clone(g)),l=l[b]}),l[k]=e(l[k]),j},setPath:function(b,d,e,f){if(!c(e))throw new TypeError("Attempted to set a property at a null path.");return a.updatePath(b,function(){return d},e,f)},frequencies:e(a.countBy)(a.identity)})}},{}],9:[function(a,b,c){b.exports=function(a){var b=Array.prototype.concat,c=Array.prototype;c.slice;a.mixin({accessor:function(a){return function(b){return b&&b[a]}},dictionary:function(a){return function(b){return a&&b&&a[b]}},selectKeys:function(c,d){return a.pick.apply(null,b.call([c],d))},kv:function(b,c){return a.has(b,c)?[c,b[c]]:void 0},getPath:function d(b,c){return"string"==typeof c&&(c=c.split(".")),void 0===b?void 0:0===c.length?b:null===b?void 0:d(b[a.first(c)],a.rest(c))},hasPath:function e(b,c){"string"==typeof c&&(c=c.split("."));var d=c.length;return null==b&&d>0?!1:a.contains(["boolean","string","number"],typeof b)?!1:c[0]in b?1===d?!0:e(b[a.first(c)],a.rest(c)):!1},pickWhen:function(b,c){var d={};return a.each(b,function(a,e){c(b[e])&&(d[e]=b[e])}),d},omitWhen:function(b,c){return a.pickWhen(b,function(a){return!c(a)})}})}},{}],10:[function(a,b,c){b.exports=function(a){a.mixin({exists:function(a){return null!=a},truthy:function(b){return b!==!1&&a.exists(b)},falsey:function(b){return!a.truthy(b)},not:function(a){return!a},existsAll:function(){return a.every(arguments,a.exists)},truthyAll:function(){return a.every(arguments,a.truthy)},falseyAll:function(){return a.every(arguments,a.falsey)},firstExisting:function(){for(var b=0;b<arguments.length;b++)if(a.exists(arguments[b]))return arguments[b]}})}},{}],11:[function(a,b,c){b.exports=function(a){function b(b){return function(){return a.reduce(arguments,b)}}function c(a){return function(){for(var b,c=0;c<arguments.length-1;c++)if(b=a(arguments[c],arguments[c+1]),b===!1)return b;return b}}function d(a){return function(){return!a.apply(this,arguments)}}function e(a,b){return a-b}function f(a,b){return a*b}function g(a,b){return a/b}function h(a,b){return a%b}function i(a){return++a}function j(a){return--a}function k(a){return-a}function l(a,b){return a&b}function m(a,b){return a|b}function n(a,b){return a^b}function o(a,b){return a<<b}function p(a,b){return a>>b}function q(a,b){return a>>>b}function r(a){return~a}function s(a,b){return a==b}function t(a,b){return a===b}function u(a){return!a}a.mixin({sub:b(e),mul:b(f),div:b(g),mod:h,inc:i,dec:j,neg:k,seq:c(t),neq:d(c(s)),sneq:d(c(t)),not:u,bitwiseAnd:b(l),bitwiseOr:b(m),bitwiseXor:b(n),bitwiseNot:r,bitwiseLeft:b(o),bitwiseRight:b(p),bitwiseZ:b(q)})}},{}],12:[function(a,b,c){b.exports=function(a){var b={boundary:/(\b.)/g,bracket:/(?:([^\[]+))|(?:\[(.*?)\])/g,capitalLetters:/([A-Z])/g,dot:/\./g,htmlTags:/<\/?[^<>]*>/gi,lowerThenUpper:/([a-z])([A-Z])/g,nonCamelCase:/[-_\s](\w)/g,plus:/\+/g,regex:/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,space:/ /g,underscore:/_/g,upperThenLower:/\b([A-Z]+)([A-Z])([a-z])/g},c=function(a){return decodeURIComponent(a.replace(b.plus,"%20"))},d=function(b,c,e){return a.isUndefined(e)&&(e=!0),a.isArray(c)?a.map(c,function(a,c){return d(e?c:b+"[]",a,!1)}).join("&"):a.isObject(c)?a.map(c,function(a,c){return d(e?c:b+"["+c+"]",a,!1)}).join("&"):encodeURIComponent(b)+"="+encodeURIComponent(c)};a.mixin({explode:function(a){return a.split("")},fromQuery:function(d){var e,f,g,h,i,j=d.split("&"),k={};return a.each(j,function(d){for(d=d.split("="),e=c(d[0]),g=e,i=k,b.bracket.lastIndex=0;null!==(f=b.bracket.exec(e));)a.isUndefined(f[1])?(h=f[2],i[g]=i[g]||(h?{}:[]),i=i[g]):h=f[1],g=h||a.size(i);i[g]=c(d[1])}),k},implode:function(a){return a.join("")},toDash:function(a){return a=a.replace(b.capitalLetters,function(a){return"-"+a.toLowerCase()}),"-"==a.charAt(0)?a.substr(1):a},toQuery:function(a){return d("",a)},strContains:function(a,b){if("string"!=typeof a)throw new TypeError("First argument to strContains must be a string");return-1!=a.indexOf(b)},titleCase:function(a){return a.replace(b.boundary,function(a){return a.toUpperCase()})},slugify:function(a){return a.replace(b.lowerThenUpper,"$1-$2").replace(b.space,"-").replace(b.dot,"-").toLowerCase()},humanize:function(c){return a.capitalize(c.replace(b.underscore," ").replace(b.lowerThenUpper,"$1 $2").replace(b.upperThenLower,"$1 $2$3"))},stripTags:function(a){var c=a.replace(b.htmlTags,"");return c}})}},{}],13:[function(a,b,c){b.exports=function(a){a.mixin({done:function(b){var c=a(b);return c.stopTrampoline=!0,c},trampoline:function(b){for(var c=b.apply(b,a.rest(arguments));a.isFunction(c)&&(c=c(),!(c instanceof a&&c.stopTrampoline)););return c.value()}})}},{}],14:[function(a,b,c){a("../common-js/_.array.builders.js")(_),a("../common-js/_.array.selectors.js")(_),a("../common-js/_.collections.walk.js")(_),a("../common-js/_.function.arity.js")(_),a("../common-js/_.function.combinators.js")(_),a("../common-js/_.function.iterators.js")(_),a("../common-js/_.function.predicates.js")(_),a("../common-js/_.object.builders.js")(_),a("../common-js/_.object.selectors.js")(_),a("../common-js/_.util.existential.js")(_),a("../common-js/_.util.operators.js")(_),a("../common-js/_.util.strings.js")(_),a("../common-js/_.util.trampolines.js")(_)},{"../common-js/_.array.builders.js":1,"../common-js/_.array.selectors.js":2,"../common-js/_.collections.walk.js":3,"../common-js/_.function.arity.js":4,"../common-js/_.function.combinators.js":5,"../common-js/_.function.iterators.js":6,"../common-js/_.function.predicates.js":7,"../common-js/_.object.builders.js":8,"../common-js/_.object.selectors.js":9,"../common-js/_.util.existential.js":10,"../common-js/_.util.operators.js":11,"../common-js/_.util.strings.js":12,"../common-js/_.util.trampolines.js":13}]},{},[14]);

@@ -0,0 +0,0 @@ ### array.builders

@@ -0,0 +0,0 @@ ### array.selectors

@@ -0,0 +0,0 @@ ### collections.walk

@@ -0,0 +0,0 @@ ### function.arity

@@ -0,0 +0,0 @@ ### function.combinators

@@ -0,0 +0,0 @@ ### function.iterators

@@ -0,0 +0,0 @@ ### function.predicates

@@ -0,0 +0,0 @@ ### object.builders

@@ -0,0 +0,0 @@ ### object.selectors

@@ -0,0 +0,0 @@ ### util.existential

@@ -0,0 +0,0 @@ ### util.operators

@@ -0,0 +0,0 @@ ### util.trampolines

@@ -0,0 +0,0 @@ Examples for _.walk

{
"name": "lodash-contrib",
"description": "The brass buckles on lodash's utility belt",
"version": "31001.0.0",
"version": "31001.1.0",
"main": "dist/lodash-contrib.commonjs.js",

@@ -6,0 +6,0 @@ "dependencies": {

@@ -1,2 +0,2 @@

The brass buckles on lodash's utility belt
The brass buckles on lodash's utility belt

@@ -38,3 +38,3 @@ Basically a [`lodash`](http://lodash.com/) compatible fork of [`underscore-contrib`](https://github.com/documentcloud/underscore-contrib)

You could also use [browserify](http://browserify.org/) to bundle your code into a JavaScript file that you can include in a web page.
You could also use [browserify](http://browserify.org/) to bundle your code into a JavaScript file that you can include in a web page.
Require `lodash-contrib` in your main script file (e.g. `test.js`) like so:

@@ -50,3 +50,3 @@

then you could run `browserify test.js -o browserified.js` to get `lodash`, `lodash-contrib` and your code into `browserified.js`.
####Node

@@ -56,8 +56,7 @@

At the moment there are no cross-contrib dependencies (i.e. each library can stand by itself), but that may
change in the future.
Contributing
------------
**We need some docs sync** since rebasing to version 3 (some methods renamed xxxContrib)
There is still a lot of work to do around perf, documentation, examples, testing and distribution so any help

@@ -64,0 +63,0 @@ in those areas is welcomed. Pull requests are accepted, but please search the [issues](https://github.com/empeeric/lodash-contrib/issues)

@@ -0,0 +0,0 @@ $(document).ready(function() {

@@ -0,0 +0,0 @@ $(document).ready(function() {

@@ -0,0 +0,0 @@ $(document).ready(function() {

@@ -0,0 +0,0 @@ $(document).ready(function() {

@@ -37,2 +37,230 @@ var _ = require('../..');

});
describe("cat", function () {
// no args
assert.deepEqual(_.cat(), [], 'should return an empty array when given no args');
// one arg
assert.deepEqual(_.cat([]), [], 'should concatenate one empty array');
assert.deepEqual(_.cat([1, 2, 3]), [1, 2, 3], 'should concatenate one homogenious array');
var result = _.cat([1, "2", [3], {n: 4}]);
assert.deepEqual(result, [1, "2", [3], {n: 4}], 'should concatenate one heterogenious array');
result = (function () { return _.cat(arguments); })(1, 2, 3);
assert.deepEqual(result, [1, 2, 3], 'should concatenate the arguments object');
// two args
assert.deepEqual(_.cat([1, 2, 3], [4, 5, 6]), [1, 2, 3, 4, 5, 6], 'should concatenate two arrays');
result = (function () { return _.cat(arguments, [4, 5, 6]); })(1, 2, 3);
assert.deepEqual(result, [1, 2, 3, 4, 5, 6], 'should concatenate an array and an arguments object');
// > 2 args
var a = [1, 2, 3];
var b = [4, 5, 6];
var c = [7, 8, 9];
var d = [0, 0, 0];
assert.deepEqual(_.cat(a, b, c), [1, 2, 3, 4, 5, 6, 7, 8, 9], 'should concatenate three arrays');
assert.deepEqual(_.cat(a, b, c, d), [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0], 'should concatenate four arrays');
result = (function () { return _.cat(arguments, b, c, d); }).apply(null, a);
assert.deepEqual(result, [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0], 'should concatenate four arrays, including an arguments object');
// heterogenious types
assert.deepEqual(_.cat([1], 2), [1, 2], 'should concatenate mixed types');
assert.deepEqual(_.cat([1], 2, 3), [1, 2, 3], 'should concatenate mixed types');
assert.deepEqual(_.cat(1, 2, 3), [1, 2, 3], 'should concatenate mixed types');
result = (function () { return _.cat(arguments, 4, 5, 6); })(1, 2, 3);
assert.deepEqual(result, [1, 2, 3, 4, 5, 6], 'should concatenate mixed types, including an arguments object');
});
describe("cons", function () {
assert.deepEqual(_.cons(0, []), [0], 'should insert the first arg into the array given as the second arg');
assert.deepEqual(_.cons(1, [2]), [1, 2], 'should insert the first arg into the array given as the second arg');
assert.deepEqual(_.cons([0], [1, 2, 3]), [[0], 1, 2, 3], 'should insert the first arg into the array given as the second arg');
assert.deepEqual(_.cons(1, 2), [1, 2], 'should create a pair if the second is not an array');
assert.deepEqual(_.cons([1], 2), [[1], 2], 'should create a pair if the second is not an array');
result = (function () { return _.cons(0, arguments); })(1, 2, 3);
assert.deepEqual(result, [0, 1, 2, 3], 'should construct an array given an arguments object as the tail');
var a = [1, 2, 3];
var result = _.cons(0, a);
assert.deepEqual(a, [1, 2, 3], 'should not modify the original tail');
});
it("chunkContrib", function (done) {
var a = _.range(4);
var b = _.range(5);
var c = _.range(7);
assert.deepEqual(_.chunkContrib(a, 2), [[0, 1], [2, 3]], 'should chunk into the size given');
it('should chunk into the size given. Extras are dropped', function () {
assert.deepEqual(_.chunkContrib(b, 2), [[0, 1], [2, 3]]);
});
var pre = _.clone(a);
var __ = _.chunkContrib(a, 4);
var post = _.clone(a);
assert.deepEqual(pre, post, 'should not modify the original array');
assert.deepEqual(_.chunkContrib(c, 3, [7, 8]), [[0, 1, 2], [3, 4, 5], [6, 7, 8]], 'should allow one to specify a padding array');
assert.deepEqual(_.chunkContrib(b, 3, 9), [[0, 1, 2], [3, 4, 9]], 'should allow one to specify a padding value');
assert.deepEqual(_.chunkContrib(a, 3, 9), [[0, 1, 2], [3, 9, 9]], 'should repeat the padding value');
assert.deepEqual(_.chunkContrib(a, 3, undefined), [[0, 1, 2], [3, undefined, undefined]], 'should allow padding with undefined');
done();
});
describe("chunkAll", function () {
var a = _.range(4);
var b = _.range(10);
assert.deepEqual(_.chunkAll(a, 2), [[0, 1], [2, 3]], 'should chunk into the size given');
assert.deepEqual(_.chunkAll(b, 4), [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9]], 'should chunk into the size given, with a small end');
var result = _.chunkAll(a, 2);
assert.deepEqual(a, _.range(4), 'should not modify the original array');
assert.deepEqual(_.chunkAll(b, 2, 4), [[0, 1], [4, 5], [8, 9]], 'should chunk into the size given, with skips');
assert.deepEqual(_.chunkAll(b, 3, 4), [[0, 1, 2], [4, 5, 6], [8, 9]], 'should chunk into the size given, with skips and a small end');
});
describe("mapcat", function () {
var a = [1, 2, 3];
var commaize = function (e) { return _.cons(e, [","]); };
assert.deepEqual(_.mapcat(a, commaize), [1, ",", 2, ",", 3, ","], 'should return an array with all intermediate mapped arrays concatenated');
});
describe("interpose", function () {
var a = [1, 2, 3];
var b = [1, 2];
var c = [1];
assert.deepEqual(_.interpose(a, 0), [1, 0, 2, 0, 3], 'should put the 2nd arg between the elements of the array given');
assert.deepEqual(_.interpose(b, 0), [1, 0, 2], 'should put the 2nd arg between the elements of the array given');
assert.deepEqual(_.interpose(c, 0), [1], 'should return the array given if nothing to interpose');
assert.deepEqual(_.interpose([], 0), [], 'should return an empty array given an empty array');
var result = _.interpose(b, 0);
assert.deepEqual(b, [1, 2], 'should not modify the original array');
});
describe("weave", function () {
var a = [1, 2, 3];
var b = [1, 2];
var c = ['a', 'b', 'c'];
var d = [1, [2]];
// zero
assert.deepEqual(_.weave(), [], 'should weave zero arrays');
// one
assert.deepEqual(_.weave([]), [], 'should weave one array');
assert.deepEqual(_.weave([1, [2]]), [1, [2]], 'should weave one array');
// two
assert.deepEqual(_.weave(a, b), [1, 1, 2, 2, 3], 'should weave two arrays');
assert.deepEqual(_.weave(a, a), [1, 1, 2, 2, 3, 3], 'should weave two arrays');
assert.deepEqual(_.weave(c, a), ['a', 1, 'b', 2, 'c', 3], 'should weave two arrays');
assert.deepEqual(_.weave(a, d), [1, 1, 2, [2], 3], 'should weave two arrays');
// > 2
assert.deepEqual(_.weave(a, b, c), [1, 1, 'a', 2, 2, 'b', 3, 'c'], 'should weave more than two arrays');
assert.deepEqual(_.weave(a, b, c, d), [1, 1, 'a', 1, 2, 2, 'b', [2], 3, 'c'], 'should weave more than two arrays');
});
it("repeatContrib", function () {
assert.deepEqual(_.repeatContrib(3, 1), [1, 1, 1], 'should build an array of size n with the specified element in each slot');
assert.deepEqual(_.repeatContrib(0), [], 'should return an empty array if given zero and no repeat arg');
assert.deepEqual(_.repeatContrib(0, 9999), [], 'should return an empty array if given zero and some repeat arg');
});
describe("cycle", function () {
var a = [1, 2, 3];
assert.deepEqual(_.cycle(3, a), [1, 2, 3, 1, 2, 3, 1, 2, 3], 'should build an array with the specified array contents repeated n times');
assert.deepEqual(_.cycle(0, a), [], 'should return an empty array if told to repeat zero times');
assert.deepEqual(_.cycle(-1000, a), [], 'should return an empty array if told to repeat negative times');
});
describe("splitAt", function () {
var a = [1, 2, 3, 4, 5];
assert.deepEqual(_.splitAt(a, 2), [[1, 2], [3, 4, 5]], 'should bifurcate an array at a given index');
assert.deepEqual(_.splitAt(a, 0), [[], [1, 2, 3, 4, 5]], 'should bifurcate an array at a given index');
assert.deepEqual(_.splitAt(a, 5), [[1, 2, 3, 4, 5], []], 'should bifurcate an array at a given index');
assert.deepEqual(_.splitAt([], 5), [[], []], 'should bifurcate an array at a given index');
});
describe("iterateUntil", function () {
var dec = function (n) { return n - 1; };
var isPos = function (n) { return n > 0; };
assert.deepEqual(_.iterateUntil(dec, isPos, 6), [5, 4, 3, 2, 1], 'should build an array, decrementing a number while positive');
});
describe("takeSkipping", function () {
assert.deepEqual(_.takeSkipping(_.range(5), 0), [], 'should take nothing if told to skip by zero');
assert.deepEqual(_.takeSkipping(_.range(5), -1), [], 'should take nothing if told to skip by negative');
assert.deepEqual(_.takeSkipping(_.range(5), 100), [0], 'should take first element if told to skip by big number');
assert.deepEqual(_.takeSkipping(_.range(5), 1), [0, 1, 2, 3, 4], 'should take every element in an array');
assert.deepEqual(_.takeSkipping(_.range(10), 2), [0, 2, 4, 6, 8], 'should take every 2nd element in an array');
});
describe("reductions", function () {
var result = _.reductions([1, 2, 3, 4, 5], function (agg, n) {
return agg + n;
}, 0);
assert.deepEqual(result, [1, 3, 6, 10, 15], 'should retain each intermediate step in a reduce');
});
describe("keepIndexed", function () {
var a = ['a', 'b', 'c', 'd', 'e'];
var b = [-9, 0, 29, -7, 45, 3, -8];
var oddy = function (k, v) { return _.isOdd(k) ? v : undefined; };
var posy = function (k, v) { return _.isPositive(v) ? k : undefined; };
assert.deepEqual(_.keepIndexed(a, _.isOdd), [false, true, false, true, false], 'runs the predciate on the index, and not the element');
assert.deepEqual(_.keepIndexed(a, oddy), ['b', 'd'], 'keeps elements whose index passes a truthy test');
assert.deepEqual(_.keepIndexed(b, posy), [2, 4, 5], 'keeps elements whose index passes a truthy test');
assert.deepEqual(_.keepIndexed(_.range(10), oddy), [1, 3, 5, 7, 9], 'keeps elements whose index passes a truthy test');
});
it('reverseOrder', function () {
var arr = [1, 2, 3];
assert.deepEqual(_.reverseOrder(arr), [3, 2, 1], 'returns an array whose elements are in the opposite order of the argument');
assert.deepEqual(arr, [1, 2, 3], 'should not mutate the argument');
var throwingFn = function () { _.reverseOrder('string'); };
assert.throws(throwingFn, TypeError, 'throws a TypeError when given a string');
var argObj = (function () { return arguments; })(1, 2, 3);
assert.deepEqual(_.reverseOrder(argObj), [3, 2, 1], 'works with other array-like objects');
});
describe('collate', function () {
var properOrder = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'];
var itemsBare = ['green', 'yellow', 'violet', 'red', 'indigo', 'orange', 'blue'];
var itemsObj = [{'prop': 'green'}, {'prop': 'yellow'}, {'prop': 'violet'}, {'prop': 'red'}, {'prop': 'indigo'}, {'prop': 'orange'}, {'prop': 'blue'}];
var itemsRaw = ['g', 'y', 'v', 'r', 'i', 'o', 'b'];
var rawConvertFunc = function () {
return ({
'r': 'red',
'o': 'orange',
'y': 'yellow',
'g': 'green',
'b': 'blue',
'i': 'indigo',
'v': 'violet'
})[this];
};
assert.deepEqual(_.collate(itemsBare, properOrder), properOrder, 'returns an array of scalars whose elements are ordered according to provided lexicon');
assert.deepEqual(_.collate(itemsObj, properOrder, 'prop'), [{'prop': 'red'}, {'prop': 'orange'}, {'prop': 'yellow'}, {'prop': 'green'}, {'prop': 'blue'}, {'prop': 'indigo'}, {'prop': 'violet'}], 'returns an array of objects that are ordered according to provided lexicon');
assert.deepEqual(_.collate(itemsRaw, properOrder, rawConvertFunc), ['r', 'o', 'y', 'g', 'b', 'i', 'v'], 'returns an array whose elements are sorted by derived value according to provided lexicon');
});
});

@@ -15,3 +15,13 @@ var assert = require('assert');

});
it("but should not override methods", function (done) {
var lodash = require('lodash');
var contrib = require('../..');
var methods = lodash.remove(lodash.keys(lodash), '_');
lodash.forEach(methods, function(m) {
assert.equal(contrib[m].toString(), lodash[m].toString(), m + ' should be the same');
});
done();
});
});

@@ -0,0 +0,0 @@ $(document).ready(function() {

@@ -0,0 +0,0 @@ $(document).ready(function() {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc