@orbit/utils
Advanced tools
Comparing version 0.16.0-beta.7 to 0.16.0-beta.8
@@ -14,10 +14,12 @@ define('@orbit/utils', ['exports'], function (exports) { 'use strict'; | ||
function every(array, predicate) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
@@ -34,11 +36,14 @@ /** | ||
*/ | ||
function some(array, predicate) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
@@ -54,14 +59,18 @@ /** | ||
*/ | ||
function firstResult(array, valueFn) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
var result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
var result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
} | ||
} | ||
/* eslint-disable eqeqeq, no-eq-null, valid-jsdoc */ | ||
/** | ||
@@ -82,63 +91,77 @@ * `eq` checks the equality of two objects. | ||
function eq(a, b) { | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
} // A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
return false; | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
return false; | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
// A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
/* eslint-disable valid-jsdoc */ | ||
/** | ||
@@ -155,33 +178,40 @@ * Clones a value. If the value is an object, a deeply nested clone will be | ||
function clone(obj) { | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
} | ||
var dup; | ||
var type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (var i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} | ||
var dup = void 0; | ||
var type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (var i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} else { | ||
var val; | ||
dup = {}; | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
} else { | ||
var val = void 0; | ||
dup = {}; | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
return dup; | ||
} | ||
return dup; | ||
} | ||
@@ -197,18 +227,21 @@ /** | ||
*/ | ||
function expose(destination, source) { | ||
var properties = void 0; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
var properties; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
} else { | ||
properties = Object.keys(source); | ||
} | ||
properties.forEach(function (p) { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
properties = Object.keys(source); | ||
destination[p] = source[p]; | ||
} | ||
properties.forEach(function (p) { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
destination[p] = source[p]; | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -223,15 +256,16 @@ /** | ||
*/ | ||
function extend(destination) { | ||
for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
sources[_key - 1] = arguments[_key]; | ||
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
sources[_key - 1] = arguments[_key]; | ||
} | ||
sources.forEach(function (source) { | ||
for (var p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
sources.forEach(function (source) { | ||
for (var p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
}); | ||
return destination; | ||
}); | ||
return destination; | ||
} | ||
@@ -245,4 +279,5 @@ /** | ||
*/ | ||
function isArray(obj) { | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
} | ||
@@ -256,8 +291,9 @@ /** | ||
*/ | ||
function toArray(obj) { | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
} | ||
@@ -271,4 +307,5 @@ /** | ||
*/ | ||
function isObject(obj) { | ||
return obj !== null && typeof obj === 'object'; | ||
return obj !== null && typeof obj === 'object'; | ||
} | ||
@@ -282,4 +319,5 @@ /** | ||
*/ | ||
function isNone(obj) { | ||
return obj === undefined || obj === null; | ||
return obj === undefined || obj === null; | ||
} | ||
@@ -296,18 +334,20 @@ /** | ||
*/ | ||
function merge(object) { | ||
for (var _len2 = arguments.length, sources = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
sources[_key2 - 1] = arguments[_key2]; | ||
} | ||
for (var _len2 = arguments.length, sources = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
sources[_key2 - 1] = arguments[_key2]; | ||
} | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -326,21 +366,23 @@ /** | ||
*/ | ||
function deepMerge(object) { | ||
for (var _len3 = arguments.length, sources = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
sources[_key3 - 1] = arguments[_key3]; | ||
} | ||
for (var _len3 = arguments.length, sources = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
sources[_key3 - 1] = arguments[_key3]; | ||
} | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var a = object[field]; | ||
var b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var a = object[field]; | ||
var b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -357,12 +399,16 @@ /** | ||
*/ | ||
function deepGet(obj, path) { | ||
var index = -1; | ||
var result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
var index = -1; | ||
var result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
return result; | ||
} | ||
return result; | ||
} | ||
@@ -384,19 +430,24 @@ /** | ||
*/ | ||
function deepSet(obj, path, value) { | ||
var ptr = obj; | ||
var prop = path.pop(); | ||
var segment = void 0; | ||
for (var i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
ptr = ptr[segment]; | ||
var ptr = obj; | ||
var prop = path.pop(); | ||
var segment; | ||
for (var i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
ptr = ptr[segment]; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
} | ||
@@ -412,10 +463,11 @@ /** | ||
*/ | ||
function objectValues(obj) { | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(function (k) { | ||
return obj[k]; | ||
}); | ||
} | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(function (k) { | ||
return obj[k]; | ||
}); | ||
} | ||
} | ||
@@ -431,3 +483,3 @@ | ||
function capitalize(str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
} | ||
@@ -442,8 +494,9 @@ /** | ||
*/ | ||
function camelize(str) { | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
} | ||
@@ -457,4 +510,5 @@ /** | ||
*/ | ||
function decamelize(str) { | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
} | ||
@@ -468,4 +522,5 @@ /** | ||
*/ | ||
function dasherize(str) { | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
} | ||
@@ -479,4 +534,5 @@ /** | ||
*/ | ||
function underscore(str) { | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
} | ||
@@ -491,2 +547,3 @@ | ||
var lut = []; | ||
for (var i = 0; i < 256; i++) { | ||
@@ -502,2 +559,4 @@ lut[i] = (i < 16 ? '0' : '') + i.toString(16); | ||
*/ | ||
function uuid() { | ||
@@ -504,0 +563,0 @@ var d0 = Math.random() * 0xffffffff | 0; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -9,2 +9,3 @@ exports.every = every; | ||
exports.firstResult = firstResult; | ||
/** | ||
@@ -21,10 +22,12 @@ * Like the Lodash _.every function, this function takes an array and a | ||
function every(array, predicate) { | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
@@ -41,11 +44,15 @@ /** | ||
*/ | ||
function some(array, predicate) { | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
@@ -61,12 +68,16 @@ /** | ||
*/ | ||
function firstResult(array, valueFn) { | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
let result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
let result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFycmF5cy5qcyJdLCJuYW1lcyI6WyJldmVyeSIsInNvbWUiLCJmaXJzdFJlc3VsdCIsImFycmF5IiwicHJlZGljYXRlIiwiaW5kZXgiLCJsZW5ndGgiLCJ2YWx1ZUZuIiwicmVzdWx0Il0sIm1hcHBpbmdzIjoiOzs7OztRQVVnQkEsSyxHQUFBQSxLO1FBb0JBQyxJLEdBQUFBLEk7UUFtQkFDLFcsR0FBQUEsVztBQWpEaEI7Ozs7Ozs7Ozs7QUFVTyxTQUFTRixLQUFULENBQWVHLEtBQWYsRUFBc0JDLFNBQXRCLEVBQWlDO0FBQ3BDLFFBQUlDLFFBQVEsQ0FBQyxDQUFiO0FBQ0EsUUFBSUMsU0FBU0gsTUFBTUcsTUFBbkI7QUFDQSxXQUFPLEVBQUVELEtBQUYsR0FBVUMsTUFBakIsRUFBeUI7QUFDckIsWUFBSSxDQUFDRixVQUFVRCxNQUFNRSxLQUFOLENBQVYsRUFBd0JBLEtBQXhCLENBQUwsRUFBcUM7QUFDakMsbUJBQU8sS0FBUDtBQUNIO0FBQ0o7QUFDRCxXQUFPLElBQVA7QUFDSDtBQUNEOzs7Ozs7Ozs7O0FBVU8sU0FBU0osSUFBVCxDQUFjRSxLQUFkLEVBQXFCQyxTQUFyQixFQUFnQztBQUNuQyxRQUFJQyxRQUFRLENBQUMsQ0FBYjtBQUNBLFFBQUlDLFNBQVNILE1BQU1HLE1BQW5CO0FBQ0EsV0FBTyxFQUFFRCxLQUFGLEdBQVVDLE1BQWpCLEVBQXlCO0FBQ3JCLFlBQUlGLFVBQVVELE1BQU1FLEtBQU4sQ0FBVixFQUF3QkEsS0FBeEIsQ0FBSixFQUFvQztBQUNoQyxtQkFBTyxJQUFQO0FBQ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ge1xuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG4gIH1cbn0iXX0= |
"use strict"; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJkaWN0LmpzIiwic291cmNlc0NvbnRlbnQiOltdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbXX0= |
@@ -1,8 +0,10 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.eq = eq; | ||
/* eslint-disable eqeqeq, no-eq-null, valid-jsdoc */ | ||
/** | ||
@@ -23,61 +25,74 @@ * `eq` checks the equality of two objects. | ||
function eq(a, b) { | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
} // A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
return false; | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
return false; | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
// A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVxLmpzIl0sIm5hbWVzIjpbImVxIiwiYSIsImIiLCJ0eXBlIiwiT2JqZWN0IiwicHJvdG90eXBlIiwidG9TdHJpbmciLCJjYWxsIiwiU3RyaW5nIiwic291cmNlIiwiZ2xvYmFsIiwibXVsdGlsaW5lIiwiaWdub3JlQ2FzZSIsImxlbmd0aCIsImkiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFlZ0JBLEUsR0FBQUEsRTtBQWZoQjtBQUNBOzs7Ozs7Ozs7Ozs7OztBQWNPLFNBQVNBLEVBQVQsQ0FBWUMsQ0FBWixFQUFlQyxDQUFmLEVBQWtCO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFFBQUlELE1BQU1DLENBQVYsRUFBYTtBQUNULGVBQU9ELE1BQU0sQ0FBTixJQUFXLElBQUlBLENBQUosSUFBUyxJQUFJQyxDQUEvQjtBQUNIO0FBQ0Q7QUFDQSxRQUFJRCxLQUFLLElBQUwsSUFBYUMsS0FBSyxJQUF0QixFQUE0QjtBQUN4QixlQUFPRCxNQUFNQyxDQUFiO0FBQ0g7QUFDRCxRQUFJQyxPQUFPQyxPQUFPQyxTQUFQLENBQWlCQyxRQUFqQixDQUEwQkMsSUFBMUIsQ0FBK0JOLENBQS9CL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GEubXVsdGlsaW5lID09IGIubXVsdGlsaW5lICYmIGEuaWdub3JlQ2FzZSA9PSBiLmlnbm9yZUNhc2U7XG4gICAgfVxuICAgIGlmICh0eXBlb2YgYSAhPSAnb2JqZWN0JyB8fCB0eXBlb2YgYiAhPSAnb2JqZWN0Jykge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIGlmICh0eXBlID09PSAnW29iamVjdCBBcnJheV0nKSB7XG4gICAgICAgIGlmIChhLmxlbmd0aCAhPT0gYi5sZW5ndGgpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cbiAgICB2YXIgaTtcbiAgICBmb3IgKGkgaW4gYikge1xuICAgICAgICBpZiAoYi5oYXNPd25Qcm9wZXJ0eShpKSkge1xuICAgICAgICAgICAgaWYgKCFlcShhW2ldLCBiW2ldKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBmb3IgKGkgaW4gYSkge1xuICAgICAgICBpZiAoYS5oYXNPd25Qcm9wZXJ0eShpKSkge1xuICAgICAgICAgICAgaWYgKCFlcShhW2ldLCBiW2ldKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gdHJ1ZTtcbn0iXX0= | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVxLmpzIl0sIm5hbWVzIjpbImVxIiwiYSIsImIiLCJ0eXBlIiwiT2JqZWN0IiwicHJvdG90eXBlIiwidG9TdHJpbmciLCJjYWxsIiwiU3RyaW5nIiwic291cmNlIiwiZ2xvYmFsIiwibXVsdGlsaW5lIiwiaWdub3JlQ2FzZSIsImxlbmd0aCIsImkiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW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ldKSkge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgZm9yIChpIGluIGEpIHtcbiAgICBpZiAoYS5oYXNPd25Qcm9wZXJ0eShpKSkge1xuICAgICAgaWYgKCFlcShhW2ldLCBiW2ldKSkge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRydWU7XG59Il19 |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,3 +7,3 @@ Object.defineProperty(exports, "__esModule", { | ||
var _arrays = require('./arrays'); | ||
var _arrays = require("./arrays"); | ||
@@ -20,3 +20,3 @@ Object.keys(_arrays).forEach(function (key) { | ||
var _eq = require('./eq'); | ||
var _eq = require("./eq"); | ||
@@ -33,3 +33,3 @@ Object.keys(_eq).forEach(function (key) { | ||
var _objects = require('./objects'); | ||
var _objects = require("./objects"); | ||
@@ -46,3 +46,3 @@ Object.keys(_objects).forEach(function (key) { | ||
var _strings = require('./strings'); | ||
var _strings = require("./strings"); | ||
@@ -59,3 +59,3 @@ Object.keys(_strings).forEach(function (key) { | ||
var _uuid = require('./uuid'); | ||
var _uuid = require("./uuid"); | ||
@@ -71,2 +71,2 @@ Object.keys(_uuid).forEach(function (key) { | ||
}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9hcnJheXMnO1xuZXhwb3J0ICogZnJvbSAnLi9lcSc7XG5leHBvcnQgKiBmcm9tICcuL29iamVjdHMnO1xuZXhwb3J0ICogZnJvbSAnLi9zdHJpbmdzJztcbmV4cG9ydCAqIGZyb20gJy4vdXVpZCc7Il19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBOztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFDQTs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7O0FBQ0E7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOztBQUNBOztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFDQTs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2FycmF5cyc7XG5leHBvcnQgKiBmcm9tICcuL2VxJztcbmV4cG9ydCAqIGZyb20gJy4vb2JqZWN0cyc7XG5leHBvcnQgKiBmcm9tICcuL3N0cmluZ3MnO1xuZXhwb3J0ICogZnJvbSAnLi91dWlkJzsiXX0= |
@@ -1,5 +0,5 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -18,3 +18,5 @@ exports.clone = clone; | ||
exports.objectValues = objectValues; | ||
/* eslint-disable valid-jsdoc */ | ||
/** | ||
@@ -31,33 +33,40 @@ * Clones a value. If the value is an object, a deeply nested clone will be | ||
function clone(obj) { | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
} | ||
let dup; | ||
let type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (let i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} | ||
let dup; | ||
let type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (let i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} else { | ||
let val; | ||
dup = {}; | ||
for (let key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
} else { | ||
let val; | ||
dup = {}; | ||
for (let key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
return dup; | ||
} | ||
return dup; | ||
} | ||
@@ -73,18 +82,22 @@ /** | ||
*/ | ||
function expose(destination, source) { | ||
let properties; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
let properties; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
} else { | ||
properties = Object.keys(source); | ||
} | ||
properties.forEach(p => { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
properties = Object.keys(source); | ||
destination[p] = source[p]; | ||
} | ||
properties.forEach(p => { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
destination[p] = source[p]; | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -99,11 +112,13 @@ /** | ||
*/ | ||
function extend(destination, ...sources) { | ||
sources.forEach(source => { | ||
for (let p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
}); | ||
return destination; | ||
sources.forEach(source => { | ||
for (let p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
}); | ||
return destination; | ||
} | ||
@@ -117,4 +132,6 @@ /** | ||
*/ | ||
function isArray(obj) { | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
} | ||
@@ -128,8 +145,10 @@ /** | ||
*/ | ||
function toArray(obj) { | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
} | ||
@@ -143,4 +162,6 @@ /** | ||
*/ | ||
function isObject(obj) { | ||
return obj !== null && typeof obj === 'object'; | ||
return obj !== null && typeof obj === 'object'; | ||
} | ||
@@ -154,4 +175,6 @@ /** | ||
*/ | ||
function isNone(obj) { | ||
return obj === undefined || obj === null; | ||
return obj === undefined || obj === null; | ||
} | ||
@@ -168,14 +191,17 @@ /** | ||
*/ | ||
function merge(object, ...sources) { | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -194,17 +220,20 @@ /** | ||
*/ | ||
function deepMerge(object, ...sources) { | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let a = object[field]; | ||
let b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let a = object[field]; | ||
let b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -221,12 +250,17 @@ /** | ||
*/ | ||
function deepGet(obj, path) { | ||
let index = -1; | ||
let result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
let index = -1; | ||
let result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
return result; | ||
} | ||
return result; | ||
} | ||
@@ -248,19 +282,25 @@ /** | ||
*/ | ||
function deepSet(obj, path, value) { | ||
let ptr = obj; | ||
let prop = path.pop(); | ||
let segment; | ||
for (let i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
ptr = ptr[segment]; | ||
let ptr = obj; | ||
let prop = path.pop(); | ||
let segment; | ||
for (let i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
ptr = ptr[segment]; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
} | ||
@@ -276,9 +316,11 @@ /** | ||
*/ | ||
function objectValues(obj) { | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(k => obj[k]); | ||
} | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(k => obj[k]); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9iamVjdHMuanMiXSwibmFtZXMiOlsiY2xvbmUiLCJleHBvc2UiLCJleHRlbmQiLCJpc0FycmF5IiwidG9BcnJheSIsImlzT2JqZWN0IiwiaXNOb25lIiwibWVyZ2UiLCJkZWVwTWVyZ2UiLCJkZWVwR2V0IiwiZGVlcFNldCIsIm9iamVjdFZhbHVlcyIsIm9iaiIsInVuZGVmaW5lZCIsImR1cCIsInR5cGUiLCJPYmplY3QiLCJwcm90b3R5cGUiLCJ0b1N0cmluZyIsImNhbGwiLCJEYXRlIiwic2V0VGltZSIsImdldFRpbWUiLCJjb25zdHJ1Y3RvciIsImkiLCJsZW4iLCJsZW5ndGgiLCJoYXNPd25Qcm9wZXJ0eSIsInB1c2giLCJ2YWwiLCJrZXkiLCJkZXN0aW5hdGlvbiIsInNvdXJjZSIsInByb3BlcnRpZXMiLCJhcmd1bWVudHMiLCJBcnJheSIsInNsaWNlIiwia2V5cyIsImZvckVhY2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4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICBsZXQgdmFsO1xuICAgICAgICBkdXAgPSB7fTtcbiAgICAgICAgZm9yIChsZXQga2V5IGluIG9iaikge1xuICAgICAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgICAgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWwgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbCA9IGNsb25lKHZhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGR1cFtrZXldID0gdmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBkdXA7XG59XG4vKipcbiAqIEV4cG9zZSBwcm9wZXJ0aWVzIGFuZCBtZXRob2RzIGZyb20gb25lIG9iamVjdCBvbiBhbm90aGVyLlxuICpcbiAqIE1ldGhvZHMgd2lsbCBiZSBjYWxsZWQgb24gYHNvdXJjZWAgYW5kIHdpbGwgbWFpbnRhaW4gYHNvdXJjZWAgYXMgdGhlIGNvbnRleHQuXG4gKlxuICogQGV4cG9ydFxuICogQHBhcmFtIHsqfSBkZXN0aW5hdGlvblxuICogQHBhcmFtIHsqfSBzb3VyY2VcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGV4cG9zZShkZXN0aW5hdGlvbiwgc291cmNlKSB7XG4gICAgbGV0IHByb3BlcnRpZXM7XG4gICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPiAyKSB7XG4gICAgICAgIHByb3BlcnRpZXMgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDIpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHByb3BlcnRpZXMgPSBPYmplY3Qua2V5cyhzb3VyY2UpO1xuICAgIH1cbiAgICBwcm9wZXJ0aWVzLmZvckVhY2gocCA9PiB7X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LlxuICpcbiAqIEBleHBvcnRcbiAqIEBwYXJhbSB7Kn0gYmFzZVxuICogQHBhcmFtIHsuLi5hbnlbXX0gc291cmNlc1xuICogQHJldHVybnMgeyp9XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBkZWVwTWVyZ2Uob2JqZWN0LCAuLi5zb3VyY2VzKSB7XG4gICAgc291cmNlcy5mb3JFYWNoKHNvdXJjZSA9PiB7XG4gICAgICAgIE9iamVjdC5rZXlzKHNvdXJjZSkuZm9yRWFjaChmaWVsZCA9PiB7XG4gICAgICAgICAgICBpZiAoc291cmNlLmhhc093blByb3BlcnR5KGZpZWxkKSkge1xuICAgICAgICAgICAgICAgIGxldCBhID0gb2JqZWN0W2ZpZWxkXTtcbiAgICAgICAgICAgICAgICBsZXQgYiA9IHNvdXJjZVtmaWVsZF07XG4gICAgICAgICAgICAgICAgaWYgKGlzT2JqZWN0KGEpICYmIGlzT2JqZWN0KGIpICYmICFpc0FycmF5KGEpICYmICFpc0FycmF5KGIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlZXBNZXJnZShhLCBiKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGIgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICBvYmplY3RbZmllbGRdID0gY2xvbmUoYik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9KTtcbiAgICByZXR1cm4gb2JqZWN0O1xufVxuLyoqXG4gKiBSZXRyaWV2ZXMgYSB2YWx1ZSBmcm9tIGEgbmVzdGVkIHBhdGggb24gYW4gb2JqZWN0LlxuICpcbiAqIFJldHVybnMgYW55IGZhbHN5IHZhbHVlIGVuY291bnRlcmVkIHdoaWxlIHRyYXZlcnNpbmcgdGhlIHBhdGguXG4gKlxuICogQGV4cG9ydFxuICogQHBhcmFtIHsqfSBvYmpcbiAqIEBwYXJhbSB7c3RyaW5nW119IHBhdGhcbiAqIEByZXR1cm5zI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oLnBvcCgpO1xuICAgIGxldCBzZWdtZW50O1xuICAgIGZvciAobGV0IGkgPSAwLCBsID0gcGF0aC5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgc2VnbWVudCA9IHBhdGhbaV07XG4gICAgICAgIGlmIChwdHJbc2VnbWVudF0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcHRyW3NlZ21lbnRdID0gdHlwZW9mIHNlZ21lbnQgPT09ICdudW1iZXInID8gW10gOiB7fTtcbiAgICAgICAgfVxuICAgICAgICBwdHIgPSBwdHJbc2VnbWVudF07XG4gICAgfVxuICAgIGlmIChwdHJbcHJvcF0gPT09IHZhbHVlKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBwdHJbcHJvcF0gPSB2YWx1ZTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxufVxuLyoqXG4gKiBGaW5kIGFuIGFycmF5IG9mIHZhbHVlcyB0aGF0IGNvcnJlc3BvbmQgdG8gdGhlIGtleXMgb2YgYW4gb2JqZWN0LlxuICpcbiAqIFRoaXMgaXMgYSBwb255ZmlsbCBmb3IgYE9iamVjdC52YWx1ZXNgLCB3aGljaCBpcyBzdGlsbCBleHBlcmltZW50YWwuXG4gKlxuICogQGV4cG9ydFxuICogQHBhcmFtIHsqfSBvYmpcbiAqIEByZXR1cm5zIHthbnlbXX1cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIG9iamVjdFZhbHVlcyhvYmopIHtcbiAgICBpZiAoT2JqZWN0LnZhbHVlcykge1xuICAgICAgICByZXR1cm4gT2JqZWN0LnZhbHVlcyhvYmopO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiBPYmplY3Qua2V5cyhvYmopLm1hcChrID0+IG9ialtrXSk7XG4gICAgfVxufSJdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbI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WdtZW50ID0gcGF0aFtpXTtcblxuICAgIGlmIChwdHJbc2VnbWVudF0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgcHRyW3NlZ21lbnRdID0gdHlwZW9mIHNlZ21lbnQgPT09ICdudW1iZXInID8gW10gOiB7fTtcbiAgICB9XG5cbiAgICBwdHIgPSBwdHJbc2VnbWVudF07XG4gIH1cblxuICBpZiAocHRyW3Byb3BdID09PSB2YWx1ZSkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfSBlbHNlIHtcbiAgICBwdHJbcHJvcF0gPSB2YWx1ZTtcbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuLyoqXG4gKiBGaW5kIGFuIGFycmF5IG9mIHZhbHVlcyB0aGF0IGNvcnJlc3BvbmQgdG8gdGhlIGtleXMgb2YgYW4gb2JqZWN0LlxuICpcbiAqIFRoaXMgaXMgYSBwb255ZmlsbCBmb3IgYE9iamVjdC52YWx1ZXNgLCB3aGljaCBpcyBzdGlsbCBleHBlcmltZW50YWwuXG4gKlxuICogQGV4cG9ydFxuICogQHBhcmFtIHsqfSBvYmpcbiAqIEByZXR1cm5zIHthbnlbXX1cbiAqL1xuXG5leHBvcnQgZnVuY3Rpb24gb2JqZWN0VmFsdWVzKG9iaikge1xuICBpZiAoT2JqZWN0LnZhbHVlcykge1xuICAgIHJldHVybiBPYmplY3QudmFsdWVzKG9iaik7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIE9iamVjdC5rZXlzKG9iaikubWFwKGsgPT4gb2JqW2tdKTtcbiAgfVxufSJdfQ== |
@@ -1,5 +0,5 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -11,2 +11,3 @@ exports.capitalize = capitalize; | ||
exports.underscore = underscore; | ||
/** | ||
@@ -20,3 +21,3 @@ * Uppercase the first letter of a string, but don't change the remainder. | ||
function capitalize(str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
} | ||
@@ -31,8 +32,10 @@ /** | ||
*/ | ||
function camelize(str) { | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
} | ||
@@ -46,4 +49,6 @@ /** | ||
*/ | ||
function decamelize(str) { | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
} | ||
@@ -57,4 +62,6 @@ /** | ||
*/ | ||
function dasherize(str) { | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
} | ||
@@ -68,5 +75,7 @@ /** | ||
*/ | ||
function underscore(str) { | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ3MuanMiXSwibmFtZXMiOlsiY2FwaXRhbGl6ZSIsImNhbWVsaXplIiwiZGVjYW1lbGl6ZSIsImRhc2hlcml6ZSIsInVuZGVyc2NvcmUiLCJzdHIiLCJjaGFyQXQiLCJ0b1VwcGVyQ2FzZSIsInNsaWNlIiwicmVwbGFjZSIsIm1hdGNoIiwic2VwYXJhdG9yIiwiY2hyIiwidG9Mb3dlckNhc2UiXSwibWFwcGluZ3MiOiI7Ozs7O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0cikge1xuICByZXR1cm4gc3RyLnJlcGxhY2UoLyhbYS16XFxkXSkoW0EtWl0rKS9nLCAnJDFfJDInKS5yZXBsYWNlKC9cXC18XFxzKy9nLCAnXycpLnRvTG93ZXJDYXNlKCk7XG59Il19 |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,2 +7,3 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.uuid = uuid; | ||
/** | ||
@@ -15,2 +16,3 @@ * Fast UUID generator, RFC4122 version 4 compliant. | ||
const lut = []; | ||
for (let i = 0; i < 256; i++) { | ||
@@ -26,2 +28,4 @@ lut[i] = (i < 16 ? '0' : '') + i.toString(16); | ||
*/ | ||
function uuid() { | ||
@@ -34,2 +38,2 @@ let d0 = Math.random() * 0xffffffff | 0; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInV1aWQuanMiXSwibmFtZXMiOlsidXVpZCIsImx1dCIsImkiLCJ0b1N0cmluZyIsImQwIiwiTWF0aCIsInJhbmRvbSIsImQxIiwiZDIiLCJkMyJdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFpQmdCQSxJLEdBQUFBLEk7QUFqQmhCOzs7Ozs7QUFNQSxNQUFNQyxNQUFNLEVBQVo7QUFDQSxLQUFLLElBQUlDLElBQUksQ0FBYixFQUFnQkEsSUFBSSxHQUFwQixFQUF5QkEsR0FBekIsRUFBOEI7QUFDNUJELE1BQUlDLENBQUosSUFBUyxDQUFDQSxJQUFJLEVBQUosR0FBUyxHQUFULEdBQWUsRUFBaEIsSUFBc0JBLEVBQUVDLFFBQUYsQ0FBVyxFQUFYLENBQS9CO0FBQ0Q7QUFDRDs7Ozs7OztBQU9PLFNBQVNILElBQVQsR0FBZ0I7QUFDckIsTUFBSUksS0FBS0MsS0FBS0MsTUFBTCxLQUFnQixVQUFoQixHQUE2QixDQUF0QztBQUNBLE1BQUlDLEtBQUtGLEtBQUt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FuZG9tKCkgKiAweGZmZmZmZmZmIHwgMDtcbiAgbGV0IGQyID0gTWF0aC5yYW5kb20oKSAqIDB4ZmZmZmZmZmYgfCAwO1xuICBsZXQgZDMgPSBNYXRoLnJhbmRvbSgpICogMHhmZmZmZmZmZiB8IDA7XG4gIHJldHVybiBsdXRbZDAgJiAweGZmXSArIGx1dFtkMCA+PiA4ICYgMHhmZl0gKyBsdXRbZDAgPj4gMTYgJiAweGZmXSArIGx1dFtkMCA+PiAyNCAmIDB4ZmZdICsgJy0nICsgbHV0W2QxICYgMHhmZl0gKyBsdXRbZDEgPj4gOCAmIDB4ZmZdICsgJy0nICsgbHV0W2QxID4+IDE2ICYgMHgwZiB8IDB4NDBdICsgbHV0W2QxID4+IDI0ICYgMHhmZl0gKyAnLScgKyBsdXRbZDIgJiAweDNmIHwgMHg4MF0gKyBsdXRbZDIgPj4gOCAmIDB4ZmZdICsgJy0nICsgbHV0W2QyID4+IDE2ICYgMHhmZl0gKyBsdXRbZDIgPj4gMjQgJiAweGZmXSArIGx1dFtkMyAmIDB4ZmZdICsgbHV0W2QzID4+IDggJiAweGZmXSArIGx1dFtkMyA+PiAxNiAmIDB4ZmZdICsgbHV0W2QzID4+IDI0ICYgMHhmZl07XG59Il19 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -9,2 +9,3 @@ exports.every = every; | ||
exports.firstResult = firstResult; | ||
/** | ||
@@ -21,10 +22,12 @@ * Like the Lodash _.every function, this function takes an array and a | ||
function every(array, predicate) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
@@ -41,11 +44,15 @@ /** | ||
*/ | ||
function some(array, predicate) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
@@ -61,12 +68,16 @@ /** | ||
*/ | ||
function firstResult(array, valueFn) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
var result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
var result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFycmF5cy5qcyJdLCJuYW1lcyI6WyJpbmRleCIsImxlbmd0aCIsImFycmF5IiwicHJlZGljYXRlIiwicmVzdWx0IiwidmFsdWVGbiJdLCJtYXBwaW5ncyI6Ijs7Ozs7UUFVTyxLLEdBQUEsSztRQW9CQSxJLEdBQUEsSTtRQW1CQSxXLEdBQUEsVzs7Ozs7Ozs7Ozs7QUF2Q0EsU0FBQSxLQUFBLENBQUEsS0FBQSxFQUFBLFNBQUEsRUFBaUM7QUFDcEMsUUFBSUEsUUFBUSxDQUFaLENBQUE7QUFDQSxRQUFJQyxTQUFTQyxNQUFiLE1BQUE7QUFDQSxXQUFPLEVBQUEsS0FBQSxHQUFQLE1BQUEsRUFBeUI7QUFDckIsWUFBSSxDQUFDQyxVQUFVRCxNQUFWQyxLQUFVRCxDQUFWQyxFQUFMLEtBQUtBLENBQUwsRUFBcUM7QUFDakMsbUJBQUEsS0FBQTtBQUNIO0FBQ0o7QUFDRCxXQUFBLElBQUE7QUFDSDtBQUNEOzs7Ozs7Ozs7O0FBVU8sU0FBQSxJQUFBLENBQUEsS0FBQSxFQUFBLFNBQUEsRUFBZ0M7QUFDbkMsUUFBSUgsUUFBUSxDQUFaLENBQUE7QUFDQSxRQUFJQy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mRleCk7XG5cbiAgICBpZiAocmVzdWx0KSB7XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cbiAgfVxufSJdfQ== |
@@ -1,8 +0,10 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.eq = eq; | ||
/* eslint-disable eqeqeq, no-eq-null, valid-jsdoc */ | ||
/** | ||
@@ -23,61 +25,74 @@ * `eq` checks the equality of two objects. | ||
function eq(a, b) { | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
} // A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
return false; | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
return false; | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
// A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} |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3VyY2UgJiYgYS5nbG9iYWwgPT0gYi5nbG9iYWwgJiYgYS5tdWx0aWxpbmUgPT0gYi5tdWx0aWxpbmUgJiYgYS5pZ25vcmVDYXNlID09IGIuaWdub3JlQ2FzZTtcbiAgfVxuXG4gIGlmICh0eXBlb2YgYSAhPSAnb2JqZWN0JyB8fCB0eXBlb2YgYiAhPSAnb2JqZWN0Jykge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGlmICh0eXBlID09PSAnW29iamVjdCBBcnJheV0nKSB7XG4gICAgaWYgKGEubGVuZ3RoICE9PSBiLmxlbmd0aCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHZhciBpO1xuXG4gIGZvciAoaSBpbiBiKSB7XG4gICAgaWYgKGIuaGFzT3duUHJvcGVydHkoaSkpIHtcbiAgICAgIGlmICghZXEoYVtpXSwgYltpXSkpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIGZvciAoaSBpbiBhKSB7XG4gICAgaWYgKGEuaGFzT3duUHJvcGVydHkoaSkpIHtcbiAgICAgIGlmICghZXEoYVtpXSwgYltpXSkpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufSJdfQ== |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,3 +7,3 @@ Object.defineProperty(exports, "__esModule", { | ||
var _arrays = require('./arrays'); | ||
var _arrays = require("./arrays"); | ||
@@ -20,3 +20,3 @@ Object.keys(_arrays).forEach(function (key) { | ||
var _eq = require('./eq'); | ||
var _eq = require("./eq"); | ||
@@ -33,3 +33,3 @@ Object.keys(_eq).forEach(function (key) { | ||
var _objects = require('./objects'); | ||
var _objects = require("./objects"); | ||
@@ -46,3 +46,3 @@ Object.keys(_objects).forEach(function (key) { | ||
var _strings = require('./strings'); | ||
var _strings = require("./strings"); | ||
@@ -59,3 +59,3 @@ Object.keys(_strings).forEach(function (key) { | ||
var _uuid = require('./uuid'); | ||
var _uuid = require("./uuid"); | ||
@@ -71,2 +71,2 @@ Object.keys(_uuid).forEach(function (key) { | ||
}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOzs7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9hcnJheXMnO1xuZXhwb3J0ICogZnJvbSAnLi9lcSc7XG5leHBvcnQgKiBmcm9tICcuL29iamVjdHMnO1xuZXhwb3J0ICogZnJvbSAnLi9zdHJpbmdzJztcbmV4cG9ydCAqIGZyb20gJy4vdXVpZCc7Il19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBOztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFDQTs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7O0FBQ0E7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOztBQUNBOztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFDQTs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2FycmF5cyc7XG5leHBvcnQgKiBmcm9tICcuL2VxJztcbmV4cG9ydCAqIGZyb20gJy4vb2JqZWN0cyc7XG5leHBvcnQgKiBmcm9tICcuL3N0cmluZ3MnO1xuZXhwb3J0ICogZnJvbSAnLi91dWlkJzsiXX0= |
@@ -1,5 +0,5 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -18,3 +18,5 @@ exports.clone = clone; | ||
exports.objectValues = objectValues; | ||
/* eslint-disable valid-jsdoc */ | ||
/** | ||
@@ -31,33 +33,40 @@ * Clones a value. If the value is an object, a deeply nested clone will be | ||
function clone(obj) { | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
} | ||
var dup; | ||
var type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (var i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} | ||
var dup = void 0; | ||
var type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (var i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} else { | ||
var val; | ||
dup = {}; | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
} else { | ||
var val = void 0; | ||
dup = {}; | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
return dup; | ||
} | ||
return dup; | ||
} | ||
@@ -73,18 +82,22 @@ /** | ||
*/ | ||
function expose(destination, source) { | ||
var properties = void 0; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
var properties; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
} else { | ||
properties = Object.keys(source); | ||
} | ||
properties.forEach(function (p) { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
properties = Object.keys(source); | ||
destination[p] = source[p]; | ||
} | ||
properties.forEach(function (p) { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
destination[p] = source[p]; | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -99,15 +112,17 @@ /** | ||
*/ | ||
function extend(destination) { | ||
for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
sources[_key - 1] = arguments[_key]; | ||
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
sources[_key - 1] = arguments[_key]; | ||
} | ||
sources.forEach(function (source) { | ||
for (var p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
sources.forEach(function (source) { | ||
for (var p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
}); | ||
return destination; | ||
}); | ||
return destination; | ||
} | ||
@@ -121,4 +136,6 @@ /** | ||
*/ | ||
function isArray(obj) { | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
} | ||
@@ -132,8 +149,10 @@ /** | ||
*/ | ||
function toArray(obj) { | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
} | ||
@@ -147,4 +166,6 @@ /** | ||
*/ | ||
function isObject(obj) { | ||
return obj !== null && typeof obj === 'object'; | ||
return obj !== null && typeof obj === 'object'; | ||
} | ||
@@ -158,4 +179,6 @@ /** | ||
*/ | ||
function isNone(obj) { | ||
return obj === undefined || obj === null; | ||
return obj === undefined || obj === null; | ||
} | ||
@@ -172,18 +195,21 @@ /** | ||
*/ | ||
function merge(object) { | ||
for (var _len2 = arguments.length, sources = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
sources[_key2 - 1] = arguments[_key2]; | ||
} | ||
for (var _len2 = arguments.length, sources = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
sources[_key2 - 1] = arguments[_key2]; | ||
} | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -202,21 +228,24 @@ /** | ||
*/ | ||
function deepMerge(object) { | ||
for (var _len3 = arguments.length, sources = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
sources[_key3 - 1] = arguments[_key3]; | ||
} | ||
for (var _len3 = arguments.length, sources = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
sources[_key3 - 1] = arguments[_key3]; | ||
} | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var a = object[field]; | ||
var b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var a = object[field]; | ||
var b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -233,12 +262,17 @@ /** | ||
*/ | ||
function deepGet(obj, path) { | ||
var index = -1; | ||
var result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
var index = -1; | ||
var result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
return result; | ||
} | ||
return result; | ||
} | ||
@@ -260,19 +294,25 @@ /** | ||
*/ | ||
function deepSet(obj, path, value) { | ||
var ptr = obj; | ||
var prop = path.pop(); | ||
var segment = void 0; | ||
for (var i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
ptr = ptr[segment]; | ||
var ptr = obj; | ||
var prop = path.pop(); | ||
var segment; | ||
for (var i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
ptr = ptr[segment]; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
} | ||
@@ -288,11 +328,13 @@ /** | ||
*/ | ||
function objectValues(obj) { | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(function (k) { | ||
return obj[k]; | ||
}); | ||
} | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(function (k) { | ||
return obj[k]; | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9iamVjdHMuanMiXSwibmFtZXMiOlsib2JqIiwiZHVwIiwidHlwZSIsIk9iamVjdCIsImkiLCJsZW4iLCJjbG9uZSIsInZhbCIsInByb3BlcnRpZXMiLCJhcmd1bWVudHMiLCJBcnJheSIsInNvdXJjZSIsImRlc3RpbmF0aW9uIiwic291cmNlcyIsImlzTm9uZSIsImlzQXJyYXkiLCJ2YWx1ZSIsIm9iamVjdCIsImEiLCJiIiwiaXNPYmplY3QiLCJkZWVwTWVyZ2UiLCJpbmRleCIsInJlc3VsdCIsInBhdGgiLCJwdHIiLCJwcm9wIiwic2VnbWVudCIsImwiXSwibWFwcGluZ3MiOiI7Ozs7O1FBV08sSyxHQUFBLEs7UUEwQ0EsTSxHQUFBLE07UUF5QkEsTSxHQUFBLE07UUFpQkEsTyxHQUFBLE87UUFVQSxPLEdBQUEsTztRQWNB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NldFRpbWUob2JqLmdldFRpbWUoKSk7XG4gICAgfSBlbHNlIGlmICh0eXBlID09PSAnW29iamVjdCBSZWdFeHBdJykge1xuICAgICAgICBkdXAgPSBvYmouY29uc3RydWN0b3Iob2JqKTtcbiAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdbb2JqZWN0IEFycmF5XScpIHtcbiAgICAgICAgZHVwID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsZW4gPSBvYmoubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChvYmouaGFzT3duUHJvcGVydHkoaSkpIHtcbiAgICAgICAgICAgICAgICBkdXAucHVzaChjbG9uZShvYmpbaV0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGxldCB2YWw7XG4gICAgICAgIGR1cCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBrZXkgaW4gb2JqKSB7XG4gICAgICAgICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgICB2YWwgPSBvYmpba2V5XTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsID0gY2xvbmUodmFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZHVwW2tleV0gPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGR1cDtcbn1cbi8qKlxuICogRXhwb3NlIHByb3BlcnRpZXMgYW5kIG1ldGhvZHMgZnJvbSBvbmUgb2JqZWN0IG9uIGFub3RoZXIuXG4gKlxuICogTWV0aG9kcyB3aWxsIGJlIGNhbGxlZCBvbiBgc291cmNlYCBhbmQgd2lsbCBtYWludGFpbiBgc291cmNlYCBhcyB0aGUgY29udGV4dC5cbiAqXG4gKiBAZXhwb3J0XG4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0gPSB0eXBlb2Ygc2VnbWVudCA9PT0gJ251bWJlcicgPyBbXSA6IHt9O1xuICAgIH1cblxuICAgIHB0ciA9IHB0cltzZWdtZW50XTtcbiAgfVxuXG4gIGlmIChwdHJbcHJvcF0gPT09IHZhbHVlKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9IGVsc2Uge1xuICAgIHB0cltwcm9wXSA9IHZhbHVlO1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59XG4vKipcbiAqIEZpbmQgYW4gYXJyYXkgb2YgdmFsdWVzIHRoYXQgY29ycmVzcG9uZCB0byB0aGUga2V5cyBvZiBhbiBvYmplY3QuXG4gKlxuICogVGhpcyBpcyBhIHBvbnlmaWxsIGZvciBgT2JqZWN0LnZhbHVlc2AsIHdoaWNoIGlzIHN0aWxsIGV4cGVyaW1lbnRhbC5cbiAqXG4gKiBAZXhwb3J0XG4gKiBAcGFyYW0geyp9IG9ialxuICogQHJldHVybnMge2FueVtdfVxuICovXG5cbmV4cG9ydCBmdW5jdGlvbiBvYmplY3RWYWx1ZXMob2JqKSB7XG4gIGlmIChPYmplY3QudmFsdWVzKSB7XG4gICAgcmV0dXJuIE9iamVjdC52YWx1ZXMob2JqKTtcbiAgfSBlbHNlIHtcbiAgICByZXR1cm4gT2JqZWN0LmtleXMob2JqKS5tYXAoayA9PiBvYmpba10pO1xuICB9XG59Il19 |
@@ -1,5 +0,5 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -11,2 +11,3 @@ exports.capitalize = capitalize; | ||
exports.underscore = underscore; | ||
/** | ||
@@ -20,3 +21,3 @@ * Uppercase the first letter of a string, but don't change the remainder. | ||
function capitalize(str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
} | ||
@@ -31,8 +32,10 @@ /** | ||
*/ | ||
function camelize(str) { | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
} | ||
@@ -46,4 +49,6 @@ /** | ||
*/ | ||
function decamelize(str) { | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
} | ||
@@ -57,4 +62,6 @@ /** | ||
*/ | ||
function dasherize(str) { | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
} | ||
@@ -68,5 +75,7 @@ /** | ||
*/ | ||
function underscore(str) { | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ3MuanMiXSwibmFtZXMiOlsic3RyIiwiY2hyIiwibWF0Y2giLCJkZWNhbWVsaXplIl0sIm1hcHBpbmdzIjoiOzs7OztRQU9PLFUsR0FBQSxVO1FBV0EsUSxHQUFBLFE7UUFjQSxVLEdBQUEsVTtRQVVBLFMsR0FBQSxTO1FBVUEsVSxHQUFBLFU7Ozs7Ozs7O0FBN0NBLFNBQUEsVUFBQSxDQUFBLEdBQUEsRUFBeUI7QUFDNUIsV0FBT0EsSUFBQUEsTUFBQUEsQ0FBQUEsQ0FBQUEsRUFBQUEsV0FBQUEsS0FBOEJBLElBQUFBLEtBQUFBLENBQXJDLENBQXFDQ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Q2FzZSgpO1xufVxuLyoqXG4gKiBEYXNoZXJpemUgd29yZHMgdGhhdCBhcmUgdW5kZXJzY29yZWQsIHNwYWNlLWRlbGltaXRlZCwgb3IgY2FtZWxDYXNlZC5cbiAqXG4gKiBAZXhwb3J0XG4gKiBAcGFyYW0ge3N0cmluZ30gc3RyXG4gKiBAcmV0dXJucyB7c3RyaW5nfVxuICovXG5cbmV4cG9ydCBmdW5jdGlvbiBkYXNoZXJpemUoc3RyKSB7XG4gIHJldHVybiBkZWNhbWVsaXplKHN0cikucmVwbGFjZSgvWyBfXS9nLCAnLScpO1xufVxuLyoqXG4gKiBVbmRlcnNjb3JlIHdvcmRzIHRoYXQgYXJlIGRhc2hlcml6ZWQsIHNwYWNlLWRlbGltaXRlZCwgb3IgY2FtZWxDYXNlZC5cbiAqXG4gKiBAZXhwb3J0XG4gKiBAcGFyYW0ge3N0cmluZ30gc3RyXG4gKiBAcmV0dXJucyB7c3RyaW5nfVxuICovXG5cbmV4cG9ydCBmdW5jdGlvbiB1bmRlcnNjb3JlKHN0cikge1xuICByZXR1cm4gc3RyLnJlcGxhY2UoLyhbYS16XFxkXSkoW0EtWl0rKS9nLCAnJDFfJDInKS5yZXBsYWNlKC9cXC18XFxzKy9nLCAnXycpLnRvTG93ZXJDYXNlKCk7XG59Il19 |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -7,2 +7,3 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.uuid = uuid; | ||
/** | ||
@@ -15,2 +16,3 @@ * Fast UUID generator, RFC4122 version 4 compliant. | ||
var lut = []; | ||
for (var i = 0; i < 256; i++) { | ||
@@ -26,2 +28,4 @@ lut[i] = (i < 16 ? '0' : '') + i.toString(16); | ||
*/ | ||
function uuid() { | ||
@@ -34,2 +38,2 @@ var d0 = Math.random() * 0xffffffff | 0; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpb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IGx1dFtkMSAmIDB4ZmZdICsgbHV0W2QxID4+IDggJiAweGZmXSArICctJyArIGx1dFtkMSA+PiAxNiAmIDB4MGYgfCAweDQwXSArIGx1dFtkMSA+PiAyNCAmIDB4ZmZdICsgJy0nICsgbHV0W2QyICYgMHgzZiB8IDB4ODBdICsgbHV0W2QyID4+IDggJiAweGZmXSArICctJyArIGx1dFtkMiA+PiAxNiAmIDB4ZmZdICsgbHV0W2QyID4+IDI0ICYgMHhmZl0gKyBsdXRbZDMgJiAweGZmXSArIGx1dFtkMyA+PiA4ICYgMHhmZl0gKyBsdXRbZDMgPj4gMTYgJiAweGZmXSArIGx1dFtkMyA+PiAyNCAmIDB4ZmZdO1xufSJdfQ== |
@@ -12,10 +12,12 @@ /** | ||
export function every(array, predicate) { | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
@@ -32,11 +34,14 @@ /** | ||
*/ | ||
export function some(array, predicate) { | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
@@ -52,11 +57,14 @@ /** | ||
*/ | ||
export function firstResult(array, valueFn) { | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
let result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
let index = -1; | ||
let length = array.length; | ||
while (++index < length) { | ||
let result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
} | ||
} |
/* eslint-disable eqeqeq, no-eq-null, valid-jsdoc */ | ||
/** | ||
@@ -17,60 +18,73 @@ * `eq` checks the equality of two objects. | ||
export function eq(a, b) { | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
} // A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
return false; | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
return false; | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
// A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
return true; | ||
} |
/* eslint-disable valid-jsdoc */ | ||
/** | ||
@@ -13,33 +14,40 @@ * Clones a value. If the value is an object, a deeply nested clone will be | ||
export function clone(obj) { | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
} | ||
let dup; | ||
let type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (let i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} | ||
let dup; | ||
let type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (let i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} else { | ||
let val; | ||
dup = {}; | ||
for (let key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
} else { | ||
let val; | ||
dup = {}; | ||
for (let key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
return dup; | ||
} | ||
return dup; | ||
} | ||
@@ -55,18 +63,21 @@ /** | ||
*/ | ||
export function expose(destination, source) { | ||
let properties; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
let properties; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
} else { | ||
properties = Object.keys(source); | ||
} | ||
properties.forEach(p => { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
properties = Object.keys(source); | ||
destination[p] = source[p]; | ||
} | ||
properties.forEach(p => { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
destination[p] = source[p]; | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -81,11 +92,12 @@ /** | ||
*/ | ||
export function extend(destination, ...sources) { | ||
sources.forEach(source => { | ||
for (let p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
}); | ||
return destination; | ||
sources.forEach(source => { | ||
for (let p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
}); | ||
return destination; | ||
} | ||
@@ -99,4 +111,5 @@ /** | ||
*/ | ||
export function isArray(obj) { | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
} | ||
@@ -110,8 +123,9 @@ /** | ||
*/ | ||
export function toArray(obj) { | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
} | ||
@@ -125,4 +139,5 @@ /** | ||
*/ | ||
export function isObject(obj) { | ||
return obj !== null && typeof obj === 'object'; | ||
return obj !== null && typeof obj === 'object'; | ||
} | ||
@@ -136,4 +151,5 @@ /** | ||
*/ | ||
export function isNone(obj) { | ||
return obj === undefined || obj === null; | ||
return obj === undefined || obj === null; | ||
} | ||
@@ -150,14 +166,16 @@ /** | ||
*/ | ||
export function merge(object, ...sources) { | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -176,17 +194,19 @@ /** | ||
*/ | ||
export function deepMerge(object, ...sources) { | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let a = object[field]; | ||
let b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
sources.forEach(source => { | ||
Object.keys(source).forEach(field => { | ||
if (source.hasOwnProperty(field)) { | ||
let a = object[field]; | ||
let b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -203,12 +223,16 @@ /** | ||
*/ | ||
export function deepGet(obj, path) { | ||
let index = -1; | ||
let result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
let index = -1; | ||
let result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
return result; | ||
} | ||
return result; | ||
} | ||
@@ -230,19 +254,24 @@ /** | ||
*/ | ||
export function deepSet(obj, path, value) { | ||
let ptr = obj; | ||
let prop = path.pop(); | ||
let segment; | ||
for (let i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
ptr = ptr[segment]; | ||
let ptr = obj; | ||
let prop = path.pop(); | ||
let segment; | ||
for (let i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
ptr = ptr[segment]; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
} | ||
@@ -258,8 +287,9 @@ /** | ||
*/ | ||
export function objectValues(obj) { | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(k => obj[k]); | ||
} | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(k => obj[k]); | ||
} | ||
} |
@@ -9,3 +9,3 @@ /** | ||
export function capitalize(str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
} | ||
@@ -20,8 +20,9 @@ /** | ||
*/ | ||
export function camelize(str) { | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
} | ||
@@ -35,4 +36,5 @@ /** | ||
*/ | ||
export function decamelize(str) { | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
} | ||
@@ -46,4 +48,5 @@ /** | ||
*/ | ||
export function dasherize(str) { | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
} | ||
@@ -57,4 +60,5 @@ /** | ||
*/ | ||
export function underscore(str) { | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
} |
@@ -8,2 +8,3 @@ /** | ||
const lut = []; | ||
for (let i = 0; i < 256; i++) { | ||
@@ -19,2 +20,4 @@ lut[i] = (i < 16 ? '0' : '') + i.toString(16); | ||
*/ | ||
export function uuid() { | ||
@@ -21,0 +24,0 @@ let d0 = Math.random() * 0xffffffff | 0; |
@@ -12,10 +12,12 @@ /** | ||
export function every(array, predicate) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (!predicate(array[index], index)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
@@ -32,11 +34,14 @@ /** | ||
*/ | ||
export function some(array, predicate) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
if (predicate(array[index], index)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
@@ -52,12 +57,15 @@ /** | ||
*/ | ||
export function firstResult(array, valueFn) { | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
var result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
var index = -1; | ||
var length = array.length; | ||
while (++index < length) { | ||
var result = valueFn(array[index], index); | ||
if (result) { | ||
return result; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFycmF5cy5qcyJdLCJuYW1lcyI6WyJldmVyeSIsImFycmF5IiwicHJlZGljYXRlIiwiaW5kZXgiLCJsZW5ndGgiLCJzb21lIiwiZmlyc3RSZXN1bHQiLCJ2YWx1ZUZuIiwicmVzdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7OztBQVVBLE9BQU8sU0FBU0EsS0FBVCxDQUFlQyxLQUFmLEVBQXNCQyxTQUF0QixFQUFpQztBQUNwQyxRQUFJQyxRQUFRLENBQUMsQ0FBYjtBQUNB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B2YWx1ZSBmdW5jdGlvbiByYXRoZXIgdGhhbiBhbiBpdGVtIG9mIHRoZSBhcnJheS5cbiAqXG4gKiBAZXhwb3J0XG4gKiBAcGFyYW0ge2FueVtdfSBhcnJheVxuICogQHBhcmFtIHsobWVtYmVyOiBhbnksIGluZGV4OiBudW1iZXIpID0+IGFueX0gdmFsdWVGblxuICogQHJldHVybnMgeyp9IHRoZSBmaXJzdCByZXN1bHQgb2YgYHZhbHVlRm5gIHRoYXQgcmV0dXJuZWQgdHJ1ZSBvciB1bmRlZmluZWRcbiAqL1xuXG5leHBvcnQgZnVuY3Rpb24gZmlyc3RSZXN1bHQoYXJyYXksIHZhbHVlRm4pIHtcbiAgbGV0IGluZGV4ID0gLTE7XG4gIGxldCBsZW5ndGggPSBhcnJheS5sZW5ndGg7XG5cbiAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICBsZXQgcmVzdWx0ID0gdmFsdWVGbihhcnJheVtpbmRleF0sIGluZGV4KTtcblxuICAgIGlmIChyZXN1bHQpIHtcbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuICB9XG59Il19 |
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJkaWN0LmpzIiwic291cmNlc0NvbnRlbnQiOltdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbXX0= |
/* eslint-disable eqeqeq, no-eq-null, valid-jsdoc */ | ||
/** | ||
@@ -17,61 +18,74 @@ * `eq` checks the equality of two objects. | ||
export function eq(a, b) { | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
// Some elements of this function come from underscore | ||
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// | ||
// https://github.com/jashkenas/underscore/blob/master/underscore.js | ||
// Identical objects are equal. `0 === -0`, but they aren't identical. | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
} // A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
return false; | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
return false; | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
// A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
switch (type) { | ||
case '[object String]': | ||
return a == String(b); | ||
case '[object Number]': | ||
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for | ||
// other numeric values. | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
case '[object Boolean]': | ||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their | ||
// millisecond representations. Note that invalid dates with millisecond representations | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
// RegExps are compared by their source patterns and flags. | ||
case '[object RegExp]': | ||
return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
} | ||
var i; | ||
for (i in b) { | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
for (i in a) { | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVxLmpzIl0sIm5hbWVzIjpbImVxIiwiYSIsImIiLCJ0eXBlIiwiT2JqZWN0IiwicHJvdG90eXBlIiwidG9TdHJpbmciLCJjYWxsIiwiU3RyaW5nIiwic291cmNlIiwiZ2xvYmFsIiwibXVsdGlsaW5lIiwiaWdub3JlQ2FzZSIsImxlbmd0aCIsImkiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTs7Ozs7Ozs7Ozs7Ozs7QUFjQ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8gbWlsbGlzZWNvbmQgcmVwcmVzZW50YXRpb25zLiBOb3RlIHRoYXQgaW52YWxpZCBkYXRlcyB3aXRoIG1pbGxpc2Vjb25kIHJlcHJlc2VudGF0aW9uc1xuICAgICAgICAgICAgLy8gb2YgYE5hTmAgYXJlIG5vdCBlcXVpdmFsZW50LlxuICAgICAgICAgICAgcmV0dXJuICthID09ICtiO1xuICAgICAgICAvLyBSZWdFeHBzIGFyZSBjb21wYXJlZCBieSB0aGVpciBzb3VyY2UgcGF0dGVybnMgYW5kIGZsYWdzLlxuICAgICAgICBjYXNlICdbb2JqZWN0IFJlZ0V4cF0nOlxuICAgICAgICAgICAgcmV0dXJuIGEuc291cmNlID09IGIuc291cmNlICYmIGEuZ2xvYmFsID09IGIuZ2xvYmFsICYmIGEubXVsdGlsaW5lID09IGIubXVsdGlsaW5lICYmIGEuaWdub3JlQ2FzZSA9PSBiLmlnbm9yZUNhc2U7XG4gICAgfVxuICAgIGlmICh0eXBlb2YgYSAhPSAnb2JqZWN0JyB8fCB0eXBlb2YgYiAhPSAnb2JqZWN0Jykge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIGlmICh0eXBlID09PSAnW29iamVjdCBBcnJheV0nKSB7XG4gICAgICAgIGlmIChhLmxlbmd0aCAhPT0gYi5sZW5ndGgpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cbiAgICB2YXIgaTtcbiAgICBmb3IgKGkgaW4gYikge1xuICAgICAgICBpZiAoYi5oYXNPd25Qcm9wZXJ0eShpKSkge1xuICAgICAgICAgICAgaWYgKCFlcShhW2ldLCBiW2ldKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBmb3IgKGkgaW4gYSkge1xuICAgICAgICBpZiAoYS5oYXNPd25Qcm9wZXJ0eShpKSkge1xuICAgICAgICAgICAgaWYgKC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mUgPT0gYi5tdWx0aWxpbmUgJiYgYS5pZ25vcmVDYXNlID09IGIuaWdub3JlQ2FzZTtcbiAgfVxuXG4gIGlmICh0eXBlb2YgYSAhPSAnb2JqZWN0JyB8fCB0eXBlb2YgYiAhPSAnb2JqZWN0Jykge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIGlmICh0eXBlID09PSAnW29iamVjdCBBcnJheV0nKSB7XG4gICAgaWYgKGEubGVuZ3RoICE9PSBiLmxlbmd0aCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHZhciBpO1xuXG4gIGZvciAoaSBpbiBiKSB7XG4gICAgaWYgKGIuaGFzT3duUHJvcGVydHkoaSkpIHtcbiAgICAgIGlmICghZXEoYVtpXSwgYltpXSkpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIGZvciAoaSBpbiBhKSB7XG4gICAgaWYgKGEuaGFzT3duUHJvcGVydHkoaSkpIHtcbiAgICAgIGlmICghZXEoYVtpXSwgYltpXSkpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufSJdfQ== |
@@ -6,2 +6,2 @@ export * from './arrays'; | ||
export * from './uuid'; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsVUFBZDtBQUNBLGNBQWMsTUFBZDtBQUNBLGNBQWMsV0FBZDtBQUNBLGNBQWMsV0FBZDtBQUNBLGNBQWMsUUFBZCIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vYXJyYXlzJztcbmV4cG9ydCAqIGZyb20gJy4vZXEnO1xuZXhwb3J0ICogZnJvbSAnLi9vYmplY3RzJztcbmV4cG9ydCAqIGZyb20gJy4vc3RyaW5ncyc7XG5leHBvcnQgKiBmcm9tICcuL3V1aWQnOyJdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsVUFBZDtBQUNBLGNBQWMsTUFBZDtBQUNBLGNBQWMsV0FBZDtBQUNBLGNBQWMsV0FBZDtBQUNBLGNBQWMsUUFBZCIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vYXJyYXlzJztcbmV4cG9ydCAqIGZyb20gJy4vZXEnO1xuZXhwb3J0ICogZnJvbSAnLi9vYmplY3RzJztcbmV4cG9ydCAqIGZyb20gJy4vc3RyaW5ncyc7XG5leHBvcnQgKiBmcm9tICcuL3V1aWQnOyJdfQ== |
/* eslint-disable valid-jsdoc */ | ||
/** | ||
@@ -13,33 +14,40 @@ * Clones a value. If the value is an object, a deeply nested clone will be | ||
export function clone(obj) { | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
} | ||
var dup; | ||
var type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (var i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} | ||
var dup = void 0; | ||
var type = Object.prototype.toString.call(obj); | ||
if (type === '[object Date]') { | ||
dup = new Date(); | ||
dup.setTime(obj.getTime()); | ||
} else if (type === '[object RegExp]') { | ||
dup = obj.constructor(obj); | ||
} else if (type === '[object Array]') { | ||
dup = []; | ||
for (var i = 0, len = obj.length; i < len; i++) { | ||
if (obj.hasOwnProperty(i)) { | ||
dup.push(clone(obj[i])); | ||
} | ||
} else { | ||
var val; | ||
dup = {}; | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
} else { | ||
var val = void 0; | ||
dup = {}; | ||
for (var key in obj) { | ||
if (obj.hasOwnProperty(key)) { | ||
val = obj[key]; | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
dup[key] = val; | ||
} | ||
} | ||
return dup; | ||
} | ||
return dup; | ||
} | ||
@@ -55,18 +63,21 @@ /** | ||
*/ | ||
export function expose(destination, source) { | ||
var properties = void 0; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
var properties; | ||
if (arguments.length > 2) { | ||
properties = Array.prototype.slice.call(arguments, 2); | ||
} else { | ||
properties = Object.keys(source); | ||
} | ||
properties.forEach(function (p) { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
properties = Object.keys(source); | ||
destination[p] = source[p]; | ||
} | ||
properties.forEach(function (p) { | ||
if (typeof source[p] === 'function') { | ||
destination[p] = function () { | ||
return source[p].apply(source, arguments); | ||
}; | ||
} else { | ||
destination[p] = source[p]; | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -81,15 +92,16 @@ /** | ||
*/ | ||
export function extend(destination) { | ||
for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
sources[_key - 1] = arguments[_key]; | ||
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
sources[_key - 1] = arguments[_key]; | ||
} | ||
sources.forEach(function (source) { | ||
for (var p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
sources.forEach(function (source) { | ||
for (var p in source) { | ||
if (source.hasOwnProperty(p)) { | ||
destination[p] = source[p]; | ||
} | ||
} | ||
}); | ||
return destination; | ||
}); | ||
return destination; | ||
} | ||
@@ -103,4 +115,5 @@ /** | ||
*/ | ||
export function isArray(obj) { | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
return Object.prototype.toString.call(obj) === '[object Array]'; | ||
} | ||
@@ -114,8 +127,9 @@ /** | ||
*/ | ||
export function toArray(obj) { | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
if (isNone(obj)) { | ||
return []; | ||
} else { | ||
return isArray(obj) ? obj : [obj]; | ||
} | ||
} | ||
@@ -129,4 +143,5 @@ /** | ||
*/ | ||
export function isObject(obj) { | ||
return obj !== null && typeof obj === 'object'; | ||
return obj !== null && typeof obj === 'object'; | ||
} | ||
@@ -140,4 +155,5 @@ /** | ||
*/ | ||
export function isNone(obj) { | ||
return obj === undefined || obj === null; | ||
return obj === undefined || obj === null; | ||
} | ||
@@ -154,18 +170,20 @@ /** | ||
*/ | ||
export function merge(object) { | ||
for (var _len2 = arguments.length, sources = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
sources[_key2 - 1] = arguments[_key2]; | ||
} | ||
for (var _len2 = arguments.length, sources = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
sources[_key2 - 1] = arguments[_key2]; | ||
} | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var value = source[field]; | ||
if (value !== undefined) { | ||
object[field] = clone(value); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -184,21 +202,23 @@ /** | ||
*/ | ||
export function deepMerge(object) { | ||
for (var _len3 = arguments.length, sources = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
sources[_key3 - 1] = arguments[_key3]; | ||
} | ||
for (var _len3 = arguments.length, sources = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { | ||
sources[_key3 - 1] = arguments[_key3]; | ||
} | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var a = object[field]; | ||
var b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
sources.forEach(function (source) { | ||
Object.keys(source).forEach(function (field) { | ||
if (source.hasOwnProperty(field)) { | ||
var a = object[field]; | ||
var b = source[field]; | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
} else if (b !== undefined) { | ||
object[field] = clone(b); | ||
} | ||
} | ||
}); | ||
return object; | ||
}); | ||
return object; | ||
} | ||
@@ -215,12 +235,16 @@ /** | ||
*/ | ||
export function deepGet(obj, path) { | ||
var index = -1; | ||
var result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
var index = -1; | ||
var result = obj; | ||
while (++index < path.length) { | ||
result = result[path[index]]; | ||
if (!result) { | ||
return result; | ||
} | ||
return result; | ||
} | ||
return result; | ||
} | ||
@@ -242,19 +266,24 @@ /** | ||
*/ | ||
export function deepSet(obj, path, value) { | ||
var ptr = obj; | ||
var prop = path.pop(); | ||
var segment = void 0; | ||
for (var i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
ptr = ptr[segment]; | ||
var ptr = obj; | ||
var prop = path.pop(); | ||
var segment; | ||
for (var i = 0, l = path.length; i < l; i++) { | ||
segment = path[i]; | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
ptr = ptr[segment]; | ||
} | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop] = value; | ||
return true; | ||
} | ||
} | ||
@@ -270,11 +299,12 @@ /** | ||
*/ | ||
export function objectValues(obj) { | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(function (k) { | ||
return obj[k]; | ||
}); | ||
} | ||
if (Object.values) { | ||
return Object.values(obj); | ||
} else { | ||
return Object.keys(obj).map(function (k) { | ||
return obj[k]; | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9iamVjdHMuanMiXSwibmFtZXMiOlsiY2xvbmUiLCJvYmoiLCJ1bmRlZmluZWQiLCJkdXAiLCJ0eXBlIiwiT2JqZWN0IiwicHJvdG90eXBlIiwidG9TdHJpbmciLCJjYWxsIiwiRGF0ZSIsInNldFRpbWUiLCJnZXRUaW1lIiwiY29uc3RydWN0b3IiLCJpIiwibGVuIiwibGVuZ3RoIiwiaGFzT3duUHJvcGVydHkiLCJwdXNoIiwidmFsIiwia2V5IiwiZXhwb3NlIiwiZGVzdGluYXRpb24iLCJzb3VyY2UiLCJwcm9wZXJ0aWVzIiwiYXJndW1lbnRzIiwiQXJyYXkiLCJzbGljZSIsImtleXMiLCJmb3JFYWNoIiwicCIsImFwcGx5IiwiZXh0ZW5kIiwic291cmNlcyIsImlzQXJyYXkiLCJ0b0FycmF5IiwiaXNOb25lIiwiaXNPYmplY3QiLCJtZXJn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gICAgICAgIGxldCB2YWw7XG4gICAgICAgIGR1cCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBrZXkgaW4gb2JqKSB7XG4gICAgICAgICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgICB2YWwgPSBvYmpba2V5XTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsID0gY2xvbmUodmFsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZHVwW2tleV0gPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGR1cDtcbn1cbi8qKlxuICogRXhwb3NlIHByb3BlcnRpZXMgYW5kIG1ldGhvZHMgZnJvbSBvbmUgb2JqZWN0IG9uIGFub3RoZXIuXG4gKlxuICogTWV0aG9kcyB3aWxsIGJlIGNhbGxlZCBvbiBgc291cmNlYCBhbmQgd2lsbCBtYWludGFpbiBgc291cmNlYCBhcyB0aGUgY29udGV4dC5cbiAqXG4gKiBAZXhwb3J0XG4gKiBAcGFyYW0geyp9IGRlc3RpbmF0aW9uXG4gKiBAcGFyYW0geyp9IHNvdXJjZVxuICovXG5leHBvcnQgZnVuY3Rpb24gZXhwb3NlKGRlc3RpbmF0aW9uLCBzb3VyY2UpIHtcbiAgICBsZXQgcHJvcGVydGllcztcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA+IDIpIHtcbiAgICAgICAgcHJvcGVydGllcyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMik7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcHJvcGVydGllcyA9IE9iamVjdC5rZXlzKHNvdXJjZSk7XG4gICAgfVxuICAgIHByb3BlcnRpZXMuZm9yRWFjaChwID0+IHtcbiAgICAgICAgaWYgKHR5cGVvZiBzb3VyY2Vbc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YXRoLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICBzZWdtZW50ID0gcGF0aFtpXTtcbiAgICAgICAgaWYgKHB0cltzZWdtZW50XSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBwdHJbc2VnbWVudF0gPSB0eXBlb2Ygc2VnbWVudCA9PT0gJ251bWJlcicgPyBbXSA6IHt9O1xuICAgICAgICB9XG4gICAgICAgIHB0ciA9IHB0cltzZWdtZW50XTtcbiAgICB9XG4gICAgaWYgKHB0cltwcm9wXSA9PT0gdmFsdWUpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHB0cltwcm9wXSA9IHZhbHVlO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG59XG4vKipcbiAqIEZpbmQgYW4gYXJyYXkgb2YgdmFsdWVzIHRoYXQgY29ycmVzcG9uZCB0byB0aGUga2V5cyBvZiBhbiBvYmplY3QuXG4gKlxuICogVGhpcyBpcyBhIHBvbnlmaWxsIGZvciBgT2JqZWN0LnZhbHVlc2AsIHdoaWNoIGlzIHN0aWxsIGV4cGVyaW1lbnRhbC5cbiAqXG4gKiBAZXhwb3J0XG4gKiBAcGFyYW0geyp9IG9ialxuICogQHJldHVybnMge2FueVtdfVxuICovXG5leHBvcnQgZnVuY3Rpb24gb2JqZWN0VmFsdWVzKG9iaikge1xuICAgIGlmIChPYmplY3QudmFsdWVzKSB7XG4gICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzKG9iaik7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKG9iaikubWFwKGsgPT4gb2JqW2tdKTtcbiAgICB9XG59Il19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9iamVjdHMuanMiXSwibmFtZXMiOlsiY2xvbmUiLCJvYmoiLCJ1bmRlZmluZWQiLCJ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JqLCBwYXRoLCB2YWx1ZSkge1xuICBsZXQgcHRyID0gb2JqO1xuICBsZXQgcHJvcCA9IHBhdGgucG9wKCk7XG4gIGxldCBzZWdtZW50O1xuXG4gIGZvciAobGV0IGkgPSAwLCBsID0gcGF0aC5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICBzZWdtZW50ID0gcGF0aFtpXTtcblxuICAgIGlmIChwdHJbc2VnbWVudF0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgcHRyW3NlZ21lbnRdID0gdHlwZW9mIHNlZ21lbnQgPT09ICdudW1iZXInID8gW10gOiB7fTtcbiAgICB9XG5cbiAgICBwdHIgPSBwdHJbc2VnbWVudF07XG4gIH1cblxuICBpZiAocHRyW3Byb3BdID09PSB2YWx1ZSkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfSBlbHNlIHtcbiAgICBwdHJbcHJvcF0gPSB2YWx1ZTtcbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxufVxuLyoqXG4gKiBGaW5kIGFuIGFycmF5IG9mIHZhbHVlcyB0aGF0IGNvcnJlc3BvbmQgdG8gdGhlIGtleXMgb2YgYW4gb2JqZWN0LlxuICpcbiAqIFRoaXMgaXMgYSBwb255ZmlsbCBmb3IgYE9iamVjdC52YWx1ZXNgLCB3aGljaCBpcyBzdGlsbCBleHBlcmltZW50YWwuXG4gKlxuICogQGV4cG9ydFxuICogQHBhcmFtIHsqfSBvYmpcbiAqIEByZXR1cm5zIHthbnlbXX1cbiAqL1xuXG5leHBvcnQgZnVuY3Rpb24gb2JqZWN0VmFsdWVzKG9iaikge1xuICBpZiAoT2JqZWN0LnZhbHVlcykge1xuICAgIHJldHVybiBPYmplY3QudmFsdWVzKG9iaik7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIE9iamVjdC5rZXlzKG9iaikubWFwKGsgPT4gb2JqW2tdKTtcbiAgfVxufSJdfQ== |
@@ -9,3 +9,3 @@ /** | ||
export function capitalize(str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
} | ||
@@ -20,8 +20,9 @@ /** | ||
*/ | ||
export function camelize(str) { | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
return str.replace(/(\-|\_|\.|\s)+(.)?/g, function (match, separator, chr) { | ||
return chr ? chr.toUpperCase() : ''; | ||
}).replace(/(^|\/)([A-Z])/g, function (match) { | ||
return match.toLowerCase(); | ||
}); | ||
} | ||
@@ -35,4 +36,5 @@ /** | ||
*/ | ||
export function decamelize(str) { | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
} | ||
@@ -46,4 +48,5 @@ /** | ||
*/ | ||
export function dasherize(str) { | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
return decamelize(str).replace(/[ _]/g, '-'); | ||
} | ||
@@ -57,5 +60,6 @@ /** | ||
*/ | ||
export function underscore(str) { | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/\-|\s+/g, '_').toLowerCase(); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ3MuanMiXSwibmFtZXMiOlsiY2FwaXRhbGl6ZSIsInN0ciIsImNoYXJBdCIsInRvVXBwZXJDYXNlIiwic2xpY2UiLCJjYW1lbGl6ZSIsInJlcGxhY2UiLCJtYXRjaCIsInNlcGFyYXRvciIsImNociIsInRvTG93ZXJDYXNlIiwiZGVjYW1lbGl6ZSIsImRhc2hlcml6ZSIsInVuZGVyc2NvcmUiXSwibWFwcGluZ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FtBLVpdKykvZywgJyQxXyQyJykucmVwbGFjZSgvXFwtfFxccysvZywgJ18nKS50b0xvd2VyQ2FzZSgpO1xufSJdfQ== |
@@ -8,2 +8,3 @@ /** | ||
var lut = []; | ||
for (var i = 0; i < 256; i++) { | ||
@@ -19,2 +20,4 @@ lut[i] = (i < 16 ? '0' : '') + i.toString(16); | ||
*/ | ||
export function uuid() { | ||
@@ -27,2 +30,2 @@ var d0 = Math.random() * 0xffffffff | 0; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInV1aWQuanMiXSwibmFtZXMiOlsibHV0IiwiaSIsInRvU3RyaW5nIiwidXVpZCIsImQwIiwiTWF0aCIsInJhbmRvbSIsImQxIiwiZDIiLCJkMyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztBQU1BLElBQU1BLE1BQU0sRUFBWjtBQUNBLEtBQUssSUFBSUMsSUFBSSxDQUFiLEVBQWdCQSxJQUFJLEdBQXBCLEVBQXlCQSxHQUF6QixFQUE4QjtBQUM1QkQsTUFBSUMsQ0FBSixJQUFTLENBQUNBLElBQUksRUFBSixHQUFTLEdBQVQsR0FBZSxFQUFoQixJQUFzQkEsRUFBRUMsUUFBRixDQUFXLEVBQVgsQ0FBL0I7QUFDRDtBQUNEOzs7Ozs7O0FBT0EsT0FBTyxTQUFTQyxJQUFULEdBQWdCO0FBQ3JCLE1BQUlDLEtBQUtDLEtBQUtDLE1BQUwsS0FBZ0IsVUFBaEIsR0FBNkIsQ0FBdEM7QUFDQSxNQUFJQyxLQUFLRixLQUFLQyxNQUFMLEtBQWdCLFVBQWhCLEdBQTZCLENBQXRDO0FBQ0EsTUFBSUUsS0FBS0gsS0FBS0MsTUFBTCxLQUFnQixVQUFoQixHQUE2QixDQUF0QztBQUNBLE1BQUlHLEtBQUtKLEtBQUtDLE1BQUwsS0FBZ0IsVUFBaEIsR0FBNkIsQ0FBdEM7QUFDQSxTQUFPT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gPj4gOCAmIDB4ZmZdICsgbHV0W2QwID4+IDE2ICYgMHhmZl0gKyBsdXRbZDAgPj4gMjQgJiAweGZmXSArICctJyArIGx1dFtkMSAmIDB4ZmZdICsgbHV0W2QxID4+IDggJiAweGZmXSArICctJyArIGx1dFtkMSA+PiAxNiAmIDB4MGYgfCAweDQwXSArIGx1dFtkMSA+PiAyNCAmIDB4ZmZdICsgJy0nICsgbHV0W2QyICYgMHgzZiB8IDB4ODBdICsgbHV0W2QyID4+IDggJiAweGZmXSArICctJyArIGx1dFtkMiA+PiAxNiAmIDB4ZmZdICsgbHV0W2QyID4+IDI0ICYgMHhmZl0gKyBsdXRbZDMgJiAweGZmXSArIGx1dFtkMyA+PiA4ICYgMHhmZl0gKyBsdXRbZDMgPj4gMTYgJiAweGZmXSArIGx1dFtkMyA+PiAyNCAmIDB4ZmZdO1xufSJdfQ== |
{ | ||
"name": "@orbit/utils", | ||
"version": "0.16.0-beta.7", | ||
"version": "0.16.0-beta.8", | ||
"description": "Core utilities for Orbit.", | ||
@@ -25,8 +25,15 @@ "contributors": [ | ||
"prepublishOnly": "yarn run clean", | ||
"test": "testem ci" | ||
"test": "testem ci", | ||
"lint:ts": "eslint . --ext .ts" | ||
}, | ||
"devDependencies": { | ||
"@glimmer/build": "^0.10.1" | ||
"@glimmer/build": "^0.10.1", | ||
"@typescript-eslint/eslint-plugin": "^1.9.0", | ||
"@typescript-eslint/parser": "^1.9.0", | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.3.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"prettier": "^1.17.1" | ||
}, | ||
"gitHead": "a1552f89362339db40a3747a05462e776bd950ed" | ||
"gitHead": "b60da815be53ffc4fc0a29dddfa5dd15a8c1b875" | ||
} |
@@ -5,10 +5,13 @@ /** | ||
* predicate is true for every item in the array. | ||
* | ||
* | ||
* @export | ||
* @param {any[]} array | ||
* @param {(member: any, index: number) => boolean} predicate | ||
* @returns {boolean} | ||
* @param {any[]} array | ||
* @param {(member: any, index: number) => boolean} predicate | ||
* @returns {boolean} | ||
*/ | ||
export function every(array: any[], predicate: (member: any, index: number) => boolean): boolean { | ||
let index: number = -1; | ||
export function every( | ||
array: any[], | ||
predicate: (member: any, index: number) => boolean | ||
): boolean { | ||
let index = -1; | ||
let length: number = array.length; | ||
@@ -29,10 +32,13 @@ | ||
* for any of the items in the array. | ||
* | ||
* | ||
* @export | ||
* @param {any[]} array | ||
* @param {(member: any, index: number) => boolean} predicate | ||
* @returns {boolean} | ||
* @param {any[]} array | ||
* @param {(member: any, index: number) => boolean} predicate | ||
* @returns {boolean} | ||
*/ | ||
export function some(array: any[], predicate: (member: any, index: number) => boolean): boolean { | ||
let index: number = -1; | ||
export function some( | ||
array: any[], | ||
predicate: (member: any, index: number) => boolean | ||
): boolean { | ||
let index = -1; | ||
let length: number = array.length; | ||
@@ -52,10 +58,13 @@ | ||
* of calling the value function rather than an item of the array. | ||
* | ||
* | ||
* @export | ||
* @param {any[]} array | ||
* @param {(member: any, index: number) => any} valueFn | ||
* @param {any[]} array | ||
* @param {(member: any, index: number) => any} valueFn | ||
* @returns {*} the first result of `valueFn` that returned true or undefined | ||
*/ | ||
export function firstResult(array: any[], valueFn: (member: any, index: number) => any): any { | ||
let index: number = -1; | ||
export function firstResult( | ||
array: any[], | ||
valueFn: (member: any, index: number) => any | ||
): any { | ||
let index = -1; | ||
let length: number = array.length; | ||
@@ -62,0 +71,0 @@ |
/** | ||
* A simple dictionary interface. | ||
* | ||
* | ||
* @export | ||
* @interface Dict | ||
* @template T | ||
* @template T | ||
*/ | ||
@@ -8,0 +8,0 @@ export interface Dict<T> { |
@@ -11,6 +11,6 @@ /* eslint-disable eqeqeq, no-eq-null, valid-jsdoc */ | ||
* arrays | ||
* | ||
* | ||
* @export | ||
* @param {*} a | ||
* @param {*} b | ||
* @param {*} a | ||
* @param {*} b | ||
* @returns {boolean} are `a` and `b` equal? | ||
@@ -26,8 +26,14 @@ */ | ||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
if (a === b) { return a !== 0 || 1 / a == 1 / b; } | ||
if (a === b) { | ||
return a !== 0 || 1 / a == 1 / b; | ||
} | ||
// A strict comparison is necessary because `null == undefined`. | ||
if (a == null || b == null) { return a === b; } | ||
if (a == null || b == null) { | ||
return a === b; | ||
} | ||
var type = Object.prototype.toString.call(a); | ||
if (type !== Object.prototype.toString.call(b)) { return false; } | ||
if (type !== Object.prototype.toString.call(b)) { | ||
return false; | ||
} | ||
@@ -40,3 +46,3 @@ switch (type) { | ||
// other numeric values. | ||
return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); | ||
return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; | ||
case '[object Date]': | ||
@@ -50,11 +56,17 @@ case '[object Boolean]': | ||
case '[object RegExp]': | ||
return a.source == b.source && | ||
a.global == b.global && | ||
a.multiline == b.multiline && | ||
a.ignoreCase == b.ignoreCase; | ||
return ( | ||
a.source == b.source && | ||
a.global == b.global && | ||
a.multiline == b.multiline && | ||
a.ignoreCase == b.ignoreCase | ||
); | ||
} | ||
if (typeof a != 'object' || typeof b != 'object') { return false; } | ||
if (typeof a != 'object' || typeof b != 'object') { | ||
return false; | ||
} | ||
if (type === '[object Array]') { | ||
if (a.length !== b.length) { return false; } | ||
if (a.length !== b.length) { | ||
return false; | ||
} | ||
} | ||
@@ -65,3 +77,5 @@ | ||
if (b.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { return false; } | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
@@ -71,3 +85,5 @@ } | ||
if (a.hasOwnProperty(i)) { | ||
if (!eq(a[i], b[i])) { return false; } | ||
if (!eq(a[i], b[i])) { | ||
return false; | ||
} | ||
} | ||
@@ -74,0 +90,0 @@ } |
@@ -14,3 +14,5 @@ /* eslint-disable valid-jsdoc */ | ||
export function clone(obj: any): any { | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { return obj; } | ||
if (obj === undefined || obj === null || typeof obj !== 'object') { | ||
return obj; | ||
} | ||
@@ -39,3 +41,5 @@ let dup: any; | ||
val = obj[key]; | ||
if (typeof val === 'object') { val = clone(val); } | ||
if (typeof val === 'object') { | ||
val = clone(val); | ||
} | ||
dup[key] = val; | ||
@@ -185,4 +189,3 @@ } | ||
let b = source[field]; | ||
if (isObject(a) && isObject(b) && | ||
!isArray(a) && !isArray(b)) { | ||
if (isObject(a) && isObject(b) && !isArray(a) && !isArray(b)) { | ||
deepMerge(a, b); | ||
@@ -239,3 +242,3 @@ } else if (b !== undefined) { | ||
let ptr = obj; | ||
let prop = path.pop(); | ||
let prop = path.pop() as string; | ||
let segment; | ||
@@ -245,10 +248,10 @@ for (let i = 0, l = path.length; i < l; i++) { | ||
if (ptr[segment] === undefined) { | ||
ptr[segment] = (typeof segment === 'number') ? [] : {}; | ||
ptr[segment] = typeof segment === 'number' ? [] : {}; | ||
} | ||
ptr = ptr[segment]; | ||
} | ||
if (ptr[prop!] === value) { | ||
if (ptr[prop] === value) { | ||
return false; | ||
} else { | ||
ptr[prop!] = value; | ||
ptr[prop] = value; | ||
return true; | ||
@@ -255,0 +258,0 @@ } |
/** | ||
* Uppercase the first letter of a string, but don't change the remainder. | ||
* | ||
* | ||
* @export | ||
* @param {string} str | ||
* @returns {string} | ||
* @param {string} str | ||
* @returns {string} | ||
*/ | ||
@@ -32,11 +32,9 @@ export function capitalize(str: string): string { | ||
* Converts a camelized string into all lowercase separated by underscores. | ||
* | ||
* | ||
* @export | ||
* @param {string} str | ||
* @returns {string} | ||
* @param {string} str | ||
* @returns {string} | ||
*/ | ||
export function decamelize(str: string): string { | ||
return str | ||
.replace(/([a-z\d])([A-Z])/g, '$1_$2') | ||
.toLowerCase(); | ||
return str.replace(/([a-z\d])([A-Z])/g, '$1_$2').toLowerCase(); | ||
} | ||
@@ -46,6 +44,6 @@ | ||
* Dasherize words that are underscored, space-delimited, or camelCased. | ||
* | ||
* | ||
* @export | ||
* @param {string} str | ||
* @returns {string} | ||
* @param {string} str | ||
* @returns {string} | ||
*/ | ||
@@ -58,6 +56,6 @@ export function dasherize(str: string): string { | ||
* Underscore words that are dasherized, space-delimited, or camelCased. | ||
* | ||
* | ||
* @export | ||
* @param {string} str | ||
* @returns {string} | ||
* @param {string} str | ||
* @returns {string} | ||
*/ | ||
@@ -64,0 +62,0 @@ export function underscore(str: string): string { |
@@ -11,3 +11,3 @@ /** | ||
for (let i = 0; i < 256; i++) { | ||
lut[i] = (i < 16 ? '0' : '') + (i).toString(16); | ||
lut[i] = (i < 16 ? '0' : '') + i.toString(16); | ||
} | ||
@@ -23,11 +23,29 @@ | ||
export function uuid(): string { | ||
let d0 = Math.random() * 0xffffffff | 0; | ||
let d1 = Math.random() * 0xffffffff | 0; | ||
let d2 = Math.random() * 0xffffffff | 0; | ||
let d3 = Math.random() * 0xffffffff | 0; | ||
let d0 = (Math.random() * 0xffffffff) | 0; | ||
let d1 = (Math.random() * 0xffffffff) | 0; | ||
let d2 = (Math.random() * 0xffffffff) | 0; | ||
let d3 = (Math.random() * 0xffffffff) | 0; | ||
return lut[d0 & 0xff] + lut[d0 >> 8 & 0xff] + lut[d0 >> 16 & 0xff] + lut[d0 >> 24 & 0xff] + '-' + | ||
lut[d1 & 0xff] + lut[d1 >> 8 & 0xff] + '-' + lut[d1 >> 16 & 0x0f | 0x40] + lut[d1 >> 24 & 0xff] + '-' + | ||
lut[d2 & 0x3f | 0x80] + lut[d2 >> 8 & 0xff] + '-' + lut[d2 >> 16 & 0xff] + lut[d2 >> 24 & 0xff] + | ||
lut[d3 & 0xff] + lut[d3 >> 8 & 0xff] + lut[d3 >> 16 & 0xff] + lut[d3 >> 24 & 0xff]; | ||
return ( | ||
lut[d0 & 0xff] + | ||
lut[(d0 >> 8) & 0xff] + | ||
lut[(d0 >> 16) & 0xff] + | ||
lut[(d0 >> 24) & 0xff] + | ||
'-' + | ||
lut[d1 & 0xff] + | ||
lut[(d1 >> 8) & 0xff] + | ||
'-' + | ||
lut[((d1 >> 16) & 0x0f) | 0x40] + | ||
lut[(d1 >> 24) & 0xff] + | ||
'-' + | ||
lut[(d2 & 0x3f) | 0x80] + | ||
lut[(d2 >> 8) & 0xff] + | ||
'-' + | ||
lut[(d2 >> 16) & 0xff] + | ||
lut[(d2 >> 24) & 0xff] + | ||
lut[d3 & 0xff] + | ||
lut[(d3 >> 8) & 0xff] + | ||
lut[(d3 >> 16) & 0xff] + | ||
lut[(d3 >> 24) & 0xff] | ||
); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51
3417
193337
7