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 2.4.1 to 4.1200.0

.travis.yml

4

CONTRIBUTING.md
## How to contribute to lodash-contrib
* Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/lodash-contrib/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
* Before you open a ticket or send a pull request, please [search](https://github.com/empeeric/lodash-contrib/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
* Before sending a pull request for a feature, be sure to have [tests like found in lodash](http://lodashjs.org/test/). Tests may be run in a browser by opening `test/index.html`. Tests and linting can be run in the terminal by using the `grunt test` command, or `grunt watch:test` to automatically rerun after file save.
* Use the same coding [style as lodash](https://github.com/documentcloud/lodash/blob/master/lodash.js).
* Use the same coding [style as lodash](https://github.com/documentcloud/lodash/blob/master/lodash.js).
* In your pull request, do not add documentation, edit the files in `dist/` or use grunt to re-build the files in `dist/`. We'll do those things before cutting a new release.

@@ -1,27 +0,7 @@

// lodash-contrib v2.4.1
// =========================
// > https://github.com/Empeeric/lodash-contrib
// > (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// > (c) 2013 Refael Ackermann, & Empeeric
// > lodash-contrib may be freely distributed under the MIT license.
// lodash-contrib (lodash.array.builders.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
(function(root) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers
// -------
(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){
module.exports = function(_) {
// Create quick reference variables for speed access to core prototypes.
var slice = Array.prototype.slice,
concat = Array.prototype.concat;
concat = Array.prototype.concat,
sort = Array.prototype.sort;

@@ -54,7 +34,8 @@ var existy = function(x) { return x != null; };

// Takes an array and parititions it some number of times into
// Takes an array and chunks it some number of times into
// sub-arrays of size n. Allows and optional padding array as
// the third argument to fill in the tail partition when n is
// not sufficient to build paritions of the same size.
partition: function(array, n, pad) {
// the third argument to fill in the tail chunk when n is
// not sufficient to build chunks of the same size.
chunkContrib: function(array, n, pad) {
var args = arguments;
var p = function(array) {

@@ -68,4 +49,8 @@ if (array == null) return [];

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

@@ -77,7 +62,7 @@ };

// Takes an array and parititions it some number of times into
// Takes an array and chunks it some number of times into
// sub-arrays of size n. If the array given cannot fill the size
// needs of the final partition then a smaller partition is used
// needs of the final chunk then a smaller chunk is used
// for the last.
partitionAll: function(array, n, step) {
chunkAll: function(array, n, step) {
step = (step != null) ? step : n;

@@ -118,3 +103,3 @@

return _.filter(_.flatten(_.zip.apply(null, arguments), true), function(elem) {
return _.filter(_.flatten(_.zip.apply(null, arguments), false), function(elem) {
return elem != null;

@@ -127,3 +112,3 @@ });

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

@@ -207,22 +192,39 @@ },

return slice.call(obj).reverse();
}
});
},
})(this);
// lodash-contrib (lodash.array.selectors.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
// Returns copy or array sorted according to arbitrary ordering
// order must be an array of values; defines the custom sort
// key must be one of: missing/null, a string, or a function;
collate: function(array, order, key) {
if (!_.isArray(array)) throw new TypeError("expected an array as the first argument");
if (!_.isArray(order)) throw new TypeError("expected an array as the second argument");
(function(root) {
return sort.call(array, function (a, b) {
if(_.isFunction(key)) {
valA = key.call(a);
valB = key.call(b);
} else if(existy(key)) {
valA = a[key];
valB = b[key];
} else {
valA = a;
valB = b;
}
// Baseline setup
// --------------
var rankA = _.indexOf(order, valA);
var rankB = _.indexOf(order, valB);
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
if(rankA === -1) return 1;
if(rankB === -1) return -1;
// Helpers
// -------
return rankA - rankB;
});
}
});
};
},{}],2:[function(require,module,exports){
module.exports = function(_) {
// Create quick reference variables for speed access to core prototypes.

@@ -236,2 +238,11 @@ var slice = Array.prototype.slice,

function nths(array, indices) {
if (array == null) return void 0;
if (isSeq(indices))
return _(indices).map(function(i){return array[i];}).valueOf();
else
return nths(array, slice.call(arguments, 1));
}
// Mixing in the array selectors

@@ -262,31 +273,18 @@ // ----------------------------

// Takes all items in an array while a given predicate returns truthy.
takeWhile: function(array, pred) {
if (!isSeq(array)) throw new TypeError;
// A function to get values via indices into an array
nths: nths,
valuesAt: nths,
var sz = _.size(array);
// A function to get at "truthily" indexed values
// bin refers to "binary" nature of true/false values in binIndices
// but can also be thought of as putting array values into either "take" or "don't" bins
binPick: function binPick(array, binIndices) {
if (array == null) return void 0;
for (var index = 0; index < sz; index++) {
if(!truthy(pred(array[index]))) {
break;
}
}
return _.take(array, index);
if (isSeq(binIndices))
return _.nths(array, _.range(binIndices.length).filter(function(i){return binIndices[i];}));
else
return binPick(array, slice.call(arguments, 1));
},
// 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

@@ -331,16 +329,6 @@ // taking an original array and spliting it at the index

})(this);
};
// lodash-contrib (lodash.collections.walk.js 0.0.1)
// (c) 2013 Patrick Dubroy
// lodash-contrib may be freely distributed under the MIT license.
(function(root) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
},{}],3:[function(require,module,exports){
module.exports = function (_) {
// Helpers

@@ -515,3 +503,3 @@ // -------

// objects, and for DOM nodes it returns the node's DOM children.
_.walk = function(traversalStrategy) {
function walk(traversalStrategy) {
var walker = _.clone(exports);

@@ -525,26 +513,19 @@

return walker;
};
}
// Use `_.walk` as a namespace to hold versions of the walk functions which
// use the default traversal strategy.
_.extend(_.walk, _.walk());
})(this);
_.extend(walk, walk());
// lodash-contrib (lodash.function.arity.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
_.mixin({walk: walk});
};
(function(root) {
},{}],4:[function(require,module,exports){
module.exports = function (_) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers
// -------
function enforcesUnary (fn) {
return function mustBeUnary () {
function enforcesUnary(fn) {
return function mustBeUnary() {
if (arguments.length === 1) {

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

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

@@ -588,3 +570,3 @@ return enforcesUnary(function () {

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

@@ -608,2 +590,26 @@ throw new Error('Argument 1 must be a function.');

// Right curry variants
// ---------------------
var curryRight = function (func) {
return curry.call(this, func, true);
};
var curryRight2 = function (fun) {
return enforcesUnary(function (last) {
return enforcesUnary(function (first) {
return fun.call(this, first, last);
});
});
};
var curryRight3 = function (fun) {
return enforcesUnary(function (last) {
return enforcesUnary(function (second) {
return enforcesUnary(function (first) {
return fun.call(this, first, second, last);
});
});
});
};
// Mixing in the arity functions

@@ -617,11 +623,11 @@ // -----------------------------

// the presence of values and the `_` placeholder.
fix: function(fun) {
var fixArgs = _.rest(arguments);
fix: function (fun) {
var fixArgs = _.tail(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++];

@@ -640,3 +646,3 @@ }

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

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

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

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

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

@@ -661,3 +667,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);

@@ -667,15 +673,6 @@ };

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

@@ -697,60 +694,41 @@ return fun.call(this, first, last);

// reverse currying for functions taking two arguments.
rcurry2: function (fun) {
return enforcesUnary(function (last) {
return enforcesUnary(function (first) {
return fun.call(this, first, last);
});
});
},
// reverse currying for functions taking two arguments.
curryRight2: curryRight2,
rcurry2: curryRight2, // alias for backwards compatibility
rcurry3: function (fun) {
return enforcesUnary(function (last) {
return enforcesUnary(function (second) {
return enforcesUnary(function (first) {
return fun.call(this, first, second, last);
});
});
});
},
curryRight3: curryRight3,
rcurry3: curryRight3, // alias for backwards compatibility
// 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);
};
})()
});
})(this);
// lodash-contrib (lodash.function.combinators.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
};
(function(root) {
},{}],5:[function(require,module,exports){
module.exports = function (_) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers

@@ -789,7 +767,4 @@ // -------

_.mixin({
// Takes a value and returns a function that always returns
// said value.
always: function(value) {
return function() { return value; };
},
// Provide "always" alias for backwards compatibility
always: _.constant,

@@ -808,2 +783,3 @@ // Takes some number of functions, either as an array or variadically

},
composeRight: _.pipeline,

@@ -855,3 +831,3 @@ // Composes a bunch of predicates into a single predicate that

return function() {
return !pred.apply(null, arguments);
return !pred.apply(this, arguments);
};

@@ -866,3 +842,3 @@ },

return function(array) {
return fun.apply(null, array);
return fun.apply(this, array);
};

@@ -933,4 +909,4 @@ },

return _.map(funs, function(f) {
return f.apply(null, args);
});
return f.apply(this, args);
}, this);
};

@@ -955,3 +931,3 @@ },

return fun.apply(null, args);
return fun.apply(this, args);
};

@@ -967,3 +943,3 @@ },

return fun.apply(null, flipped);
return fun.apply(this, flipped);
};

@@ -977,3 +953,3 @@ },

return fun.apply(null, reversed);
return fun.apply(this, reversed);
};

@@ -1020,53 +996,10 @@ },

})(this);
};
// lodash-contrib (lodash.function.dispatch.js 0.0.1)
// (c) 2013 Justin Ridgewell
// lodash-contrib may be freely distributed under the MIT license.
},{}],6:[function(require,module,exports){
module.exports = function (_) {
(function(root) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers
// -------
// 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;
}
});
})(this);
// lodash-contrib (lodash.function.iterators.js 0.0.1)
// (c) 2013 Michael Fogus and DocumentCloud Inc.
// lodash-contrib may be freely distributed under the MIT license.
(function(root, undefined) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers
// -------
var HASNTBEENRUN = {};

@@ -1390,20 +1323,7 @@

})(this, void 0);
};
// lodash-contrib (lodash.function.predicates.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
},{}],7:[function(require,module,exports){
module.exports = function (_) {
(function(root) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers
// -------
// Mixing in the predicate functions

@@ -1430,5 +1350,2 @@ // ---------------------------------

// Check if an object is an object literal, since _.isObject(function() {}) === _.isObject([]) === true
isPlainObject: function(x) { return _.isObject(x) && x.constructor === root.Object; },
// These do what you think that they do

@@ -1505,16 +1422,7 @@ isZero: function(x) { return 0 === x; },

})(this);
};
// lodash-contrib (lodash.object.builders.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
},{}],8:[function(require,module,exports){
module.exports = function (_) {
(function(root) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers

@@ -1542,15 +1450,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

@@ -1628,16 +1523,7 @@ // object describes the key renaming to occur in the first object.

})(this);
};
// lodash-contrib (lodash.object.selectors.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
},{}],9:[function(require,module,exports){
module.exports = function (_) {
(function(root) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers

@@ -1715,2 +1601,4 @@ // -------

if (_.contains(['boolean', 'string', 'number'], typeof obj)) return false;
if (!(ks[0] in obj)) return false;

@@ -1739,20 +1627,7 @@

})(this);
};
// lodash-contrib (lodash.util.existential.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
},{}],10:[function(require,module,exports){
module.exports = function(_) {
(function(root) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Helpers
// -------
// Mixing in the truthiness

@@ -1766,5 +1641,9 @@ // ------------------------

not: function(b) { return !b; },
existsAll: function() { return _.every(arguments, _.exists); },
truthyAll: function() { return _.every(arguments, _.truthy); },
falseyAll: function() { return _.every(arguments, _.falsey); },
firstExisting: function() {
for (var i = 0; i < arguments.length; i++) {
if (arguments[i] != null) return arguments[i];
if (_.exists(arguments[i])) return arguments[i];
}

@@ -1774,16 +1653,8 @@ }

})(this);
};
// lodash-contrib (lodash.function.arity.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
(function(root) {
},{}],11:[function(require,module,exports){
module.exports = function (_) {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
// Setup for variadic operators

@@ -1915,3 +1786,3 @@ // ----------------------------

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

@@ -1924,3 +1795,3 @@ mul: variadicMath(mul),

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

@@ -1930,6 +1801,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),

@@ -1943,18 +1814,44 @@ bitwiseOr: variadicMath(bitwiseOr),

});
})(this);
};
// lodash-contrib (lodash.util.strings.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
},{}],12:[function(require,module,exports){
module.exports = function (_) {
(function(root) {
// Helpers
// -------
// Baseline setup
// --------------
// No reason to create regex more than once
var REGEX = {
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
};
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
var urlDecode = function (s) {
return decodeURIComponent(s.replace(REGEX.plus, '%20'));
};
// Helpers
// -------
var buildParams = function (prefix, val, top) {
if (_.isUndefined(top)) top = true;
if (_.isArray(val)) {
return _.map(val, function (value, key) {
return buildParams(top ? key : prefix + '[]', value, false);
}).join('&');
} else if (_.isObject(val)) {
return _.map(val, function (value, key) {
return buildParams(top ? key : prefix + '[' + key + ']', value, false);
}).join('&');
} else {
return encodeURIComponent(prefix) + '=' + encodeURIComponent(val);
}
};

@@ -1966,44 +1863,114 @@ // Mixing in the string utils

// Explodes a string into an array of chars
explode: function(s) {
explode: function (s) {
return s.split('');
},
// Parses a query string into a hash
fromQuery: function (str) {
var parameters = str.split('&'),
obj = {},
parameter,
key,
match,
lastKey,
subKey,
depth;
// Iterate over key/value pairs
_.each(parameters, function (parameter) {
parameter = parameter.split('=');
key = urlDecode(parameter[0]);
lastKey = key;
depth = obj;
// Reset so we don't have issues when matching the same string
REGEX.bracket.lastIndex = 0;
// Attempt to extract nested values
while ((match = REGEX.bracket.exec(key)) !== null) {
if (!_.isUndefined(match[1])) {
// If we're at the top nested level, no new object needed
subKey = match[1];
} else {
// If we're at a lower nested level, we need to step down, and make
// sure that there is an object to place the value into
subKey = match[2];
depth[lastKey] = depth[lastKey] || (subKey ? {} : []);
depth = depth[lastKey];
}
// Save the correct key as a hash or an array
lastKey = subKey || _.size(depth);
}
// Assign value to nested object
depth[lastKey] = urlDecode(parameter[1]);
});
return obj;
},
// Implodes and array of chars into a string
implode: function(a) {
implode: function (a) {
return a.join('');
},
// Converts a string to camel case
camelCase : function( string ){
return string.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
},
// Converts camel case to dashed (opposite of _.camelCase)
toDash : function( string ){
string = string.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();});
toDash: function (string) {
string = string.replace(REGEX.capitalLetters, function ($1) {return "-" + $1.toLowerCase();});
// remove first dash
return ( string.charAt( 0 ) == '-' ) ? string.substr(1) : string;
return ( string.charAt(0) == '-' ) ? string.substr(1) : string;
},
// Creates a query string from a hash
toQuery: function (obj) {
return buildParams('', obj);
},
// Reports whether a string contains a search string.
strContains: function(str, search) {
if (typeof str != 'string') throw new TypeError;
strContains: function (str, search) {
if (typeof str != 'string') throw new TypeError( 'First argument to strContains must be a string' );
return (str.indexOf(search) != -1);
}
},
});
})(this);
// Upper case first letter in every word.
titleCase: function capitalize(string) {
return string.replace(REGEX.boundary, function ($1) {return $1.toUpperCase();});
},
// lodash-contrib (lodash.util.trampolines.js 0.0.1)
// (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// lodash-contrib may be freely distributed under the MIT license.
// Slugify a string. Makes lowercase, and converts dots and spaces to dashes.
slugify: function (urlString) {
return urlString.replace(REGEX.lowerThenUpper, '$1-$2')
.replace(REGEX.space, '-')
.replace(REGEX.dot, '-')
.toLowerCase();
},
(function(root) {
// Humanize a slug by adding spaces in place of underscores and between words
humanize: function (slugish) {
return _.capitalize(slugish
// Replace _ with a space
.replace(REGEX.underscore, ' ')
// insert a space between lower & upper
.replace(REGEX.lowerThenUpper, '$1 $2')
// space before last upper in a sequence followed by lower
.replace(REGEX.upperThenLower, '$1 $2$3')
);
},
// Baseline setup
// --------------
// Strip HTML-ish tags from string
stripTags: function (suspectString) {
var str = suspectString.replace(REGEX.htmlTags, '');
return str;
}
// Establish the root object, `window` in the browser, or `global` on the server.
var _ = root._ || require('lodash');
});
};
},{}],13:[function(require,module,exports){
module.exports = function (_) {
// Helpers

@@ -2035,2 +2002,19 @@ // -------

})(this);
};
},{}],14:[function(require,module,exports){
require("../common-js/_.array.builders.js")(_);
require("../common-js/_.array.selectors.js")(_);
require("../common-js/_.collections.walk.js")(_);
require("../common-js/_.function.arity.js")(_);
require("../common-js/_.function.combinators.js")(_);
require("../common-js/_.function.iterators.js")(_);
require("../common-js/_.function.predicates.js")(_);
require("../common-js/_.object.builders.js")(_);
require("../common-js/_.object.selectors.js")(_);
require("../common-js/_.util.existential.js")(_);
require("../common-js/_.util.operators.js")(_);
require("../common-js/_.util.strings.js")(_);
require("../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]);

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

// lodash-contrib v2.4.1
// =========================
// > https://github.com/Empeeric/lodash-contrib
// > (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors
// > (c) 2013 Refael Ackermann, & Empeeric
// > lodash-contrib may be freely distributed under the MIT license.
(function(n){var r=n._||require("lodash"),t=Array.prototype.slice,u=Array.prototype.concat,e=function(n){return null!=n};r.mixin({cat:function(){return r.reduce(arguments,function(n,e){return r.isArguments(e)?u.call(n,t.call(e)):u.call(n,e)},[])},cons:function(n,t){return r.cat([n],t)},partition:function(n,t,u){var e=function(n){if(null==n)return[];var i=r.take(n,t);return t===r.size(i)?r.cons(i,e(r.drop(n,t))):u?[r.take(r.cat(i,u),t)]:[]};return e(n)},partitionAll:function(n,t,u){u=null!=u?u:t;var e=function(n,t,u){return r.isEmpty(n)?[]:r.cons(r.take(n,t),e(r.drop(n,u),t,u))};return e(n,t,u)},mapcat:function(n,t){return r.cat.apply(null,r.map(n,t))},interpose:function(n,u){if(!r.isArray(n))throw new TypeError;var e=r.size(n);return 0===e?n:1===e?n:t.call(r.mapcat(n,function(n){return r.cons(n,[u])}),0,-1)},weave:function(){return r.some(arguments)?1==arguments.length?arguments[0]:r.filter(r.flatten(r.zip.apply(null,arguments),!0),function(n){return null!=n}):[]},interleave:r.weave,repeat:function(n,t){return r.times(n,function(){return t})},cycle:function(n,t){return r.flatten(r.times(n,function(){return t}),!0)},splitAt:function(n,t){return[r.take(n,t),r.drop(n,t)]},iterateUntil:function(n,r,t){for(var u=[],e=n(t);r(e);)u.push(e),e=n(e);return u},takeSkipping:function(n,t){var u=[],e=r.size(n);if(0>=t)return[];if(1===t)return n;for(var i=0;e>i;i+=t)u.push(n[i]);return u},reductions:function(n,t,u){var e=[],i=u;return r.each(n,function(r,u){i=t(i,n[u]),e.push(i)}),e},keepIndexed:function(n,t){return r.filter(r.map(r.range(r.size(n)),function(r){return t(r,n[r])}),e)},reverseOrder:function(n){if("string"==typeof n)throw new TypeError("Strings cannot be reversed by _.reverseOrder");return t.call(n).reverse()}})})(this),function(n){var r=n._||require("lodash"),t=Array.prototype.slice,u=Array.prototype.concat,e=function(n){return null!=n},i=function(n){return n!==!1&&e(n)},o=function(n){return r.isArray(n)||r.isArguments(n)};r.mixin({second:function(n,r,u){return null==n?void 0:null==r||u?n[1]:t.call(n,1,r)},third:function(n,r,u){return null==n?void 0:null==r||u?n[2]:t.call(n,2,r)},nth:function(n,r,t){return null==r||t?void 0:n[r]},takeWhile:function(n,t){if(!o(n))throw new TypeError;for(var u=r.size(n),e=0;u>e&&i(t(n[e]));e++);return r.take(n,e)},dropWhile:function(n,t){if(!o(n))throw new TypeError;for(var u=r.size(n),e=0;u>e&&i(t(n[e]));e++);return r.drop(n,e)},splitWith:function(n,t){return[r.takeWhile(n,t),r.dropWhile(n,t)]},partitionBy:function(n,t){if(r.isEmpty(n)||!e(n))return[];var i=r.first(n),o=t(i),c=u.call([i],r.takeWhile(r.rest(n),function(n){return r.isEqual(o,t(n))}));return u.call([c],r.partitionBy(r.drop(n,r.size(c)),t))},best:function(n,t){return r.reduce(n,function(n,r){return t(n,r)?n:r})},keep:function(n,t){if(!o(n))throw new TypeError("expected an array as the first argument");return r.filter(r.map(n,function(n){return t(n)}),e)}})}(this),function(n){function r(n){return e.isElement(n)?n.children:n}function t(n,r,t,u,a,l){var f=[];return function s(n,p,h){if(e.isObject(n)){if(f.indexOf(n)>=0)throw new TypeError(c);f.push(n)}if(t){var v=t.call(a,n,p,h);if(v===o)return o;if(v===i)return}var m,g=r(n);if(e.isObject(g)&&!e.isEmpty(g)){l&&(m=e.isArray(n)?[]:{});var y=e.any(g,function(r,t){var u=s(r,t,n);return u===o?!0:(m&&(m[t]=u),void 0)});if(y)return o}return u?u.call(a,n,p,h,m):void 0}(n)}function u(n,r,t){var u=[];return this.preorder(n,function(n,o){return t||o!=r?(e.has(n,r)&&(u[u.length]=n[r]),void 0):i}),u}var e=n._||require("lodash"),i={},o={},c="Not a tree: same object found in two different branches",a={find:function(n,r,t){var u;return this.preorder(n,function(n,e,i){return r.call(t,n,e,i)?(u=n,o):void 0},t),u},filter:function(n,r,t,u){var e=[];return null==n?e:(r(n,function(n,r,i){t.call(u,n,r,i)&&e.push(n)},null,this._traversalStrategy),e)},reject:function(n,r,t,u){return this.filter(n,r,function(n,r,e){return!t.call(u,n,r,e)})},map:function(n,r,t,u){var e=[];return r(n,function(n,r,i){e[e.length]=t.call(u,n,r,i)},null,this._traversalStrategy),e},pluck:function(n,r){return u.call(this,n,r,!1)},pluckRec:function(n,r){return u.call(this,n,r,!0)},postorder:function(n,r,u,e){e=e||this._traversalStrategy,t(n,e,null,r,u)},preorder:function(n,r,u,e){e=e||this._traversalStrategy,t(n,e,r,null,u)},reduce:function(n,r,u,e){var i=function(n,t,e,i){return r(i||u,n,t,e)};return t(n,this._traversalStrategy,null,i,e,!0)}};a.collect=a.map,a.detect=a.find,a.select=a.filter,e.walk=function(n){var t=e.clone(a);return e.bindAll.apply(null,[t].concat(e.keys(t))),t._traversalStrategy=n||r,t},e.extend(e.walk,e.walk())}(this),function(n){function r(n){return function(){if(1===arguments.length)return n.apply(this,arguments);throw new RangeError("Only a single argument may be accepted.")}}var t=n._||require("lodash"),u=function(){function n(t,u,e,i,o,c){return c===!0?i.unshift(o):i.push(o),i.length==e?t.apply(u,i):r(function(){return n(t,u,e,i.slice(0),arguments[0],c)})}return function(t,u){var e=this;return r(function(){return n(t,e,t.length,[],arguments[0],u)})}}(),e=function(){var n=[];return function(r){if("function"!=typeof r)throw Error("Argument 1 must be a function.");var t=r.length;return void 0===n[t]&&(n[t]=function(n){return function(){if(arguments.length!==t)throw new RangeError(t+" arguments must be applied.");return n.apply(this,arguments)}}),n[t](r)}}();t.mixin({fix:function(n){var r=t.rest(arguments),u=function(){for(var u=r.slice(),e=0,i=0;u.length>i||arguments.length>e;i++)u[i]===t&&(u[i]=arguments[e++]);return n.apply(null,u)};return u._original=n,u},unary:function(n){return function(r){return n.call(this,r)}},binary:function(n){return function(r,t){return n.call(this,r,t)}},ternary:function(n){return function(r,t,u){return n.call(this,r,t,u)}},quaternary:function(n){return function(r,t,u,e){return n.call(this,r,t,u,e)}},curry:u,rCurry:function(n){return u.call(this,n,!0)},curry2:function(n){return r(function(t){return r(function(r){return n.call(this,t,r)})})},curry3:function(n){return r(function(t){return r(function(u){return r(function(r){return n.call(this,t,u,r)})})})},rcurry2:function(n){return r(function(t){return r(function(r){return n.call(this,r,t)})})},rcurry3:function(n){return r(function(t){return r(function(u){return r(function(r){return n.call(this,r,u,t)})})})},enforce:e}),t.arity=function(){var n={};return function r(t,u){if(null==n[t]){for(var e=Array(t),i=0;t>i;++i)e[i]="__"+i;var o=e.join(),c="return function ("+o+") { return fun.apply(this, arguments); };";n[t]=Function(["fun"],c)}return null==u?function(n){return r(t,n)}:n[t](u)}}()}(this),function(n){function r(n,r){return t.arity(n.length,function(){return n.apply(this,c.call(arguments,r))})}var t=n._||require("lodash"),u=function(n){return null!=n},e=function(n){return n!==!1&&u(n)},i=[].reverse,o=[].slice,c=[].map,a=function(n){return function(r,t){return 1===arguments.length?function(t){return n(r,t)}:n(r,t)}};t.mixin({always:function(n){return function(){return n}},pipeline:function(){var n=t.isArray(arguments[0])?arguments[0]:arguments;return function(r){return t.reduce(n,function(n,r){return r(n)},r)}},conjoin:function(){var n=arguments;return function(r){return t.every(r,function(r){return t.every(n,function(n){return n(r)})})}},disjoin:function(){var n=arguments;return function(r){return t.some(r,function(r){return t.some(n,function(n){return n(r)})})}},comparator:function(n){return function(r,t){return e(n(r,t))?-1:e(n(t,r))?1:0}},complement:function(n){return function(){return!n.apply(null,arguments)}},splat:function(n){return function(r){return n.apply(null,r)}},unsplat:function(n){var r=n.length;return 1>r?n:1===r?function(){return n.call(this,o.call(arguments,0))}:function(){var t=arguments.length,u=o.call(arguments,0,r-1),e=Math.max(r-t-1,0),i=Array(e),c=o.call(arguments,n.length-1);return n.apply(this,u.concat(i).concat([c]))}},unsplatl:function(n){var r=n.length;return 1>r?n:1===r?function(){return n.call(this,o.call(arguments,0))}:function(){var t=arguments.length,u=o.call(arguments,Math.max(t-r+1,0)),e=o.call(arguments,0,Math.max(t-r+1,0));return n.apply(this,[e].concat(u))}},mapArgs:a(r),juxt:function(){var n=arguments;return function(){var r=arguments;return t.map(n,function(n){return n.apply(null,r)})}},fnull:function(n){var r=t.rest(arguments);return function(){for(var e=t.toArray(arguments),i=t.size(r),o=0;i>o;o++)u(e[o])||(e[o]=r[o]);return n.apply(null,e)}},flip2:function(n){return function(){var r=o.call(arguments);return r[0]=arguments[1],r[1]=arguments[0],n.apply(null,r)}},flip:function(n){return function(){var r=i.call(arguments);return n.apply(null,r)}},functionalize:function(n){return function(r){return n.apply(r,t.rest(arguments))}},methodize:function(n){return function(){return n.apply(null,t.cons(this,arguments))}},k:t.always,t:t.pipeline}),t.unsplatr=t.unsplat,t.mapArgsWith=a(t.flip(r)),t.bound=function(n,r){var u=n[r];if(!t.isFunction(u))throw new TypeError("Expected property to be a function");return t.bind(u,n)}}(this),function(n){var r=n._||require("lodash"),t=Array.prototype.slice;r.mixin({attempt:function(n,u){if(null==n)return void 0;var e=n[u],i=t.call(arguments,2);return r.isFunction(e)?e.apply(n,i):void 0}})}(this),function(n){function r(n){return function(r){return n.call(this,r)}}function t(n,r,t){var u,e;for(u=t!==void 0?t:n(),e=n();null!=e;)u=r.call(e,u,e),e=n();return u}function u(n,r){var t=x;return function(){return t===x?t=n:null!=t&&(t=r.call(t,t)),t}}function e(n,r){var t,u,e=n;return function(){return null!=e?(t=r.call(e,e),u=t[1],e=null!=u?t[0]:void 0,u):void 0}}function i(n,r,t){var u=t;return function(){var t=n();return null==t?t:u=u===void 0?t:r.call(t,u,t)}}function o(n,r,t){var u,e,i=t;return function(){return e=n(),null==e?e:i===void 0?i=e:(u=r.call(e,i,e),i=u[0],u[1])}}function c(n,r){return function(){var t;return t=n(),null!=t?r.call(t,t):void 0}}function a(n,r){var t=null;return function(){var u,e;if(null==t){if(e=n(),null==e)return t=null,void 0;t=r.call(e,e)}for(;null==u;)if(u=t(),null==u){if(e=n(),null==e)return t=null,void 0;t=r.call(e,e)}return u}}function l(n,r){return function(){var t;for(t=n();null!=t;){if(r.call(t,t))return t;t=n()}return void 0}}function f(n,r){return l(n,function(n){return!r(n)})}function s(n,r){return l(n,r)()}function p(n,r,t){for(var u=0;r-->0;)n();return null!=t?function(){return t>=++u?n():void 0}:n}function h(n,r){return p(n,null==r?1:r)}function v(n,r){return p(n,0,null==r?1:r)}function m(n){var r=0;return function(){return n[r++]}}function g(n){var r,t,u;return r=0,u=[],t=function(){var e,i;return e=n[r++],e instanceof Array?(u.push({array:n,index:r}),n=e,r=0,t()):e===void 0?u.length>0?(i=u.pop(),n=i.array,r=i.index,t()):void 0:e}}function y(n){return function(){return n}}function d(n,r,t){return function(){var u;return n>r?void 0:(u=n,n+=t,u)}}function w(n,r,t){return function(){var u;return r>n?void 0:(u=n,n-=t,u)}}function A(n,r,t){return null==n?d(1,1/0,1):null==r?d(n,1/0,1):null==t?r>=n?d(n,r,1):w(n,r,1):t>0?d(n,r,t):0>t?w(n,r,Math.abs(t)):k(n)}var b=n._||require("lodash"),x={},_=r(A);b.iterators={accumulate:i,accumulateWithReturn:o,foldl:t,reduce:t,unfold:u,unfoldWithReturn:e,map:c,mapcat:a,select:l,reject:f,filter:l,find:s,slice:p,drop:h,take:v,List:m,Tree:g,constant:y,K:y,numbers:_,range:A}}(this,void 0),function(n){var r=n._||require("lodash");r.mixin({isInstanceOf:function(n,r){return n instanceof r},isAssociative:function(n){return r.isArray(n)||r.isObject(n)||r.isArguments(n)},isIndexed:function(n){return r.isArray(n)||r.isString(n)||r.isArguments(n)},isSequential:function(n){return r.isArray(n)||r.isArguments(n)},isPlainObject:function(t){return r.isObject(t)&&t.constructor===n.Object},isZero:function(n){return 0===n},isEven:function(n){return r.isFinite(n)&&0===(1&n)},isOdd:function(n){return r.isFinite(n)&&!r.isEven(n)},isPositive:function(n){return n>0},isNegative:function(n){return 0>n},isValidDate:function(n){return r.isDate(n)&&!r.isNaN(n.getTime())},isNumeric:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},isInteger:function(n){return r.isNumeric(n)&&0===n%1},isFloat:function(n){return r.isNumeric(n)&&!r.isInteger(n)},isJSON:function(n){try{JSON.parse(n)}catch(r){return!1}return!0},isIncreasing:function(){var n=r.size(arguments);if(1===n)return!0;if(2===n)return arguments[0]<arguments[1];for(var t=1;n>t;t++)if(arguments[t-1]>=arguments[t])return!1;return!0},isDecreasing:function(){var n=r.size(arguments);if(1===n)return!0;if(2===n)return arguments[0]>arguments[1];for(var t=1;n>t;t++)if(arguments[t-1]<=arguments[t])return!1;return!0}})}(this),function(n){var r=n._||require("lodash"),t=(Array.prototype.slice,Array.prototype.concat),u=function(n){return null!=n},e=function(n){return n!==!1&&u(n)},i=function(n){return r.isArray(n)||r.isObject(n)},o=function(n){return function(r){return function(t){return n(t,r)}}};r.mixin({merge:function(){var n=r.some(arguments)?{}:null;return e(n)&&r.extend.apply(null,t.call([n],r.toArray(arguments))),n},renameKeys:function(n,e){return r.reduce(e,function(r,t,e){return u(n[e])?(r[t]=n[e],r):r},r.omit.apply(null,t.call([n],r.keys(e))))},snapshot:function(n){if(null==n||"object"!=typeof n)return n;var t=new n.constructor;for(var u in n)n.hasOwnProperty(u)&&(t[u]=r.snapshot(n[u]));return t},updatePath:function(n,t,e,o){if(!i(n))throw new TypeError("Attempted to update a non-associative object.");if(!u(e))return t(n);var c=r.isArray(e),a=c?e:[e],l=c?r.snapshot(n):r.clone(n),f=r.last(a),s=l;return r.each(r.initial(a),function(n){o&&!r.has(s,n)&&(s[n]=r.clone(o)),s=s[n]}),s[f]=t(s[f]),l},setPath:function(n,t,e,i){if(!u(e))throw new TypeError("Attempted to set a property at a null path.");return r.updatePath(n,function(){return t},e,i)},frequencies:o(r.countBy)(r.identity)})}(this),function(n){var r=n._||require("lodash"),t=Array.prototype.concat,u=Array.prototype;u.slice,r.mixin({accessor:function(n){return function(r){return r&&r[n]}},dictionary:function(n){return function(r){return n&&r&&n[r]}},selectKeys:function(n,u){return r.pick.apply(null,t.call([n],u))},kv:function(n,t){return r.has(n,t)?[t,n[t]]:void 0},getPath:function e(n,t){return"string"==typeof t&&(t=t.split(".")),void 0===n?void 0:0===t.length?n:null===n?void 0:e(n[r.first(t)],r.rest(t))},hasPath:function i(n,t){"string"==typeof t&&(t=t.split("."));var u=t.length;return null==n&&u>0?!1:t[0]in n?1===u?!0:i(n[r.first(t)],r.rest(t)):!1},pickWhen:function(n,t){var u={};return r.each(n,function(r,e){t(n[e])&&(u[e]=n[e])}),u},omitWhen:function(n,t){return r.pickWhen(n,function(n){return!t(n)})}})}(this),function(n){var r=n._||require("lodash");r.mixin({exists:function(n){return null!=n},truthy:function(n){return n!==!1&&r.exists(n)},falsey:function(n){return!r.truthy(n)},not:function(n){return!n},firstExisting:function(){for(var n=0;arguments.length>n;n++)if(null!=arguments[n])return arguments[n]}})}(this),function(n){function r(n){return function(){return E.reduce(arguments,n)}}function t(n){return function(){for(var r,t=0;arguments.length-1>t;t++)if(r=n(arguments[t],arguments[t+1]),r===!1)return r;return r}}function u(n){return function(){return!n.apply(this,arguments)}}function e(n,r){return n+r}function i(n,r){return n-r}function o(n,r){return n*r}function c(n,r){return n/r}function a(n,r){return n%r}function l(n){return++n}function f(n){return--n}function s(n){return-n}function p(n,r){return n&r}function h(n,r){return n|r}function v(n,r){return n^r}function m(n,r){return n<<r}function g(n,r){return n>>r}function y(n,r){return n>>>r}function d(n){return~n}function w(n,r){return n==r}function A(n,r){return n===r}function b(n){return!n}function x(n,r){return n>r}function k(n,r){return r>n}function _(n,r){return n>=r}function q(n,r){return r>=n}var E=n._||require("lodash");E.mixin({add:r(e),sub:r(i),mul:r(o),div:r(c),mod:a,inc:l,dec:f,neg:s,eq:t(w),seq:t(A),neq:u(t(w)),sneq:u(t(A)),not:b,gt:t(x),lt:t(k),gte:t(_),lte:t(q),bitwiseAnd:r(p),bitwiseOr:r(h),bitwiseXor:r(v),bitwiseNot:d,bitwiseLeft:r(m),bitwiseRight:r(g),bitwiseZ:r(y)})}(this),function(n){var r=n._||require("lodash");r.mixin({explode:function(n){return n.split("")},implode:function(n){return n.join("")},camelCase:function(n){return n.replace(/-([a-z])/g,function(n){return n[1].toUpperCase()})},toDash:function(n){return n=n.replace(/([A-Z])/g,function(n){return"-"+n.toLowerCase()}),"-"==n.charAt(0)?n.substr(1):n},strContains:function(n,r){if("string"!=typeof n)throw new TypeError;return-1!=n.indexOf(r)}})}(this),function(n){var r=n._||require("lodash");r.mixin({done:function(n){var t=r(n);return t.stopTrampoline=!0,t},trampoline:function(n){for(var t=n.apply(n,r.rest(arguments));r.isFunction(t)&&(t=t(),!(t instanceof r&&t.stopTrampoline)););return t.value()}})}(this);
!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?f(e)?a(e).map(function(a){return d[a]}).valueOf():b(d,c.call(arguments,1)):void 0}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?null==b||d?a[1]:c.call(a,1,b):void 0},third:function(a,b,d){return null!=a?null==b||d?a[2]:c.call(a,2,b):void 0},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?f(d)?a.nths(b,a.range(d.length).filter(function(a){return d[a]})):g(b,c.call(arguments,1)):void 0},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.tail(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()}}}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){if("string"==typeof c&&(c=c.split(".")),void 0!==b){if(0===c.length)return b;if(null!==b)return 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,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({addContrib:b(e),sub:b(f),mul:b(g),div:b(h),mod:i,inc:j,dec:k,neg:l,eqContrib:c(t),seq:c(u),neq:d(c(t)),sneq:d(c(u)),not:v,gtContrib:c(w),ltContrib:c(x),gteContrib:c(y),lteContrib:c(z),bitwiseAnd:b(m),bitwiseOr:b(n),bitwiseXor:b(o),bitwiseNot:s,bitwiseLeft:b(p),bitwiseRight:b(q),bitwiseZ:b(r)})}},{}],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]);
# lodash-contrib
> The brass buckles on lodash's utility belt - a contributors' library for [lodash](http://lodashjs.org/).
> The brass buckles on lodash's utility belt - a contributors' library for [lodash](http://lodash.com/).

@@ -9,6 +9,5 @@ ## Introduction

* [Documentation](http://documentcloud.github.io/lodash-contrib/)
* [Source repository](https://github.com/documentcloud/lodash-contrib)
* [Tickets and bug reports](https://github.com/documentcloud/lodash-contrib/issues?state=open)
* [Maintainer's website](http://www.fogus.me)
* [Documentation](#sub-libraries)
* [Source repository](https://github.com/empeeric/lodash-contrib)
* [Tickets and bug reports](https://github.com/empeeric/lodash-contrib/issues?state=open)

@@ -27,34 +26,39 @@ ### Why lodash-contrib?

#### In the Browser
First, you’ll need lodash. Then you can grab the relevant lodash-contrib libraries and simply add
something
like the following to your pages:
the following to your pages:
```html
<script type="text/javascript" src="lodash.js"></script>
<script type="text/javascript" src="lodash.object.builders.js"></script>
```
At the moment there are no cross-contrib dependencies (i.e. each library can stand by itself), but that may
change in the future.
At the moment there are no cross-contrib dependencies (i.e. each sub-library
can stand by itself), but that may change in the future.
### License
_.contrib is open sourced under the [MIT license](https://github.com/documentcloud/lodash-contrib/blob/master/LICENSE).
lodash-contrib is open sourced under the [MIT license](https://github.com/Empeeric/lodash-contrib/blob/master/LICENSE).
## Sub-libraries
The _.contrib library currently contains a number of related capabilities, aggregated into the following files.
The lodash-contrib library currently contains a number of related capabilities, aggregated into the following files.
- [lodash.array.builders](docs/lodash.array.builders.html) - functions to build arrays
- [lodash.array.selectors](docs/lodash.array.selectors.html) - functions to take things from arrays
- [lodash.collections.walk](docs/lodash.collections.walk.html) - functions to walk and transform nested JavaScript objects
- [lodash.function.arity](docs/lodash.function.arity.html) - functions to manipulate and fix function argument arity
- [lodash.function.combinators](docs/lodash.function.combinators.html) - functions to combine functions to make new functions
- [lodash.function.iterators](docs/lodash.function.iterators.html) - functions to lazily produce, manipulate and consume sequence iterators
- [lodash.function.predicates](docs/lodash.function.predicates.html) - functions that return `true` or `false` based on some criteria
- [lodash.object.builders](docs/lodash.object.builders.html) - functions to build JavaScript objects
- [lodash.object.selectors](docs/lodash.object.selectors.html) - functions to pick things from JavaScript objects
- [lodash.util.existential](docs/lodash.util.existential.html) - functions that check for the existence or truthiness of JavaScript data types
- [lodash.util.operators](docs/lodash.util.operators.html) - functions that wrap common (or missing) JavaScript operators
- [lodash.util.strings](docs/lodash.util.strings.html) - functions to work with strings
- [lodash.util.trampolines](docs/lodash.util.trampolines.html) - functions to facilitate calling functions recursively without blowing the stack
- [_.array.builders](_.array.builders.js.md#arraybuilders) - functions to build arrays
- [_.array.selectors](_.array.selectors.js.md#arrayselectors) - functions to take things from arrays
- [_.collections.walk](_.collections.walk.js.md#collectionswalk) - functions to walk and transform nested JavaScript objects
- [_.function.arity](_.function.arity.js.md#functionarity) - functions to manipulate and fix function argument arity
- [_.function.combinators](_.function.combinators.js.md#functioncombinators) - functions to combine functions to make new functions
- [_.function.iterators](_.function.iterators.js.md#functioniterators) - functions to lazily produce, manipulate and consume sequence iterators
- [_.function.predicates](_.function.predicates.js.md#functionpredicates) - functions that return `true` or `false` based on some criteria
- [_.object.builders](_.object.builders.js.md#objectbuilders) - functions to build JavaScript objects
- [_.object.selectors](_.object.selectors.js.md#objectselectors) - functions to pick things from JavaScript objects
- [_.util.existential](_.util.existential.js.md#utilexistential) - functions that check for the existence or truthiness of JavaScript data types
- [_.util.operators](_.util.operators.js.md#utiloperators) - functions that wrap common (or missing) JavaScript operators
- [_.util.strings](_.util.strings.js.md#utilstrings) - functions to work with strings
- [_.util.trampolines](_.util.trampolines.js.md#utiltrampolines) - functions to facilitate calling functions recursively without blowing the stack
The links above are to the annotated source code. Full-blown _.contrib documentation is in the works. Contributors welcomed.

@@ -1,9 +0,10 @@

module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-contrib-concat");
module.exports = function (grunt) {
var _ = require('lodash');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-docco");
grunt.loadNpmTasks("grunt-tocdoc");
grunt.loadNpmTasks("grunt-mocha-test");

@@ -13,31 +14,44 @@ grunt.initConfig({

contribBanner:
"// <%= pkg.name %> v<%= pkg.version %>\n" +
contribBanner: "// <%= pkg.name %> v<%= pkg.version %>\n" +
"// =========================\n\n" +
"// > <%= pkg.homepage %>\n" +
"// > (c) 2013 Michael Fogus, DocumentCloud and Investigative Reporters & Editors\n" +
"// > (c) 2013 Refael Ackermann, & Empeeric\n" +
"// > (c) 2016 Refael Ackermann & node4good.org\n" +
"// > <%= pkg.name %> may be freely distributed under the <%= pkg.license %> license.\n\n",
concat: {
all: {
src: "_.*.js",
dest: "dist/lodash-contrib.js",
options: { banner: "<%= contribBanner %>" }
copy: {
main: {
expand: true,
flatten: true,
src: 'gen/lodash*.js',
dest: 'dist/'
}
},
uglify: {
all: {
files: { "dist/lodash-contrib.min.js": "dist/lodash-contrib.js" },
options: { banner: "<%= contribBanner %>" }
files: { "gen/lodash-contrib.min.js": "gen/lodash-contrib.js" }
}
},
mochaTest: {
test: {
src: ['test/mocha/*.*'],
options: {
reporter: "spec"
}
}
},
qunit: {
main: ['test/index.html'],
concat: ['test/dist-concat.html'],
min: ['test/dist-min.html']
minified: ['test/dist-min.html'],
browserified: ['test/browserified.html']
},
jshint: {

@@ -51,3 +65,3 @@ all: [

indent: 2, // Indent by 2 spaces
camelcase: true, // All vars must be camelCase or UPPER_WITH_lodashS
camelcase: true, // All vars must be camelCase or UPPER_WITH_UNDERSCORES
eqnull: true, // Allow 'x == null' convention

@@ -60,32 +74,38 @@ forin: true, // Require `for x in y` to filter with `hasOwnProperty`

watch: {
test: {
browserWrap: {
all: {
files: [
"_.*.js",
"test/*.js"
],
tasks: ["test"]
{
src: ['common-js/*.*'],
dst: 'gen/temp-scaffold.js'
}
]
}
},
tocdoc: {
api: {
files: {
'index.html': 'docs/*.md'
}
commonjsWrap: {
all: {
files: [
{
src: ['gen/temp-scaffold.js'],
dst: 'gen/lodash-contrib.commonjs.js'
}
]
}
},
docco: {
docs: {
src: ['docs/*.md'],
options: {
output: 'docs/'
browserify: {
dist: {
files: {
'gen/lodash-contrib.js': 'gen/temp-scaffold.js'
}
},
examples: {
src: ['examples/*.md'],
options: {
output: 'examples/'
}
test: {
files: {
'gen/double.browserified.js': 'gen/lodash-contrib.js'
},
browserifyOptions: { debug: true }
}

@@ -95,6 +115,34 @@ }

grunt.registerTask("test", ["jshint", "qunit:main"]);
grunt.registerTask("dist", ["concat", "uglify"]);
grunt.registerTask('default', ['test']);
grunt.registerTask('dist', ['test', 'concat', 'qunit:concat', 'uglify', 'qunit:min']);
grunt.registerMultiTask('browserWrap', 'index.js scaffolding task.', function () {
grunt.log.writeln('Generating first pass browserWrap.js');
var setup = this.files.pop();
var code = setup.src.reduce(function (seed, val) { return seed + 'require("../' + val + '")(_);\n'; }, '');
grunt.file.write(setup.dst, code);
});
grunt.registerMultiTask('commonjsWrap', 'index.js scaffolding task.', function () {
grunt.log.writeln('Generating first pass commonjsWrap.js');
var code = 'var _ = module.exports = require("lodash").runInContext();\n\n';
var setup = this.files.pop();
code += setup.src.reduce(function (seed, val) { return seed + grunt.file.read(val); }, '');
grunt.file.write(setup.dst, code);
code += '\n //Adding explicit method names for static analysis\n';
var ctrb1 = require('./' + setup.dst);
_(ctrb1).keys().sortBy().forEach(function (name) {
var len = Math.max(20 - name.length, 2);
var arr = new Array(len);
var aligner = arr.join(' ');
code += 'module.exports.' + name + aligner + ' = _.' + name + ';\n';
});
grunt.file.write(setup.dst, code);
});
grunt.registerTask('gen', ['browserWrap', 'commonjsWrap', 'browserify:dist', 'uglify', 'browserify:test', 'copy']);
grunt.registerTask('test', ['jshint', 'mochaTest', 'qunit:main', 'qunit:browserified', 'qunit:minified']);
grunt.registerTask('default', ['gen', 'test']);
};
{
"name": "lodash-contrib",
"version": "2.4.1",
"main": "index.js",
"description": "The brass buckles on lodash's utility belt",
"version": "4.1200.0",
"main": "dist/lodash-contrib.commonjs.js",
"dependencies": {
"lodash": "4.12.x"
},
"devDependencies": {
"lodash": "~2.4.1",
"grunt": "~0.4.1",
"grunt-contrib-concat": "0.3.0",
"grunt-contrib-uglify": "0.2.0",
"grunt-contrib-qunit": "~0.2.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.6.4",
"grunt-docco": "~0.3.0",
"grunt-tocdoc": "~0.1.0"
"chai": "",
"grunt": "",
"grunt-browserify": "",
"grunt-cli": "",
"grunt-contrib-concat": "",
"grunt-contrib-copy": "",
"grunt-contrib-jshint": "",
"grunt-contrib-qunit": "",
"grunt-contrib-uglify": "",
"grunt-mocha-test": "",
"mocha": ""
},
"repository": {
"type": "git",
"url": "https://github.com/Empeeric/lodash-contrib.git"
},
"repository": "node4good/lodash-contrib",
"license": "MIT",
"author": {
"name": "Fogus",
"email": "me@fogus.me",
"url": "http://www.fogus.me"
},
"contributors": [{
"name": "Refael Ackermann",
"email": "refael@empeeric.com",
"url": "http://www.empeeric.com/"
}],
"homepage": "https://github.com/Empeeric/lodash-contrib"
"author": "Refael Ackermann <me@refack.com> (http://refack.com)",
"contributors": [
"Fogus <me@fogus.me> (http://www.fogus.me)",
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)"
],
"scripts": {
"dist": "grunt gen",
"mypublish": "npm run dist && npm version patch && git push --follow-tags",
"test": "grunt default"
}
}

@@ -0,13 +1,15 @@

The brass buckles on lodash's utility belt
Basically a [`lodash`](http://lodash.com/) compatible fork of [`underscore-contrib`](https://github.com/documentcloud/underscore-contrib)
lodash-contrib
==================
==============
[![Build Status](https://travis-ci.org/node4good/lodash-contrib.png?branch=master)](https://travis-ci.org/node4good/lodash-contrib)
The brass buckles on lodash's utility belt -- a contributors' library for [lodash](http://lodashjs.org/).
Links
-----
* [Documentation](http://documentcloud.github.io/lodash-contrib/)
* [Source repository](https://github.com/documentcloud/lodash-contrib)
* [Tickets and bug reports](https://github.com/documentcloud/lodash-contrib/issues?state=open)
* [Maintainer's website](http://www.fogus.me)
* [Documentation](https://github.com/node4good/lodash-contrib/blob/master/docs/index.md)
* [Source repository](https://github.com/Empeeric/lodash-contrib)
* [Tickets and bug reports](https://github.com/Empeeric/lodash-contrib/issues?state=open)

@@ -28,17 +30,33 @@ Why lodash-contrib?

First, you’ll need lodash. Then you can grab the relevant lodash-contrib libraries and simply add
something
like the following to your pages:
####Web
<script type="text/javascript" src="lodash.js"></script>
<script type="text/javascript" src="lodash.object.builders.js"></script>
First, you’ll need lodash. Then you can grab the relevant lodash-contrib libraries and simply add something like the following to your pages:
```html
<script src="lodash.js"></script>
<script src="lodash.object.builders.js"></script>
```
At the moment there are no cross-contrib dependencies (i.e. each library can stand by itself), but that may
change in the future.
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:
```javascript
var _ = require('lodash-contrib');
// YOUR CODE COMES HERE
console.log(_.truthyAll(0, 1, 2, 'lodash-contrib!'));
```
then you could run `browserify test.js -o browserified.js` to get `lodash`, `lodash-contrib` and your code into `browserified.js`.
####Node
Just run `npm install lodash-contrib`, you don't need to have lodash as it will be grabbed as a dependency.
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
in those areas is welcomed. Pull requests are accepted, but please search the [issues](https://github.com/documentcloud/lodash-contrib/issues)
in those areas is welcomed. Pull requests are accepted, but please search the [issues](https://github.com/empeeric/lodash-contrib/issues)
before proposing a new sub-contrib or addition. Additionally, all patches and proposals should have strong

@@ -45,0 +63,0 @@ documentation, motivating cases and tests. It would be nice if we could not only provide useful tools built on

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

deepEqual(_.keep(a, eveny), [0,2,4,6,8], 'should keep only even numbers in a range tagged with null fails');
deepEqual(_.keep(a, _.isEven), [true, false, true, false, true, false, true, false, true, false], 'should keep all truthy values cooresponding to a predicate over a range');
deepEqual(_.keep(a, _.isEven), [true, false, true, false, true, false, true, false, true, false], 'should keep all existy values corresponding to a predicate over a range');
});

@@ -77,3 +77,31 @@

});
test("nths", function() {
var a = ['a','b','c', 'd'];
deepEqual(_.nths(a,1), ['b'], 'should return the element at a given index into an array');
deepEqual(_.nths(a,1,3), ['b', 'd'], 'should return the elements at given indices into an array');
deepEqual(_.nths(a,1,5,3), ['b', undefined, 'd'], 'should return undefined if out of bounds');
deepEqual(_.nths(a,[1]), ['b'], 'should return the element at a given index into an array');
deepEqual(_.nths(a,[1,3]), ['b', 'd'], 'should return the elements at given indices into an array');
deepEqual(_.nths(a,[1,5,3]), ['b', undefined, 'd'], 'should return undefined if out of bounds');
});
test("valuesAt", function() {
equal(_.valuesAt, _.nths, 'valuesAt should be alias for nths');
});
test("binPick", function() {
var a = ['a','b','c', 'd'];
deepEqual(_.binPick(a, false, true), ['b'], 'should return the element at a given index into an array');
deepEqual(_.binPick(a, false, true, false, true), ['b', 'd'], 'should return the elements at given indices into an array');
deepEqual(_.binPick(a, false, true, false, true, true), ['b', 'd', undefined], 'should return undefined if out of bounds');
deepEqual(_.binPick(a, [false, true]), ['b'], 'should return the element at a given index into an array');
deepEqual(_.binPick(a, [false, true, false, true]), ['b', 'd'], 'should return the elements at given indices into an array');
deepEqual(_.binPick(a, [false, true, false, true, true]), ['b', 'd', undefined], 'should return undefined if out of bounds');
});
});

@@ -46,4 +46,37 @@ $(document).ready(function() {

equal(notOdd(3), false, 'should return a function that is the opposite of the function given');
var obj = {
num: 1,
numIsPositive: function () { return this.num > 0; }
};
obj.numIsNotPositive = _.complement(obj.numIsPositive);
equal(obj.numIsNotPositive(), false, 'should function as a method combinator');
});
test('splat', function() {
var sumArgs = function () {
return _.reduce(arguments, function (a, b) { return a + b; }, 0);
};
var sumArray = _.splat(sumArgs);
equal(sumArray([1, 2, 3]), 6, 'should return a function that takes array elements as the arguments for the original function');
var obj = {
a: 1,
b: 2,
getPropsByName: function () {
var props = [];
for (var i = 0; i < arguments.length; i++) {
props.push(this[arguments[i]]);
}
return props;
}
};
obj.getPropsByNameArray = _.splat(obj.getPropsByName);
deepEqual(obj.getPropsByNameArray(['a', 'b']), [1, 2], 'should function as a method combinator');
});
test("unsplat", function() {

@@ -113,2 +146,11 @@ var echo = _.unsplat(function (args) { return args; }),

equal(_.flip2(div)(10,2), 0.2, 'should return a function that flips the first two args to a function');
var obj = {
num: 5,
addToNum: function (a, b) { return [a + this.num, b + this.num]; }
};
obj.reversedAddToNum = _.flip2(obj.addToNum);
deepEqual(obj.reversedAddToNum(1, 2), [7, 6], 'should function as a method combinator.');
});

@@ -120,2 +162,11 @@

deepEqual(_.flip(echo)(1, 2, 3, 4), [4, 3, 2, 1], 'should return a function that flips the first three or more args to a function');
var obj = {
num: 5,
addToNum: function (a, b) { return [a + this.num, b + this.num]; }
};
obj.reversedAddToNum = _.flip(obj.addToNum);
deepEqual(obj.reversedAddToNum(1, 2), [7, 6], 'should function as a method combinator.');
});

@@ -131,2 +182,12 @@

equal(_.reduce(b, safeMult), 30, 'should fill in defaults for undefined');
var obj = {
a: 1,
fallback: "fallback value",
getPropByName: function (name) { return this[name]; }
};
obj.getPropByNameOrDefault = _.fnull(obj.getPropByName, "fallback");
equal(obj.getPropByNameOrDefault(), "fallback value", 'should function as a method combinator.');
});

@@ -138,2 +199,12 @@

deepEqual(run('42', 10), [12, 42, 108], 'should return a function that returns an array of the originally supplied functions called');
var obj = {
name: "Elizabeth 1",
firstChar: function () { return this.name[0]; },
lastChar: function () { return this.name[this.name.length - 1]; }
};
obj.firstAndLastChars = _.juxt(obj.firstChar, obj.lastChar);
deepEqual(obj.firstAndLastChars(), ['E', '1'], 'should function as a method combinator.');
});

@@ -140,0 +211,0 @@

@@ -64,24 +64,2 @@ $(document).ready(function() {

test("isPlainObject", function() {
function SomeConstructor() {}
equal(_.isPlainObject({}), true, 'should identify empty objects');
equal(_.isPlainObject({a: 1, b: 2}), true, 'should identify objects');
equal(_.isPlainObject(Object.create(null)), false, 'should reject objects with no prototype');
equal(_.isPlainObject(new SomeConstructor), false, 'should reject instances constructed by something other than Object');
equal(_.isPlainObject([]), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(function(){}), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(null), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(1), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(0), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(-1), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(3.14), false, 'should identify when something is not a plain object');
equal(_.isPlainObject('undefined'), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(''), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(NaN), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(Infinity), false, 'should identify when something is not a plain object');
equal(_.isPlainObject(true), false, 'should identify when something is not a plain object');
});
test("isEven", function() {

@@ -88,0 +66,0 @@ equal(_.isEven(0), true, 'should identify even numbers');

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

var _ = require('lodash');
require('../../_.array.builders');
var _ = require('../..');
var assert = require('assert');

@@ -7,7 +6,261 @@

describe("weave", function () {
var a = [1, 2, 3];
var b = [1, 2];
var c = ['a', 'b', 'c'];
var d = [1, [2]];
it('should weave zero arrays', function (done) {
assert.deepEqual(_.weave(), []);
done();
});
it("should weave one array", function (done) {
assert.deepEqual(_.weave([1,[2]]), [1,[2]], 'should weave one array');
assert.deepEqual(_.weave([]), []);
assert.deepEqual(_.weave([1,[2]]), [1,[2]]);
done();
});
it("should weave two arrays", function (done) {
assert.deepEqual(_.weave(a, b), [1, 1, 2, 2, 3]);
assert.deepEqual(_.weave(a, b), [1, 1, 2, 2, 3]);
assert.deepEqual(_.weave(a, a), [1, 1, 2, 2, 3, 3]);
assert.deepEqual(_.weave(c, a), ['a', 1, 'b', 2, 'c', 3]);
assert.deepEqual(_.weave(a, d), [1, 1, 2, [2], 3]);
done();
});
it("should weave more than two arrays", function (done) {
assert.deepEqual(_.weave(a, b, c), [1, 1, 'a', 2, 2, 'b', 3, 'c']);
assert.deepEqual(_.weave(a, b, c, d), [1, 1, 'a', 1, 2, 2, 'b', [2], 3, 'c']);
done();
});
});
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');
});
});

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

test("hasPath", function() {
var deepObject = { a: { b: { c: "c" } }, falseVal: false, nullVal: null, undefinedVal: undefined, arrayVal: ["arr"] };
var deepObject = { a: { b: { c: "c" } }, falseVal: false, numberVal: 123, stringVal: 'str', nullVal: null, undefinedVal: undefined, arrayVal: ["arr"] };
var ks = ["a", "b", "c"];

@@ -65,2 +65,5 @@

strictEqual(_.hasPath(deepObject, ["undefinedVal", "notHere"]), false, "should return false for descendants of undefined properties");
strictEqual(_.hasPath(deepObject, ["falseVal", "notHere"]), false, "should return false for descendants of a boolean literal");
strictEqual(_.hasPath(deepObject, ["stringVal", "notHere"]), false, "should return false for descendants of a string literal");
strictEqual(_.hasPath(deepObject, ["numberVal", "notHere"]), false, "should return false for descendants of a number literal");

@@ -67,0 +70,0 @@ strictEqual(_.hasPath(deepObject, "a.b.c"), true, "should work with keys written in dot notation.");

@@ -20,2 +20,6 @@ $(document).ready(function() {

equal(_.exists(function(){}), true, 'should know that all but null and undefined are existy');
equal(_.existsAll(0, null, '2'), false, 'should know that null is not existy');
equal(_.existsAll(0, undefined, '2'), false, 'should know that undefined is not existy');
equal(_.existsAll(0, 'undefined', NaN, Infinity, true, false, function(){}), true, 'should know that all but null and undefined are existy');
});

@@ -27,3 +31,2 @@

equal(_.truthy(false), false, 'should know that null, undefined and false are not truthy');
equal(_.truthy(1), true, 'should know that everything else is truthy');

@@ -39,19 +42,34 @@ equal(_.truthy(0), true, 'should know that everything else is truthy');

equal(_.truthy(function(){}), true, 'should know that everything else is truthy');
equal(_.truthyAll(0, null, '2'), false, 'should know that null is not truthy');
equal(_.truthyAll(0, undefined, '2'), false, 'should know that undefined is not truthy');
equal(_.truthyAll(0, undefined, '2'), false, 'should know that false is not truthy');
equal(_.truthyAll(0, 'undefined', NaN, Infinity, true, function(){}), true, 'should know that all but null and undefined are truthy');
});
test("falsey", function() {
equal(_.falsey(null), true, 'should know that null, undefined and false are not falsey');
equal(_.falsey(undefined), true, 'should know that null, undefined and false are not falsey');
equal(_.falsey(false), true, 'should know that null, undefined and false are not falsey');
equal(_.falsey(null), true, 'should know that null, undefined and false are falsey');
equal(_.falsey(undefined), true, 'should know that null, undefined and false are falsey');
equal(_.falsey(false), true, 'should know that null, undefined and false are falsey');
equal(_.falsey(1), false, 'should know that everything else is falsey');
equal(_.falsey(0), false, 'should know that everything else is falsey');
equal(_.falsey(-1), false, 'should know that everything else is falsey');
equal(_.falsey(3.14), false, 'should know that everything else is falsey');
equal(_.falsey('undefined'), false, 'should know that everything else is falsey');
equal(_.falsey(''), false, 'should know that everything else is falsey');
equal(_.falsey(NaN), false, 'should know that everything else is falsey');
equal(_.falsey(Infinity), false, 'should know that everything else is falsey');
equal(_.falsey(true), false, 'should know that everything else is falsey');
equal(_.falsey(function(){}), false, 'should know that everything else is falsey');
equal(_.falsey(1), false, 'should know that everything else is not falsey');
equal(_.falsey(0), false, 'should know that everything else is not falsey');
equal(_.falsey(-1), false, 'should know that everything else is not falsey');
equal(_.falsey(3.14), false, 'should know that everything else is not falsey');
equal(_.falsey('undefined'), false, 'should know that everything else is not falsey');
equal(_.falsey(''), false, 'should know that everything else is not falsey');
equal(_.falsey(NaN), false, 'should know that everything else is not falsey');
equal(_.falsey(Infinity), false, 'should know that everything else is not falsey');
equal(_.falsey(true), false, 'should know that everything else is not falsey');
equal(_.falsey(function(){}), false, 'should know that everything else is not falsey');
equal(!_.truthyAll(1, null, '2'), true, '!_.truthyAll should know that null is falsey even when veriadic');
equal(!_.truthyAll(1, undefined, '2'), true, '!_.truthyAll should know that undefined is falsey even when veriadic');
equal(!_.truthyAll(1, false, '2'), true, '!_.truthyAll should know that false is falsey even when veriadic');
equal(!_.truthyAll(1, 'undefined', NaN, Infinity, true, function(){}), false, '!_.truthyAll should know that only null undefined and false are falsey even when veriadic');
equal(_.falseyAll(false, null), true, '_.falseyAll should know that null is falsey even when veriadic');
equal(_.falseyAll(false, undefined), true, '_.falseyAll should know that undefined is falsey even when veriadic');
equal(_.falseyAll(false, false), true, '_.falseyAll should know that false is falsey even when veriadic');
equal(_.falseyAll(false, null, undefined), true, '_.falseyAll should know that only null undefined and false are falsey even when veriadic');
});

@@ -58,0 +76,0 @@

@@ -10,2 +10,21 @@

test('fromQuery', function() {
var query = 'foo%5Bbar%5D%5Bbaz%5D%5Bblargl%5D=blah&foo%5Bbar%5D%5Bbaz%5D%5Bblargr%5D=woop&blar=bluh&abc[]=123&abc[]=234';
ok(_.isEqual(_.fromQuery(query), {
'foo': {
'bar': {
'baz': {
'blargl': 'blah',
'blargr': 'woop'
}
}
},
'blar': 'bluh',
'abc': [
'123',
'234'
]
}), 'can convert a query string to a hash');
});
test('implode', function() {

@@ -15,6 +34,2 @@ equal(_.implode(['H','o','m','e','r']), 'Homer', 'Should implode an array of characters into a single string.');

test('camelCase', function() {
equal(_.camelCase('punic-wars'), 'punicWars', 'Should convert a dashed-format string to camelCase.');
});
test('toDash', function() {

@@ -25,2 +40,7 @@ equal(_.toDash('trojanWar'), 'trojan-war', 'Should convert a camelCase string to dashed-format.');

test('toQuery', function() {
var obj = {'foo&bar': 'baz', 'test': 'total success', 'nested': {'works': 'too'}, 'isn\'t': ['that', 'cool?']};
equal(_.toQuery(obj), 'foo%26bar=baz&test=total%20success&nested%5Bworks%5D=too&isn\'t%5B%5D=that&isn\'t%5B%5D=cool%3F', 'can convert a hash to a query string');
});
test('strContains', function() {

@@ -33,2 +53,22 @@ equal(_.strContains('Metaphysics', 'physics'), true, 'Should return true if string contains search string.');

});
test('humanize', function() {
equal(_.humanize("lowercase"), "Lowercase");
equal(_.humanize("Class"), "Class");
equal(_.humanize("MyClass"), "My Class");
equal(_.humanize("HTML"), "HTML");
equal(_.humanize("PDFLoader"), "PDF Loader");
equal(_.humanize("AString"), "A String");
equal(_.humanize("SimpleXMLParser"), "Simple XML Parser");
equal(_.humanize("LastUpdateDateInt"), "Last Update Date Int");
equal(_.humanize("LastUpdate_date_IntHTML"), "Last Update date Int HTML");
});
test( 'slugify', function() {
equal(_.slugify('String'), 'string', 'lower-cases strings for slugs');
equal(_.slugify('string with spaces'), 'string-with-spaces', 'converts a string with spaces into a slug');
equal(_.slugify('string.with.dots'), 'string-with-dots', 'converts a string with dots into a slug');
equal(_.slugify('TitleCase'), 'title-case', 'converts TitleCase strings into slugs');
equal(_.slugify('i-am-a-slug'), 'i-am-a-slug', 'leaves strings that are already slugs alone');
});
});
// JSLitmus.js
//
// History:
// 2008-10-27: Initial release
// 2008-11-09: Account for iteration loop overhead
// 2008-11-13: Added OS detection
// 2009-02-25: Create tinyURL automatically, shift-click runs tests in reverse
//
// Copyright (c) 2008-2009, Robert Kieffer
// All Rights Reserved
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the
// Software), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// Copyright (c) 2010, Robert Kieffer, http://broofa.com
// Available under MIT license (http://en.wikipedia.org/wiki/MIT_License)

@@ -132,3 +110,3 @@ (function() {

* JSLitmus.test())
*
*
* @private

@@ -138,3 +116,3 @@ */

if (!f) throw new Error('Undefined test function');
if (!(/function[^\(]*\(([^,\)]*)/).test(f.toString())) {
if (!/function[^\(]*\(([^,\)]*)/.test(f.toString())) {
throw new Error('"' + name + '" test: Test is not a valid Function object');

@@ -146,3 +124,3 @@ }

};
jsl.extend(Test, /** @lends Test */ {

@@ -161,3 +139,3 @@ /** Calibration tests for establishing iteration loop overhead */

calibrate: function(onCalibrated) {
for (var i = 0; i < Test.CALIBRATIONS.length; i++) {
for (var i = 0; i < Test.CALIBRATIONS.length; i++) {
var cal = Test.CALIBRATIONS[i];

@@ -279,3 +257,3 @@ if (cal.running) return true;

* Get the number of operations per second for this test.
*
*
* @param normalize if true, iteration loop overhead taken into account

@@ -524,3 +502,3 @@ */

cns.push('test_error');
cell.innerHTML =
cell.innerHTML =
'<div class="error_head">' + test.error + '</div>' +

@@ -541,2 +519,3 @@ '<ul class="error_body"><li>' +

cell.innerHTML = hz != Infinity ? hz : '&infin;';
cell.title = 'Looped ' + test.count + ' times in ' + test.time + ' seconds';
} else {

@@ -673,6 +652,6 @@ cell.innerHTML = 'ready';

return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&');
}
}
};
JSLitmus._init();
})();
})();

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

//https://github.com/jonkemp/qunit-phantomjs-runner
/*

@@ -17,112 +18,150 @@ * QtWebKit-powered headless test runner using PhantomJS

(function() {
'use strict';
(function () {
'use strict';
var args = require('system').args;
var url, page, timeout,
args = require('system').args;
// arg[0]: scriptName, args[1...]: arguments
if (args.length !== 2) {
console.error('Usage:\n phantomjs runner.js [url-of-your-qunit-testsuite]');
phantom.exit(1);
}
// arg[0]: scriptName, args[1...]: arguments
if (args.length < 2) {
console.error('Usage:\n phantomjs [phantom arguments] runner.js [url-of-your-qunit-testsuite] [timeout-in-seconds]');
exit(1);
}
var url = args[1],
page = require('webpage').create();
url = args[1];
// Route `console.log()` calls from within the Page context to the main Phantom context (i.e. current `this`)
page.onConsoleMessage = function(msg) {
console.log(msg);
};
if (args[2] !== undefined) {
timeout = parseInt(args[2], 10);
}
page.onInitialized = function() {
page.evaluate(addLogging);
};
page = require('webpage').create();
page.onCallback = function(message) {
var result,
failed;
// Route `console.log()` calls from within the Page context to the main Phantom context (i.e. current `this`)
page.onConsoleMessage = function (msg) {
console.log(msg);
};
if (message) {
if (message.name === 'QUnit.done') {
result = message.data;
failed = !result || result.failed;
page.onInitialized = function () {
page.evaluate(addLogging);
};
phantom.exit(failed ? 1 : 0);
}
}
};
page.onCallback = function (message) {
var result,
failed;
page.open(url, function(status) {
if (status !== 'success') {
console.error('Unable to access network: ' + status);
phantom.exit(1);
} else {
// Cannot do this verification with the 'DOMContentLoaded' handler because it
// will be too late to attach it if a page does not have any script tags.
var qunitMissing = page.evaluate(function() { return (typeof QUnit === 'undefined' || !QUnit); });
if (qunitMissing) {
console.error('The `QUnit` object is not present on this page.');
phantom.exit(1);
}
if (message) {
if (message.name === 'QUnit.done') {
result = message.data;
failed = !result || !result.total || result.failed;
// Do nothing... the callback mechanism will handle everything!
}
});
if (!result.total) {
console.error('No tests were executed. Are you loading tests asynchronously?');
}
function addLogging() {
window.document.addEventListener('DOMContentLoaded', function() {
var current_test_assertions = [];
exit(failed ? 1 : 0);
}
}
};
QUnit.log(function(details) {
var response;
page.open(url, function (status) {
if (status !== 'success') {
console.error('Unable to access network: ' + status);
exit(1);
} else {
// Cannot do this verification with the 'DOMContentLoaded' handler because it
// will be too late to attach it if a page does not have any script tags.
var qunitMissing = page.evaluate(function () {
return (typeof QUnit === 'undefined' || !QUnit);
});
if (qunitMissing) {
console.error('The `QUnit` object is not present on this page.');
exit(1);
}
// Ignore passing assertions
if (details.result) {
return;
}
// Set a default timeout value if the user does not provide one
if (typeof timeout === 'undefined') {
timeout = 5;
}
response = details.message || '';
// Set a timeout on the test running, otherwise tests with async problems will hang forever
setTimeout(function () {
console.error('The specified timeout of ' + timeout + ' seconds has expired. Aborting...');
exit(1);
}, timeout * 1000);
if (typeof details.expected !== 'undefined') {
if (response) {
response += ', ';
}
// Do nothing... the callback mechanism will handle everything!
}
});
response += 'expected: ' + details.expected + ', but was: ' + details.actual;
if (details.source) {
response += "\n" + details.source;
}
}
function addLogging() {
window.document.addEventListener('DOMContentLoaded', function () {
var currentTestAssertions = [];
current_test_assertions.push('Failed assertion: ' + response);
});
QUnit.log(function (details) {
var response;
QUnit.testDone(function(result) {
var i,
len,
name = result.module + ': ' + result.name;
// Ignore passing assertions
if (details.result) {
return;
}
if (result.failed) {
console.log('Test failed: ' + name);
response = details.message || '';
for (i = 0, len = current_test_assertions.length; i < len; i++) {
console.log(' ' + current_test_assertions[i]);
}
}
if (typeof details.expected !== 'undefined') {
if (response) {
response += ', ';
}
current_test_assertions.length = 0;
});
response += 'expected: ' + details.expected + ', but was: ' + details.actual;
}
QUnit.done(function(result) {
console.log('Took ' + result.runtime + 'ms to run ' + result.total + ' tests. ' + result.passed + ' passed, ' + result.failed + ' failed.');
if (details.source) {
response += '\n' + details.source;
}
if (typeof window.callPhantom === 'function') {
window.callPhantom({
'name': 'QUnit.done',
'data': result
});
}
});
}, false);
}
currentTestAssertions.push('Failed assertion: ' + response);
});
QUnit.testDone(function (result) {
var i,
len,
name = '';
if (result.module) {
name += result.module + ': ';
}
name += result.name;
if (result.failed) {
console.log('\n' + 'Test failed: ' + name);
for (i = 0, len = currentTestAssertions.length; i < len; i++) {
console.log(' ' + currentTestAssertions[i]);
}
}
currentTestAssertions.length = 0;
});
QUnit.done(function (result) {
console.log('\n' + 'Took ' + result.runtime + 'ms to run ' + result.total + ' tests. ' + result.passed + ' passed, ' + result.failed + ' failed.');
if (typeof window.callPhantom === 'function') {
window.callPhantom({
'name': 'QUnit.done',
'data': result
});
}
});
}, false);
}
function exit(code) {
if (page) {
page.close();
}
setTimeout(function () {
phantom.exit(code);
}, 0);
}
})();

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 too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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