made with requirebin
Created
October 18, 2016 11:05
-
-
Save sallar/89296d4deaacbe60d112987f0f5c096f to your computer and use it in GitHub Desktop.
requirebin sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { normalize, Schema, arrayOf } = require('normalizr'); | |
const { v4 } = require('uuid'); | |
const group = new Schema('groups'); | |
const groups = arrayOf(group); | |
group.define({ | |
children: groups | |
}); | |
const structure = [ | |
{ | |
id: v4(), | |
title: "Test 1", | |
children: [ | |
{ | |
id: v4(), | |
title: "Child 1", | |
children: [ | |
{ | |
id: v4(), | |
title: "Sub Child 1", | |
children: [] | |
} | |
] | |
}, | |
{ | |
id: v4(), | |
title: "Child 2", | |
children: [] | |
}, | |
{ | |
id: v4(), | |
title: "Child 3", | |
children: [] | |
} | |
] | |
}, | |
{ | |
id: v4(), | |
title: "Test 2", | |
children: [] | |
} | |
]; | |
document.querySelector('pre').innerHTML = JSON.stringify( | |
normalize(structure, groups), | |
undefined, | |
2 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(function(){ | |
;require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
(function (global){ | |
var rng; | |
var crypto = global.crypto || global.msCrypto; // for IE 11 | |
if (crypto && crypto.getRandomValues) { | |
// WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto | |
// Moderately fast, high quality | |
var _rnds8 = new Uint8Array(16); | |
rng = function whatwgRNG() { | |
crypto.getRandomValues(_rnds8); | |
return _rnds8; | |
}; | |
} | |
if (!rng) { | |
// Math.random()-based (RNG) | |
// | |
// If all else fails, use Math.random(). It's fast, but is of unspecified | |
// quality. | |
var _rnds = new Array(16); | |
rng = function() { | |
for (var i = 0, r; i < 16; i++) { | |
if ((i & 0x03) === 0) r = Math.random() * 0x100000000; | |
_rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; | |
} | |
return _rnds; | |
}; | |
} | |
module.exports = rng; | |
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJuZy1icm93c2VyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIlxudmFyIHJuZztcblxudmFyIGNyeXB0byA9IGdsb2JhbC5jcnlwdG8gfHwgZ2xvYmFsLm1zQ3J5cHRvOyAvLyBmb3IgSUUgMTFcbmlmIChjcnlwdG8gJiYgY3J5cHRvLmdldFJhbmRvbVZhbHVlcykge1xuICAvLyBXSEFUV0cgY3J5cHRvLWJhc2VkIFJORyAtIGh0dHA6Ly93aWtpLndoYXR3Zy5vcmcvd2lraS9DcnlwdG9cbiAgLy8gTW9kZXJhdGVseSBmYXN0LCBoaWdoIHF1YWxpdHlcbiAgdmFyIF9ybmRzOCA9IG5ldyBVaW50OEFycmF5KDE2KTtcbiAgcm5nID0gZnVuY3Rpb24gd2hhdHdnUk5HKCkge1xuICAgIGNyeXB0by5nZXRSYW5kb21WYWx1ZXMoX3JuZHM4KTtcbiAgICByZXR1cm4gX3JuZHM4O1xuICB9O1xufVxuXG5pZiAoIXJuZykge1xuICAvLyBNYXRoLnJhbmRvbSgpLWJhc2VkIChSTkcpXG4gIC8vXG4gIC8vIElmIGFsbCBlbHNlIGZhaWxzLCB1c2UgTWF0aC5yYW5kb20oKS4gIEl0J3MgZmFzdCwgYnV0IGlzIG9mIHVuc3BlY2lmaWVkXG4gIC8vIHF1YWxpdHkuXG4gIHZhciAgX3JuZHMgPSBuZXcgQXJyYXkoMTYpO1xuICBybmcgPSBmdW5jdGlvbigpIHtcbiAgICBmb3IgKHZhciBpID0gMCwgcjsgaSA8IDE2OyBpKyspIHtcbiAgICAgIGlmICgoaSAmIDB4MDMpID09PSAwKSByID0gTWF0aC5yYW5kb20oKSAqIDB4MTAwMDAwMDAwO1xuICAgICAgX3JuZHNbaV0gPSByID4+PiAoKGkgJiAweDAzKSA8PCAzKSAmIDB4ZmY7XG4gICAgfVxuXG4gICAgcmV0dXJuIF9ybmRzO1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHJuZztcblxuIl19 | |
},{}],"uuid":[function(require,module,exports){ | |
// uuid.js | |
// | |
// Copyright (c) 2010-2012 Robert Kieffer | |
// MIT License - http://opensource.org/licenses/mit-license.php | |
// Unique ID creation requires a high quality random # generator. We feature | |
// detect to determine the best RNG source, normalizing to a function that | |
// returns 128-bits of randomness, since that's what's usually required | |
var _rng = require('./rng'); | |
// Maps for number <-> hex string conversion | |
var _byteToHex = []; | |
var _hexToByte = {}; | |
for (var i = 0; i < 256; i++) { | |
_byteToHex[i] = (i + 0x100).toString(16).substr(1); | |
_hexToByte[_byteToHex[i]] = i; | |
} | |
// **`parse()` - Parse a UUID into it's component bytes** | |
function parse(s, buf, offset) { | |
var i = (buf && offset) || 0, ii = 0; | |
buf = buf || []; | |
s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { | |
if (ii < 16) { // Don't overflow! | |
buf[i + ii++] = _hexToByte[oct]; | |
} | |
}); | |
// Zero out remaining bytes if string was short | |
while (ii < 16) { | |
buf[i + ii++] = 0; | |
} | |
return buf; | |
} | |
// **`unparse()` - Convert UUID byte array (ala parse()) into a string** | |
function unparse(buf, offset) { | |
var i = offset || 0, bth = _byteToHex; | |
return bth[buf[i++]] + bth[buf[i++]] + | |
bth[buf[i++]] + bth[buf[i++]] + '-' + | |
bth[buf[i++]] + bth[buf[i++]] + '-' + | |
bth[buf[i++]] + bth[buf[i++]] + '-' + | |
bth[buf[i++]] + bth[buf[i++]] + '-' + | |
bth[buf[i++]] + bth[buf[i++]] + | |
bth[buf[i++]] + bth[buf[i++]] + | |
bth[buf[i++]] + bth[buf[i++]]; | |
} | |
// **`v1()` - Generate time-based UUID** | |
// | |
// Inspired by https://github.com/LiosK/UUID.js | |
// and http://docs.python.org/library/uuid.html | |
// random #'s we need to init node and clockseq | |
var _seedBytes = _rng(); | |
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) | |
var _nodeId = [ | |
_seedBytes[0] | 0x01, | |
_seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] | |
]; | |
// Per 4.2.2, randomize (14 bit) clockseq | |
var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; | |
// Previous uuid creation time | |
var _lastMSecs = 0, _lastNSecs = 0; | |
// See https://github.com/broofa/node-uuid for API details | |
function v1(options, buf, offset) { | |
var i = buf && offset || 0; | |
var b = buf || []; | |
options = options || {}; | |
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; | |
// UUID timestamps are 100 nano-second units since the Gregorian epoch, | |
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so | |
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' | |
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. | |
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); | |
// Per 4.2.1.2, use count of uuid's generated during the current clock | |
// cycle to simulate higher resolution clock | |
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; | |
// Time since last uuid creation (in msecs) | |
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; | |
// Per 4.2.1.2, Bump clockseq on clock regression | |
if (dt < 0 && options.clockseq === undefined) { | |
clockseq = clockseq + 1 & 0x3fff; | |
} | |
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new | |
// time interval | |
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { | |
nsecs = 0; | |
} | |
// Per 4.2.1.2 Throw error if too many uuids are requested | |
if (nsecs >= 10000) { | |
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); | |
} | |
_lastMSecs = msecs; | |
_lastNSecs = nsecs; | |
_clockseq = clockseq; | |
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch | |
msecs += 12219292800000; | |
// `time_low` | |
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; | |
b[i++] = tl >>> 24 & 0xff; | |
b[i++] = tl >>> 16 & 0xff; | |
b[i++] = tl >>> 8 & 0xff; | |
b[i++] = tl & 0xff; | |
// `time_mid` | |
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; | |
b[i++] = tmh >>> 8 & 0xff; | |
b[i++] = tmh & 0xff; | |
// `time_high_and_version` | |
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version | |
b[i++] = tmh >>> 16 & 0xff; | |
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) | |
b[i++] = clockseq >>> 8 | 0x80; | |
// `clock_seq_low` | |
b[i++] = clockseq & 0xff; | |
// `node` | |
var node = options.node || _nodeId; | |
for (var n = 0; n < 6; n++) { | |
b[i + n] = node[n]; | |
} | |
return buf ? buf : unparse(b); | |
} | |
// **`v4()` - Generate random UUID** | |
// See https://github.com/broofa/node-uuid for API details | |
function v4(options, buf, offset) { | |
// Deprecated - 'format' argument, as supported in v1.2 | |
var i = buf && offset || 0; | |
if (typeof(options) == 'string') { | |
buf = options == 'binary' ? new Array(16) : null; | |
options = null; | |
} | |
options = options || {}; | |
var rnds = options.random || (options.rng || _rng)(); | |
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved` | |
rnds[6] = (rnds[6] & 0x0f) | 0x40; | |
rnds[8] = (rnds[8] & 0x3f) | 0x80; | |
// Copy bytes to buffer, if provided | |
if (buf) { | |
for (var ii = 0; ii < 16; ii++) { | |
buf[i + ii] = rnds[ii]; | |
} | |
} | |
return buf || unparse(rnds); | |
} | |
// Export public API | |
var uuid = v4; | |
uuid.v1 = v1; | |
uuid.v4 = v4; | |
uuid.parse = parse; | |
uuid.unparse = unparse; | |
module.exports = uuid; | |
},{"./rng":1}]},{},[]) | |
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2hvbWUvYWRtaW4vYnJvd3NlcmlmeS1jZG4vbm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL2Jyb3dzZXItcGFjay9fcHJlbHVkZS5qcyIsInJuZy1icm93c2VyLmpzIiwidXVpZC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUNuQ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gIG9wdGlvbnMgPSBudWxsO1xuICB9XG4gIG9wdGlvbnMgPSBvcHRpb25zIHx8IHt9O1xuXG4gIHZhciBybmRzID0gb3B0aW9ucy5yYW5kb20gfHwgKG9wdGlvbnMucm5nIHx8IF9ybmcpKCk7XG5cbiAgLy8gUGVyIDQuNCwgc2V0IGJpdHMgZm9yIHZlcnNpb24gYW5kIGBjbG9ja19zZXFfaGlfYW5kX3Jlc2VydmVkYFxuICBybmRzWzZdID0gKHJuZHNbNl0gJiAweDBmKSB8IDB4NDA7XG4gIHJuZHNbOF0gPSAocm5kc1s4XSAmIDB4M2YpIHwgMHg4MDtcblxuICAvLyBDb3B5IGJ5dGVzIHRvIGJ1ZmZlciwgaWYgcHJvdmlkZWRcbiAgaWYgKGJ1Zikge1xuICAgIGZvciAodmFyIGlpID0gMDsgaWkgPCAxNjsgaWkrKykge1xuICAgICAgYnVmW2kgKyBpaV0gPSBybmRzW2lpXTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gYnVmIHx8IHVucGFyc2Uocm5kcyk7XG59XG5cbi8vIEV4cG9ydCBwdWJsaWMgQVBJXG52YXIgdXVpZCA9IHY0O1xudXVpZC52MSA9IHYxO1xudXVpZC52NCA9IHY0O1xudXVpZC5wYXJzZSA9IHBhcnNlO1xudXVpZC51bnBhcnNlID0gdW5wYXJzZTtcblxubW9kdWxlLmV4cG9ydHMgPSB1dWlkO1xuIl19 | |
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
'use strict'; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
var EntitySchema = function () { | |
function EntitySchema(key) { | |
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | |
_classCallCheck(this, EntitySchema); | |
if (!key || typeof key !== 'string') { | |
throw new Error('A string non-empty key is required'); | |
} | |
this._key = key; | |
this._assignEntity = options.assignEntity; | |
var idAttribute = options.idAttribute || 'id'; | |
this._getId = typeof idAttribute === 'function' ? idAttribute : function (x) { | |
return x[idAttribute]; | |
}; | |
this._idAttribute = idAttribute; | |
this._meta = options.meta; | |
this._defaults = options.defaults; | |
} | |
_createClass(EntitySchema, [{ | |
key: 'getAssignEntity', | |
value: function getAssignEntity() { | |
return this._assignEntity; | |
} | |
}, { | |
key: 'getKey', | |
value: function getKey() { | |
return this._key; | |
} | |
}, { | |
key: 'getId', | |
value: function getId(entity) { | |
return this._getId(entity); | |
} | |
}, { | |
key: 'getIdAttribute', | |
value: function getIdAttribute() { | |
return this._idAttribute; | |
} | |
}, { | |
key: 'getMeta', | |
value: function getMeta(prop) { | |
if (!prop || typeof prop !== 'string') { | |
throw new Error('A string non-empty property name is required'); | |
} | |
return this._meta && this._meta[prop]; | |
} | |
}, { | |
key: 'getDefaults', | |
value: function getDefaults() { | |
return this._defaults; | |
} | |
}, { | |
key: 'define', | |
value: function define(nestedSchema) { | |
for (var key in nestedSchema) { | |
if (nestedSchema.hasOwnProperty(key)) { | |
this[key] = nestedSchema[key]; | |
} | |
} | |
} | |
}]); | |
return EntitySchema; | |
}(); | |
exports.default = EntitySchema; | |
},{}],2:[function(require,module,exports){ | |
'use strict'; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | |
var _isObject = require('lodash/isObject'); | |
var _isObject2 = _interopRequireDefault(_isObject); | |
var _UnionSchema = require('./UnionSchema'); | |
var _UnionSchema2 = _interopRequireDefault(_UnionSchema); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
var ArraySchema = function () { | |
function ArraySchema(itemSchema) { | |
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | |
_classCallCheck(this, ArraySchema); | |
if (!(0, _isObject2.default)(itemSchema)) { | |
throw new Error('ArraySchema requires item schema to be an object.'); | |
} | |
if (options.schemaAttribute) { | |
var schemaAttribute = options.schemaAttribute; | |
this._itemSchema = new _UnionSchema2.default(itemSchema, { schemaAttribute: schemaAttribute }); | |
} else { | |
this._itemSchema = itemSchema; | |
} | |
} | |
_createClass(ArraySchema, [{ | |
key: 'getItemSchema', | |
value: function getItemSchema() { | |
return this._itemSchema; | |
} | |
}]); | |
return ArraySchema; | |
}(); | |
exports.default = ArraySchema; | |
},{"./UnionSchema":3,"lodash/isObject":80}],3:[function(require,module,exports){ | |
'use strict'; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | |
var _isObject = require('lodash/isObject'); | |
var _isObject2 = _interopRequireDefault(_isObject); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
var UnionSchema = function () { | |
function UnionSchema(itemSchema, options) { | |
_classCallCheck(this, UnionSchema); | |
if (!(0, _isObject2.default)(itemSchema)) { | |
throw new Error('UnionSchema requires item schema to be an object.'); | |
} | |
if (!options || !options.schemaAttribute) { | |
throw new Error('UnionSchema requires schemaAttribute option.'); | |
} | |
this._itemSchema = itemSchema; | |
var schemaAttribute = options.schemaAttribute; | |
this._getSchema = typeof schemaAttribute === 'function' ? schemaAttribute : function (x) { | |
return x[schemaAttribute]; | |
}; | |
} | |
_createClass(UnionSchema, [{ | |
key: 'getItemSchema', | |
value: function getItemSchema() { | |
return this._itemSchema; | |
} | |
}, { | |
key: 'getSchemaKey', | |
value: function getSchemaKey(item) { | |
return this._getSchema(item); | |
} | |
}]); | |
return UnionSchema; | |
}(); | |
exports.default = UnionSchema; | |
},{"lodash/isObject":80}],4:[function(require,module,exports){ | |
var getNative = require('./_getNative'), | |
root = require('./_root'); | |
/* Built-in method references that are verified to be native. */ | |
var DataView = getNative(root, 'DataView'); | |
module.exports = DataView; | |
},{"./_getNative":35,"./_root":62}],5:[function(require,module,exports){ | |
var hashClear = require('./_hashClear'), | |
hashDelete = require('./_hashDelete'), | |
hashGet = require('./_hashGet'), | |
hashHas = require('./_hashHas'), | |
hashSet = require('./_hashSet'); | |
/** | |
* Creates a hash object. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [entries] The key-value pairs to cache. | |
*/ | |
function Hash(entries) { | |
var index = -1, | |
length = entries ? entries.length : 0; | |
this.clear(); | |
while (++index < length) { | |
var entry = entries[index]; | |
this.set(entry[0], entry[1]); | |
} | |
} | |
// Add methods to `Hash`. | |
Hash.prototype.clear = hashClear; | |
Hash.prototype['delete'] = hashDelete; | |
Hash.prototype.get = hashGet; | |
Hash.prototype.has = hashHas; | |
Hash.prototype.set = hashSet; | |
module.exports = Hash; | |
},{"./_hashClear":38,"./_hashDelete":39,"./_hashGet":40,"./_hashHas":41,"./_hashSet":42}],6:[function(require,module,exports){ | |
var listCacheClear = require('./_listCacheClear'), | |
listCacheDelete = require('./_listCacheDelete'), | |
listCacheGet = require('./_listCacheGet'), | |
listCacheHas = require('./_listCacheHas'), | |
listCacheSet = require('./_listCacheSet'); | |
/** | |
* Creates an list cache object. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [entries] The key-value pairs to cache. | |
*/ | |
function ListCache(entries) { | |
var index = -1, | |
length = entries ? entries.length : 0; | |
this.clear(); | |
while (++index < length) { | |
var entry = entries[index]; | |
this.set(entry[0], entry[1]); | |
} | |
} | |
// Add methods to `ListCache`. | |
ListCache.prototype.clear = listCacheClear; | |
ListCache.prototype['delete'] = listCacheDelete; | |
ListCache.prototype.get = listCacheGet; | |
ListCache.prototype.has = listCacheHas; | |
ListCache.prototype.set = listCacheSet; | |
module.exports = ListCache; | |
},{"./_listCacheClear":47,"./_listCacheDelete":48,"./_listCacheGet":49,"./_listCacheHas":50,"./_listCacheSet":51}],7:[function(require,module,exports){ | |
var getNative = require('./_getNative'), | |
root = require('./_root'); | |
/* Built-in method references that are verified to be native. */ | |
var Map = getNative(root, 'Map'); | |
module.exports = Map; | |
},{"./_getNative":35,"./_root":62}],8:[function(require,module,exports){ | |
var mapCacheClear = require('./_mapCacheClear'), | |
mapCacheDelete = require('./_mapCacheDelete'), | |
mapCacheGet = require('./_mapCacheGet'), | |
mapCacheHas = require('./_mapCacheHas'), | |
mapCacheSet = require('./_mapCacheSet'); | |
/** | |
* Creates a map cache object to store key-value pairs. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [entries] The key-value pairs to cache. | |
*/ | |
function MapCache(entries) { | |
var index = -1, | |
length = entries ? entries.length : 0; | |
this.clear(); | |
while (++index < length) { | |
var entry = entries[index]; | |
this.set(entry[0], entry[1]); | |
} | |
} | |
// Add methods to `MapCache`. | |
MapCache.prototype.clear = mapCacheClear; | |
MapCache.prototype['delete'] = mapCacheDelete; | |
MapCache.prototype.get = mapCacheGet; | |
MapCache.prototype.has = mapCacheHas; | |
MapCache.prototype.set = mapCacheSet; | |
module.exports = MapCache; | |
},{"./_mapCacheClear":52,"./_mapCacheDelete":53,"./_mapCacheGet":54,"./_mapCacheHas":55,"./_mapCacheSet":56}],9:[function(require,module,exports){ | |
var getNative = require('./_getNative'), | |
root = require('./_root'); | |
/* Built-in method references that are verified to be native. */ | |
var Promise = getNative(root, 'Promise'); | |
module.exports = Promise; | |
},{"./_getNative":35,"./_root":62}],10:[function(require,module,exports){ | |
var getNative = require('./_getNative'), | |
root = require('./_root'); | |
/* Built-in method references that are verified to be native. */ | |
var Set = getNative(root, 'Set'); | |
module.exports = Set; | |
},{"./_getNative":35,"./_root":62}],11:[function(require,module,exports){ | |
var MapCache = require('./_MapCache'), | |
setCacheAdd = require('./_setCacheAdd'), | |
setCacheHas = require('./_setCacheHas'); | |
/** | |
* | |
* Creates an array cache object to store unique values. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [values] The values to cache. | |
*/ | |
function SetCache(values) { | |
var index = -1, | |
length = values ? values.length : 0; | |
this.__data__ = new MapCache; | |
while (++index < length) { | |
this.add(values[index]); | |
} | |
} | |
// Add methods to `SetCache`. | |
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; | |
SetCache.prototype.has = setCacheHas; | |
module.exports = SetCache; | |
},{"./_MapCache":8,"./_setCacheAdd":63,"./_setCacheHas":64}],12:[function(require,module,exports){ | |
var ListCache = require('./_ListCache'), | |
stackClear = require('./_stackClear'), | |
stackDelete = require('./_stackDelete'), | |
stackGet = require('./_stackGet'), | |
stackHas = require('./_stackHas'), | |
stackSet = require('./_stackSet'); | |
/** | |
* Creates a stack cache object to store key-value pairs. | |
* | |
* @private | |
* @constructor | |
* @param {Array} [entries] The key-value pairs to cache. | |
*/ | |
function Stack(entries) { | |
var data = this.__data__ = new ListCache(entries); | |
this.size = data.size; | |
} | |
// Add methods to `Stack`. | |
Stack.prototype.clear = stackClear; | |
Stack.prototype['delete'] = stackDelete; | |
Stack.prototype.get = stackGet; | |
Stack.prototype.has = stackHas; | |
Stack.prototype.set = stackSet; | |
module.exports = Stack; | |
},{"./_ListCache":6,"./_stackClear":66,"./_stackDelete":67,"./_stackGet":68,"./_stackHas":69,"./_stackSet":70}],13:[function(require,module,exports){ | |
var root = require('./_root'); | |
/** Built-in value references. */ | |
var Symbol = root.Symbol; | |
module.exports = Symbol; | |
},{"./_root":62}],14:[function(require,module,exports){ | |
var root = require('./_root'); | |
/** Built-in value references. */ | |
var Uint8Array = root.Uint8Array; | |
module.exports = Uint8Array; | |
},{"./_root":62}],15:[function(require,module,exports){ | |
var getNative = require('./_getNative'), | |
root = require('./_root'); | |
/* Built-in method references that are verified to be native. */ | |
var WeakMap = getNative(root, 'WeakMap'); | |
module.exports = WeakMap; | |
},{"./_getNative":35,"./_root":62}],16:[function(require,module,exports){ | |
var baseTimes = require('./_baseTimes'), | |
isArguments = require('./isArguments'), | |
isArray = require('./isArray'), | |
isBuffer = require('./isBuffer'), | |
isIndex = require('./_isIndex'), | |
isTypedArray = require('./isTypedArray'); | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** | |
* Creates an array of the enumerable property names of the array-like `value`. | |
* | |
* @private | |
* @param {*} value The value to query. | |
* @param {boolean} inherited Specify returning inherited property names. | |
* @returns {Array} Returns the array of property names. | |
*/ | |
function arrayLikeKeys(value, inherited) { | |
var isArr = isArray(value), | |
isArg = !isArr && isArguments(value), | |
isBuff = !isArr && !isArg && isBuffer(value), | |
isType = !isArr && !isArg && !isBuff && isTypedArray(value), | |
skipIndexes = isArr || isArg || isBuff || isType, | |
result = skipIndexes ? baseTimes(value.length, String) : [], | |
length = result.length; | |
for (var key in value) { | |
if ((inherited || hasOwnProperty.call(value, key)) && | |
!(skipIndexes && ( | |
// Safari 9 has enumerable `arguments.length` in strict mode. | |
key == 'length' || | |
// Node.js 0.10 has enumerable non-index properties on buffers. | |
(isBuff && (key == 'offset' || key == 'parent')) || | |
// PhantomJS 2 has enumerable non-index properties on typed arrays. | |
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || | |
// Skip index properties. | |
isIndex(key, length) | |
))) { | |
result.push(key); | |
} | |
} | |
return result; | |
} | |
module.exports = arrayLikeKeys; | |
},{"./_baseTimes":26,"./_isIndex":43,"./isArguments":73,"./isArray":74,"./isBuffer":76,"./isTypedArray":82}],17:[function(require,module,exports){ | |
/** | |
* A specialized version of `_.some` for arrays without support for iteratee | |
* shorthands. | |
* | |
* @private | |
* @param {Array} [array] The array to iterate over. | |
* @param {Function} predicate The function invoked per iteration. | |
* @returns {boolean} Returns `true` if any element passes the predicate check, | |
* else `false`. | |
*/ | |
function arraySome(array, predicate) { | |
var index = -1, | |
length = array ? array.length : 0; | |
while (++index < length) { | |
if (predicate(array[index], index, array)) { | |
return true; | |
} | |
} | |
return false; | |
} | |
module.exports = arraySome; | |
},{}],18:[function(require,module,exports){ | |
var eq = require('./eq'); | |
/** | |
* Gets the index at which the `key` is found in `array` of key-value pairs. | |
* | |
* @private | |
* @param {Array} array The array to inspect. | |
* @param {*} key The key to search for. | |
* @returns {number} Returns the index of the matched value, else `-1`. | |
*/ | |
function assocIndexOf(array, key) { | |
var length = array.length; | |
while (length--) { | |
if (eq(array[length][0], key)) { | |
return length; | |
} | |
} | |
return -1; | |
} | |
module.exports = assocIndexOf; | |
},{"./eq":72}],19:[function(require,module,exports){ | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** | |
* Used to resolve the | |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | |
* of values. | |
*/ | |
var objectToString = objectProto.toString; | |
/** | |
* The base implementation of `getTag`. | |
* | |
* @private | |
* @param {*} value The value to query. | |
* @returns {string} Returns the `toStringTag`. | |
*/ | |
function baseGetTag(value) { | |
return objectToString.call(value); | |
} | |
module.exports = baseGetTag; | |
},{}],20:[function(require,module,exports){ | |
var isObjectLike = require('./isObjectLike'); | |
/** `Object#toString` result references. */ | |
var argsTag = '[object Arguments]'; | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** | |
* Used to resolve the | |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | |
* of values. | |
*/ | |
var objectToString = objectProto.toString; | |
/** | |
* The base implementation of `_.isArguments`. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is an `arguments` object, | |
*/ | |
function baseIsArguments(value) { | |
return isObjectLike(value) && objectToString.call(value) == argsTag; | |
} | |
module.exports = baseIsArguments; | |
},{"./isObjectLike":81}],21:[function(require,module,exports){ | |
var baseIsEqualDeep = require('./_baseIsEqualDeep'), | |
isObject = require('./isObject'), | |
isObjectLike = require('./isObjectLike'); | |
/** | |
* The base implementation of `_.isEqual` which supports partial comparisons | |
* and tracks traversed objects. | |
* | |
* @private | |
* @param {*} value The value to compare. | |
* @param {*} other The other value to compare. | |
* @param {Function} [customizer] The function to customize comparisons. | |
* @param {boolean} [bitmask] The bitmask of comparison flags. | |
* The bitmask may be composed of the following flags: | |
* 1 - Unordered comparison | |
* 2 - Partial comparison | |
* @param {Object} [stack] Tracks traversed `value` and `other` objects. | |
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. | |
*/ | |
function baseIsEqual(value, other, customizer, bitmask, stack) { | |
if (value === other) { | |
return true; | |
} | |
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { | |
return value !== value && other !== other; | |
} | |
return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); | |
} | |
module.exports = baseIsEqual; | |
},{"./_baseIsEqualDeep":22,"./isObject":80,"./isObjectLike":81}],22:[function(require,module,exports){ | |
var Stack = require('./_Stack'), | |
equalArrays = require('./_equalArrays'), | |
equalByTag = require('./_equalByTag'), | |
equalObjects = require('./_equalObjects'), | |
getTag = require('./_getTag'), | |
isArray = require('./isArray'), | |
isBuffer = require('./isBuffer'), | |
isTypedArray = require('./isTypedArray'); | |
/** Used to compose bitmasks for comparison styles. */ | |
var PARTIAL_COMPARE_FLAG = 2; | |
/** `Object#toString` result references. */ | |
var argsTag = '[object Arguments]', | |
arrayTag = '[object Array]', | |
objectTag = '[object Object]'; | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** | |
* A specialized version of `baseIsEqual` for arrays and objects which performs | |
* deep comparisons and tracks traversed objects enabling objects with circular | |
* references to be compared. | |
* | |
* @private | |
* @param {Object} object The object to compare. | |
* @param {Object} other The other object to compare. | |
* @param {Function} equalFunc The function to determine equivalents of values. | |
* @param {Function} [customizer] The function to customize comparisons. | |
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` | |
* for more details. | |
* @param {Object} [stack] Tracks traversed `object` and `other` objects. | |
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | |
*/ | |
function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { | |
var objIsArr = isArray(object), | |
othIsArr = isArray(other), | |
objTag = arrayTag, | |
othTag = arrayTag; | |
if (!objIsArr) { | |
objTag = getTag(object); | |
objTag = objTag == argsTag ? objectTag : objTag; | |
} | |
if (!othIsArr) { | |
othTag = getTag(other); | |
othTag = othTag == argsTag ? objectTag : othTag; | |
} | |
var objIsObj = objTag == objectTag, | |
othIsObj = othTag == objectTag, | |
isSameTag = objTag == othTag; | |
if (isSameTag && isBuffer(object)) { | |
if (!isBuffer(other)) { | |
return false; | |
} | |
objIsArr = true; | |
objIsObj = false; | |
} | |
if (isSameTag && !objIsObj) { | |
stack || (stack = new Stack); | |
return (objIsArr || isTypedArray(object)) | |
? equalArrays(object, other, equalFunc, customizer, bitmask, stack) | |
: equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); | |
} | |
if (!(bitmask & PARTIAL_COMPARE_FLAG)) { | |
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), | |
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); | |
if (objIsWrapped || othIsWrapped) { | |
var objUnwrapped = objIsWrapped ? object.value() : object, | |
othUnwrapped = othIsWrapped ? other.value() : other; | |
stack || (stack = new Stack); | |
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); | |
} | |
} | |
if (!isSameTag) { | |
return false; | |
} | |
stack || (stack = new Stack); | |
return equalObjects(object, other, equalFunc, customizer, bitmask, stack); | |
} | |
module.exports = baseIsEqualDeep; | |
},{"./_Stack":12,"./_equalArrays":30,"./_equalByTag":31,"./_equalObjects":32,"./_getTag":36,"./isArray":74,"./isBuffer":76,"./isTypedArray":82}],23:[function(require,module,exports){ | |
var isFunction = require('./isFunction'), | |
isMasked = require('./_isMasked'), | |
isObject = require('./isObject'), | |
toSource = require('./_toSource'); | |
/** | |
* Used to match `RegExp` | |
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). | |
*/ | |
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; | |
/** Used to detect host constructors (Safari). */ | |
var reIsHostCtor = /^\[object .+?Constructor\]$/; | |
/** Used for built-in method references. */ | |
var funcProto = Function.prototype, | |
objectProto = Object.prototype; | |
/** Used to resolve the decompiled source of functions. */ | |
var funcToString = funcProto.toString; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** Used to detect if a method is native. */ | |
var reIsNative = RegExp('^' + | |
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') | |
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' | |
); | |
/** | |
* The base implementation of `_.isNative` without bad shim checks. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a native function, | |
* else `false`. | |
*/ | |
function baseIsNative(value) { | |
if (!isObject(value) || isMasked(value)) { | |
return false; | |
} | |
var pattern = isFunction(value) ? reIsNative : reIsHostCtor; | |
return pattern.test(toSource(value)); | |
} | |
module.exports = baseIsNative; | |
},{"./_isMasked":45,"./_toSource":71,"./isFunction":78,"./isObject":80}],24:[function(require,module,exports){ | |
var isLength = require('./isLength'), | |
isObjectLike = require('./isObjectLike'); | |
/** `Object#toString` result references. */ | |
var argsTag = '[object Arguments]', | |
arrayTag = '[object Array]', | |
boolTag = '[object Boolean]', | |
dateTag = '[object Date]', | |
errorTag = '[object Error]', | |
funcTag = '[object Function]', | |
mapTag = '[object Map]', | |
numberTag = '[object Number]', | |
objectTag = '[object Object]', | |
regexpTag = '[object RegExp]', | |
setTag = '[object Set]', | |
stringTag = '[object String]', | |
weakMapTag = '[object WeakMap]'; | |
var arrayBufferTag = '[object ArrayBuffer]', | |
dataViewTag = '[object DataView]', | |
float32Tag = '[object Float32Array]', | |
float64Tag = '[object Float64Array]', | |
int8Tag = '[object Int8Array]', | |
int16Tag = '[object Int16Array]', | |
int32Tag = '[object Int32Array]', | |
uint8Tag = '[object Uint8Array]', | |
uint8ClampedTag = '[object Uint8ClampedArray]', | |
uint16Tag = '[object Uint16Array]', | |
uint32Tag = '[object Uint32Array]'; | |
/** Used to identify `toStringTag` values of typed arrays. */ | |
var typedArrayTags = {}; | |
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = | |
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = | |
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = | |
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = | |
typedArrayTags[uint32Tag] = true; | |
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = | |
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = | |
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = | |
typedArrayTags[errorTag] = typedArrayTags[funcTag] = | |
typedArrayTags[mapTag] = typedArrayTags[numberTag] = | |
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = | |
typedArrayTags[setTag] = typedArrayTags[stringTag] = | |
typedArrayTags[weakMapTag] = false; | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** | |
* Used to resolve the | |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | |
* of values. | |
*/ | |
var objectToString = objectProto.toString; | |
/** | |
* The base implementation of `_.isTypedArray` without Node.js optimizations. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`. | |
*/ | |
function baseIsTypedArray(value) { | |
return isObjectLike(value) && | |
isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; | |
} | |
module.exports = baseIsTypedArray; | |
},{"./isLength":79,"./isObjectLike":81}],25:[function(require,module,exports){ | |
var isPrototype = require('./_isPrototype'), | |
nativeKeys = require('./_nativeKeys'); | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** | |
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense. | |
* | |
* @private | |
* @param {Object} object The object to query. | |
* @returns {Array} Returns the array of property names. | |
*/ | |
function baseKeys(object) { | |
if (!isPrototype(object)) { | |
return nativeKeys(object); | |
} | |
var result = []; | |
for (var key in Object(object)) { | |
if (hasOwnProperty.call(object, key) && key != 'constructor') { | |
result.push(key); | |
} | |
} | |
return result; | |
} | |
module.exports = baseKeys; | |
},{"./_isPrototype":46,"./_nativeKeys":59}],26:[function(require,module,exports){ | |
/** | |
* The base implementation of `_.times` without support for iteratee shorthands | |
* or max array length checks. | |
* | |
* @private | |
* @param {number} n The number of times to invoke `iteratee`. | |
* @param {Function} iteratee The function invoked per iteration. | |
* @returns {Array} Returns the array of results. | |
*/ | |
function baseTimes(n, iteratee) { | |
var index = -1, | |
result = Array(n); | |
while (++index < n) { | |
result[index] = iteratee(index); | |
} | |
return result; | |
} | |
module.exports = baseTimes; | |
},{}],27:[function(require,module,exports){ | |
/** | |
* The base implementation of `_.unary` without support for storing metadata. | |
* | |
* @private | |
* @param {Function} func The function to cap arguments for. | |
* @returns {Function} Returns the new capped function. | |
*/ | |
function baseUnary(func) { | |
return function(value) { | |
return func(value); | |
}; | |
} | |
module.exports = baseUnary; | |
},{}],28:[function(require,module,exports){ | |
/** | |
* Checks if a `cache` value for `key` exists. | |
* | |
* @private | |
* @param {Object} cache The cache to query. | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function cacheHas(cache, key) { | |
return cache.has(key); | |
} | |
module.exports = cacheHas; | |
},{}],29:[function(require,module,exports){ | |
var root = require('./_root'); | |
/** Used to detect overreaching core-js shims. */ | |
var coreJsData = root['__core-js_shared__']; | |
module.exports = coreJsData; | |
},{"./_root":62}],30:[function(require,module,exports){ | |
var SetCache = require('./_SetCache'), | |
arraySome = require('./_arraySome'), | |
cacheHas = require('./_cacheHas'); | |
/** Used to compose bitmasks for comparison styles. */ | |
var UNORDERED_COMPARE_FLAG = 1, | |
PARTIAL_COMPARE_FLAG = 2; | |
/** | |
* A specialized version of `baseIsEqualDeep` for arrays with support for | |
* partial deep comparisons. | |
* | |
* @private | |
* @param {Array} array The array to compare. | |
* @param {Array} other The other array to compare. | |
* @param {Function} equalFunc The function to determine equivalents of values. | |
* @param {Function} customizer The function to customize comparisons. | |
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` | |
* for more details. | |
* @param {Object} stack Tracks traversed `array` and `other` objects. | |
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. | |
*/ | |
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { | |
var isPartial = bitmask & PARTIAL_COMPARE_FLAG, | |
arrLength = array.length, | |
othLength = other.length; | |
if (arrLength != othLength && !(isPartial && othLength > arrLength)) { | |
return false; | |
} | |
// Assume cyclic values are equal. | |
var stacked = stack.get(array); | |
if (stacked && stack.get(other)) { | |
return stacked == other; | |
} | |
var index = -1, | |
result = true, | |
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; | |
stack.set(array, other); | |
stack.set(other, array); | |
// Ignore non-index properties. | |
while (++index < arrLength) { | |
var arrValue = array[index], | |
othValue = other[index]; | |
if (customizer) { | |
var compared = isPartial | |
? customizer(othValue, arrValue, index, other, array, stack) | |
: customizer(arrValue, othValue, index, array, other, stack); | |
} | |
if (compared !== undefined) { | |
if (compared) { | |
continue; | |
} | |
result = false; | |
break; | |
} | |
// Recursively compare arrays (susceptible to call stack limits). | |
if (seen) { | |
if (!arraySome(other, function(othValue, othIndex) { | |
if (!cacheHas(seen, othIndex) && | |
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { | |
return seen.push(othIndex); | |
} | |
})) { | |
result = false; | |
break; | |
} | |
} else if (!( | |
arrValue === othValue || | |
equalFunc(arrValue, othValue, customizer, bitmask, stack) | |
)) { | |
result = false; | |
break; | |
} | |
} | |
stack['delete'](array); | |
stack['delete'](other); | |
return result; | |
} | |
module.exports = equalArrays; | |
},{"./_SetCache":11,"./_arraySome":17,"./_cacheHas":28}],31:[function(require,module,exports){ | |
var Symbol = require('./_Symbol'), | |
Uint8Array = require('./_Uint8Array'), | |
eq = require('./eq'), | |
equalArrays = require('./_equalArrays'), | |
mapToArray = require('./_mapToArray'), | |
setToArray = require('./_setToArray'); | |
/** Used to compose bitmasks for comparison styles. */ | |
var UNORDERED_COMPARE_FLAG = 1, | |
PARTIAL_COMPARE_FLAG = 2; | |
/** `Object#toString` result references. */ | |
var boolTag = '[object Boolean]', | |
dateTag = '[object Date]', | |
errorTag = '[object Error]', | |
mapTag = '[object Map]', | |
numberTag = '[object Number]', | |
regexpTag = '[object RegExp]', | |
setTag = '[object Set]', | |
stringTag = '[object String]', | |
symbolTag = '[object Symbol]'; | |
var arrayBufferTag = '[object ArrayBuffer]', | |
dataViewTag = '[object DataView]'; | |
/** Used to convert symbols to primitives and strings. */ | |
var symbolProto = Symbol ? Symbol.prototype : undefined, | |
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; | |
/** | |
* A specialized version of `baseIsEqualDeep` for comparing objects of | |
* the same `toStringTag`. | |
* | |
* **Note:** This function only supports comparing values with tags of | |
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. | |
* | |
* @private | |
* @param {Object} object The object to compare. | |
* @param {Object} other The other object to compare. | |
* @param {string} tag The `toStringTag` of the objects to compare. | |
* @param {Function} equalFunc The function to determine equivalents of values. | |
* @param {Function} customizer The function to customize comparisons. | |
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` | |
* for more details. | |
* @param {Object} stack Tracks traversed `object` and `other` objects. | |
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | |
*/ | |
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { | |
switch (tag) { | |
case dataViewTag: | |
if ((object.byteLength != other.byteLength) || | |
(object.byteOffset != other.byteOffset)) { | |
return false; | |
} | |
object = object.buffer; | |
other = other.buffer; | |
case arrayBufferTag: | |
if ((object.byteLength != other.byteLength) || | |
!equalFunc(new Uint8Array(object), new Uint8Array(other))) { | |
return false; | |
} | |
return true; | |
case boolTag: | |
case dateTag: | |
case numberTag: | |
// Coerce booleans to `1` or `0` and dates to milliseconds. | |
// Invalid dates are coerced to `NaN`. | |
return eq(+object, +other); | |
case errorTag: | |
return object.name == other.name && object.message == other.message; | |
case regexpTag: | |
case stringTag: | |
// Coerce regexes to strings and treat strings, primitives and objects, | |
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring | |
// for more details. | |
return object == (other + ''); | |
case mapTag: | |
var convert = mapToArray; | |
case setTag: | |
var isPartial = bitmask & PARTIAL_COMPARE_FLAG; | |
convert || (convert = setToArray); | |
if (object.size != other.size && !isPartial) { | |
return false; | |
} | |
// Assume cyclic values are equal. | |
var stacked = stack.get(object); | |
if (stacked) { | |
return stacked == other; | |
} | |
bitmask |= UNORDERED_COMPARE_FLAG; | |
// Recursively compare objects (susceptible to call stack limits). | |
stack.set(object, other); | |
var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); | |
stack['delete'](object); | |
return result; | |
case symbolTag: | |
if (symbolValueOf) { | |
return symbolValueOf.call(object) == symbolValueOf.call(other); | |
} | |
} | |
return false; | |
} | |
module.exports = equalByTag; | |
},{"./_Symbol":13,"./_Uint8Array":14,"./_equalArrays":30,"./_mapToArray":57,"./_setToArray":65,"./eq":72}],32:[function(require,module,exports){ | |
var keys = require('./keys'); | |
/** Used to compose bitmasks for comparison styles. */ | |
var PARTIAL_COMPARE_FLAG = 2; | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** | |
* A specialized version of `baseIsEqualDeep` for objects with support for | |
* partial deep comparisons. | |
* | |
* @private | |
* @param {Object} object The object to compare. | |
* @param {Object} other The other object to compare. | |
* @param {Function} equalFunc The function to determine equivalents of values. | |
* @param {Function} customizer The function to customize comparisons. | |
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` | |
* for more details. | |
* @param {Object} stack Tracks traversed `object` and `other` objects. | |
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. | |
*/ | |
function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { | |
var isPartial = bitmask & PARTIAL_COMPARE_FLAG, | |
objProps = keys(object), | |
objLength = objProps.length, | |
othProps = keys(other), | |
othLength = othProps.length; | |
if (objLength != othLength && !isPartial) { | |
return false; | |
} | |
var index = objLength; | |
while (index--) { | |
var key = objProps[index]; | |
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { | |
return false; | |
} | |
} | |
// Assume cyclic values are equal. | |
var stacked = stack.get(object); | |
if (stacked && stack.get(other)) { | |
return stacked == other; | |
} | |
var result = true; | |
stack.set(object, other); | |
stack.set(other, object); | |
var skipCtor = isPartial; | |
while (++index < objLength) { | |
key = objProps[index]; | |
var objValue = object[key], | |
othValue = other[key]; | |
if (customizer) { | |
var compared = isPartial | |
? customizer(othValue, objValue, key, other, object, stack) | |
: customizer(objValue, othValue, key, object, other, stack); | |
} | |
// Recursively compare objects (susceptible to call stack limits). | |
if (!(compared === undefined | |
? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) | |
: compared | |
)) { | |
result = false; | |
break; | |
} | |
skipCtor || (skipCtor = key == 'constructor'); | |
} | |
if (result && !skipCtor) { | |
var objCtor = object.constructor, | |
othCtor = other.constructor; | |
// Non `Object` object instances with different constructors are not equal. | |
if (objCtor != othCtor && | |
('constructor' in object && 'constructor' in other) && | |
!(typeof objCtor == 'function' && objCtor instanceof objCtor && | |
typeof othCtor == 'function' && othCtor instanceof othCtor)) { | |
result = false; | |
} | |
} | |
stack['delete'](object); | |
stack['delete'](other); | |
return result; | |
} | |
module.exports = equalObjects; | |
},{"./keys":83}],33:[function(require,module,exports){ | |
(function (global){ | |
/** Detect free variable `global` from Node.js. */ | |
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; | |
module.exports = freeGlobal; | |
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9sb2Rhc2gvX2ZyZWVHbG9iYWwuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBEZXRlY3QgZnJlZSB2YXJpYWJsZSBgZ2xvYmFsYCBmcm9tIE5vZGUuanMuICovXG52YXIgZnJlZUdsb2JhbCA9IHR5cGVvZiBnbG9iYWwgPT0gJ29iamVjdCcgJiYgZ2xvYmFsICYmIGdsb2JhbC5PYmplY3QgPT09IE9iamVjdCAmJiBnbG9iYWw7XG5cbm1vZHVsZS5leHBvcnRzID0gZnJlZUdsb2JhbDtcbiJdfQ== | |
},{}],34:[function(require,module,exports){ | |
var isKeyable = require('./_isKeyable'); | |
/** | |
* Gets the data for `map`. | |
* | |
* @private | |
* @param {Object} map The map to query. | |
* @param {string} key The reference key. | |
* @returns {*} Returns the map data. | |
*/ | |
function getMapData(map, key) { | |
var data = map.__data__; | |
return isKeyable(key) | |
? data[typeof key == 'string' ? 'string' : 'hash'] | |
: data.map; | |
} | |
module.exports = getMapData; | |
},{"./_isKeyable":44}],35:[function(require,module,exports){ | |
var baseIsNative = require('./_baseIsNative'), | |
getValue = require('./_getValue'); | |
/** | |
* Gets the native function at `key` of `object`. | |
* | |
* @private | |
* @param {Object} object The object to query. | |
* @param {string} key The key of the method to get. | |
* @returns {*} Returns the function if it's native, else `undefined`. | |
*/ | |
function getNative(object, key) { | |
var value = getValue(object, key); | |
return baseIsNative(value) ? value : undefined; | |
} | |
module.exports = getNative; | |
},{"./_baseIsNative":23,"./_getValue":37}],36:[function(require,module,exports){ | |
var DataView = require('./_DataView'), | |
Map = require('./_Map'), | |
Promise = require('./_Promise'), | |
Set = require('./_Set'), | |
WeakMap = require('./_WeakMap'), | |
baseGetTag = require('./_baseGetTag'), | |
toSource = require('./_toSource'); | |
/** `Object#toString` result references. */ | |
var mapTag = '[object Map]', | |
objectTag = '[object Object]', | |
promiseTag = '[object Promise]', | |
setTag = '[object Set]', | |
weakMapTag = '[object WeakMap]'; | |
var dataViewTag = '[object DataView]'; | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** | |
* Used to resolve the | |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | |
* of values. | |
*/ | |
var objectToString = objectProto.toString; | |
/** Used to detect maps, sets, and weakmaps. */ | |
var dataViewCtorString = toSource(DataView), | |
mapCtorString = toSource(Map), | |
promiseCtorString = toSource(Promise), | |
setCtorString = toSource(Set), | |
weakMapCtorString = toSource(WeakMap); | |
/** | |
* Gets the `toStringTag` of `value`. | |
* | |
* @private | |
* @param {*} value The value to query. | |
* @returns {string} Returns the `toStringTag`. | |
*/ | |
var getTag = baseGetTag; | |
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. | |
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || | |
(Map && getTag(new Map) != mapTag) || | |
(Promise && getTag(Promise.resolve()) != promiseTag) || | |
(Set && getTag(new Set) != setTag) || | |
(WeakMap && getTag(new WeakMap) != weakMapTag)) { | |
getTag = function(value) { | |
var result = objectToString.call(value), | |
Ctor = result == objectTag ? value.constructor : undefined, | |
ctorString = Ctor ? toSource(Ctor) : undefined; | |
if (ctorString) { | |
switch (ctorString) { | |
case dataViewCtorString: return dataViewTag; | |
case mapCtorString: return mapTag; | |
case promiseCtorString: return promiseTag; | |
case setCtorString: return setTag; | |
case weakMapCtorString: return weakMapTag; | |
} | |
} | |
return result; | |
}; | |
} | |
module.exports = getTag; | |
},{"./_DataView":4,"./_Map":7,"./_Promise":9,"./_Set":10,"./_WeakMap":15,"./_baseGetTag":19,"./_toSource":71}],37:[function(require,module,exports){ | |
/** | |
* Gets the value at `key` of `object`. | |
* | |
* @private | |
* @param {Object} [object] The object to query. | |
* @param {string} key The key of the property to get. | |
* @returns {*} Returns the property value. | |
*/ | |
function getValue(object, key) { | |
return object == null ? undefined : object[key]; | |
} | |
module.exports = getValue; | |
},{}],38:[function(require,module,exports){ | |
var nativeCreate = require('./_nativeCreate'); | |
/** | |
* Removes all key-value entries from the hash. | |
* | |
* @private | |
* @name clear | |
* @memberOf Hash | |
*/ | |
function hashClear() { | |
this.__data__ = nativeCreate ? nativeCreate(null) : {}; | |
this.size = 0; | |
} | |
module.exports = hashClear; | |
},{"./_nativeCreate":58}],39:[function(require,module,exports){ | |
/** | |
* Removes `key` and its value from the hash. | |
* | |
* @private | |
* @name delete | |
* @memberOf Hash | |
* @param {Object} hash The hash to modify. | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function hashDelete(key) { | |
var result = this.has(key) && delete this.__data__[key]; | |
this.size -= result ? 1 : 0; | |
return result; | |
} | |
module.exports = hashDelete; | |
},{}],40:[function(require,module,exports){ | |
var nativeCreate = require('./_nativeCreate'); | |
/** Used to stand-in for `undefined` hash values. */ | |
var HASH_UNDEFINED = '__lodash_hash_undefined__'; | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** | |
* Gets the hash value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf Hash | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function hashGet(key) { | |
var data = this.__data__; | |
if (nativeCreate) { | |
var result = data[key]; | |
return result === HASH_UNDEFINED ? undefined : result; | |
} | |
return hasOwnProperty.call(data, key) ? data[key] : undefined; | |
} | |
module.exports = hashGet; | |
},{"./_nativeCreate":58}],41:[function(require,module,exports){ | |
var nativeCreate = require('./_nativeCreate'); | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** | |
* Checks if a hash value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf Hash | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function hashHas(key) { | |
var data = this.__data__; | |
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); | |
} | |
module.exports = hashHas; | |
},{"./_nativeCreate":58}],42:[function(require,module,exports){ | |
var nativeCreate = require('./_nativeCreate'); | |
/** Used to stand-in for `undefined` hash values. */ | |
var HASH_UNDEFINED = '__lodash_hash_undefined__'; | |
/** | |
* Sets the hash `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf Hash | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the hash instance. | |
*/ | |
function hashSet(key, value) { | |
var data = this.__data__; | |
this.size += this.has(key) ? 0 : 1; | |
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; | |
return this; | |
} | |
module.exports = hashSet; | |
},{"./_nativeCreate":58}],43:[function(require,module,exports){ | |
/** Used as references for various `Number` constants. */ | |
var MAX_SAFE_INTEGER = 9007199254740991; | |
/** Used to detect unsigned integer values. */ | |
var reIsUint = /^(?:0|[1-9]\d*)$/; | |
/** | |
* Checks if `value` is a valid array-like index. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. | |
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`. | |
*/ | |
function isIndex(value, length) { | |
length = length == null ? MAX_SAFE_INTEGER : length; | |
return !!length && | |
(typeof value == 'number' || reIsUint.test(value)) && | |
(value > -1 && value % 1 == 0 && value < length); | |
} | |
module.exports = isIndex; | |
},{}],44:[function(require,module,exports){ | |
/** | |
* Checks if `value` is suitable for use as unique object key. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is suitable, else `false`. | |
*/ | |
function isKeyable(value) { | |
var type = typeof value; | |
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') | |
? (value !== '__proto__') | |
: (value === null); | |
} | |
module.exports = isKeyable; | |
},{}],45:[function(require,module,exports){ | |
var coreJsData = require('./_coreJsData'); | |
/** Used to detect methods masquerading as native. */ | |
var maskSrcKey = (function() { | |
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); | |
return uid ? ('Symbol(src)_1.' + uid) : ''; | |
}()); | |
/** | |
* Checks if `func` has its source masked. | |
* | |
* @private | |
* @param {Function} func The function to check. | |
* @returns {boolean} Returns `true` if `func` is masked, else `false`. | |
*/ | |
function isMasked(func) { | |
return !!maskSrcKey && (maskSrcKey in func); | |
} | |
module.exports = isMasked; | |
},{"./_coreJsData":29}],46:[function(require,module,exports){ | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** | |
* Checks if `value` is likely a prototype object. | |
* | |
* @private | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`. | |
*/ | |
function isPrototype(value) { | |
var Ctor = value && value.constructor, | |
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; | |
return value === proto; | |
} | |
module.exports = isPrototype; | |
},{}],47:[function(require,module,exports){ | |
/** | |
* Removes all key-value entries from the list cache. | |
* | |
* @private | |
* @name clear | |
* @memberOf ListCache | |
*/ | |
function listCacheClear() { | |
this.__data__ = []; | |
this.size = 0; | |
} | |
module.exports = listCacheClear; | |
},{}],48:[function(require,module,exports){ | |
var assocIndexOf = require('./_assocIndexOf'); | |
/** Used for built-in method references. */ | |
var arrayProto = Array.prototype; | |
/** Built-in value references. */ | |
var splice = arrayProto.splice; | |
/** | |
* Removes `key` and its value from the list cache. | |
* | |
* @private | |
* @name delete | |
* @memberOf ListCache | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function listCacheDelete(key) { | |
var data = this.__data__, | |
index = assocIndexOf(data, key); | |
if (index < 0) { | |
return false; | |
} | |
var lastIndex = data.length - 1; | |
if (index == lastIndex) { | |
data.pop(); | |
} else { | |
splice.call(data, index, 1); | |
} | |
--this.size; | |
return true; | |
} | |
module.exports = listCacheDelete; | |
},{"./_assocIndexOf":18}],49:[function(require,module,exports){ | |
var assocIndexOf = require('./_assocIndexOf'); | |
/** | |
* Gets the list cache value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf ListCache | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function listCacheGet(key) { | |
var data = this.__data__, | |
index = assocIndexOf(data, key); | |
return index < 0 ? undefined : data[index][1]; | |
} | |
module.exports = listCacheGet; | |
},{"./_assocIndexOf":18}],50:[function(require,module,exports){ | |
var assocIndexOf = require('./_assocIndexOf'); | |
/** | |
* Checks if a list cache value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf ListCache | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function listCacheHas(key) { | |
return assocIndexOf(this.__data__, key) > -1; | |
} | |
module.exports = listCacheHas; | |
},{"./_assocIndexOf":18}],51:[function(require,module,exports){ | |
var assocIndexOf = require('./_assocIndexOf'); | |
/** | |
* Sets the list cache `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf ListCache | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the list cache instance. | |
*/ | |
function listCacheSet(key, value) { | |
var data = this.__data__, | |
index = assocIndexOf(data, key); | |
if (index < 0) { | |
++this.size; | |
data.push([key, value]); | |
} else { | |
data[index][1] = value; | |
} | |
return this; | |
} | |
module.exports = listCacheSet; | |
},{"./_assocIndexOf":18}],52:[function(require,module,exports){ | |
var Hash = require('./_Hash'), | |
ListCache = require('./_ListCache'), | |
Map = require('./_Map'); | |
/** | |
* Removes all key-value entries from the map. | |
* | |
* @private | |
* @name clear | |
* @memberOf MapCache | |
*/ | |
function mapCacheClear() { | |
this.size = 0; | |
this.__data__ = { | |
'hash': new Hash, | |
'map': new (Map || ListCache), | |
'string': new Hash | |
}; | |
} | |
module.exports = mapCacheClear; | |
},{"./_Hash":5,"./_ListCache":6,"./_Map":7}],53:[function(require,module,exports){ | |
var getMapData = require('./_getMapData'); | |
/** | |
* Removes `key` and its value from the map. | |
* | |
* @private | |
* @name delete | |
* @memberOf MapCache | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function mapCacheDelete(key) { | |
var result = getMapData(this, key)['delete'](key); | |
this.size -= result ? 1 : 0; | |
return result; | |
} | |
module.exports = mapCacheDelete; | |
},{"./_getMapData":34}],54:[function(require,module,exports){ | |
var getMapData = require('./_getMapData'); | |
/** | |
* Gets the map value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf MapCache | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function mapCacheGet(key) { | |
return getMapData(this, key).get(key); | |
} | |
module.exports = mapCacheGet; | |
},{"./_getMapData":34}],55:[function(require,module,exports){ | |
var getMapData = require('./_getMapData'); | |
/** | |
* Checks if a map value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf MapCache | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function mapCacheHas(key) { | |
return getMapData(this, key).has(key); | |
} | |
module.exports = mapCacheHas; | |
},{"./_getMapData":34}],56:[function(require,module,exports){ | |
var getMapData = require('./_getMapData'); | |
/** | |
* Sets the map `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf MapCache | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the map cache instance. | |
*/ | |
function mapCacheSet(key, value) { | |
var data = getMapData(this, key), | |
size = data.size; | |
data.set(key, value); | |
this.size += data.size == size ? 0 : 1; | |
return this; | |
} | |
module.exports = mapCacheSet; | |
},{"./_getMapData":34}],57:[function(require,module,exports){ | |
/** | |
* Converts `map` to its key-value pairs. | |
* | |
* @private | |
* @param {Object} map The map to convert. | |
* @returns {Array} Returns the key-value pairs. | |
*/ | |
function mapToArray(map) { | |
var index = -1, | |
result = Array(map.size); | |
map.forEach(function(value, key) { | |
result[++index] = [key, value]; | |
}); | |
return result; | |
} | |
module.exports = mapToArray; | |
},{}],58:[function(require,module,exports){ | |
var getNative = require('./_getNative'); | |
/* Built-in method references that are verified to be native. */ | |
var nativeCreate = getNative(Object, 'create'); | |
module.exports = nativeCreate; | |
},{"./_getNative":35}],59:[function(require,module,exports){ | |
var overArg = require('./_overArg'); | |
/* Built-in method references for those with the same name as other `lodash` methods. */ | |
var nativeKeys = overArg(Object.keys, Object); | |
module.exports = nativeKeys; | |
},{"./_overArg":61}],60:[function(require,module,exports){ | |
var freeGlobal = require('./_freeGlobal'); | |
/** Detect free variable `exports`. */ | |
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; | |
/** Detect free variable `module`. */ | |
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; | |
/** Detect the popular CommonJS extension `module.exports`. */ | |
var moduleExports = freeModule && freeModule.exports === freeExports; | |
/** Detect free variable `process` from Node.js. */ | |
var freeProcess = moduleExports && freeGlobal.process; | |
/** Used to access faster Node.js helpers. */ | |
var nodeUtil = (function() { | |
try { | |
return freeProcess && freeProcess.binding('util'); | |
} catch (e) {} | |
}()); | |
module.exports = nodeUtil; | |
},{"./_freeGlobal":33}],61:[function(require,module,exports){ | |
/** | |
* Creates a unary function that invokes `func` with its argument transformed. | |
* | |
* @private | |
* @param {Function} func The function to wrap. | |
* @param {Function} transform The argument transform. | |
* @returns {Function} Returns the new function. | |
*/ | |
function overArg(func, transform) { | |
return function(arg) { | |
return func(transform(arg)); | |
}; | |
} | |
module.exports = overArg; | |
},{}],62:[function(require,module,exports){ | |
var freeGlobal = require('./_freeGlobal'); | |
/** Detect free variable `self`. */ | |
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; | |
/** Used as a reference to the global object. */ | |
var root = freeGlobal || freeSelf || Function('return this')(); | |
module.exports = root; | |
},{"./_freeGlobal":33}],63:[function(require,module,exports){ | |
/** Used to stand-in for `undefined` hash values. */ | |
var HASH_UNDEFINED = '__lodash_hash_undefined__'; | |
/** | |
* Adds `value` to the array cache. | |
* | |
* @private | |
* @name add | |
* @memberOf SetCache | |
* @alias push | |
* @param {*} value The value to cache. | |
* @returns {Object} Returns the cache instance. | |
*/ | |
function setCacheAdd(value) { | |
this.__data__.set(value, HASH_UNDEFINED); | |
return this; | |
} | |
module.exports = setCacheAdd; | |
},{}],64:[function(require,module,exports){ | |
/** | |
* Checks if `value` is in the array cache. | |
* | |
* @private | |
* @name has | |
* @memberOf SetCache | |
* @param {*} value The value to search for. | |
* @returns {number} Returns `true` if `value` is found, else `false`. | |
*/ | |
function setCacheHas(value) { | |
return this.__data__.has(value); | |
} | |
module.exports = setCacheHas; | |
},{}],65:[function(require,module,exports){ | |
/** | |
* Converts `set` to an array of its values. | |
* | |
* @private | |
* @param {Object} set The set to convert. | |
* @returns {Array} Returns the values. | |
*/ | |
function setToArray(set) { | |
var index = -1, | |
result = Array(set.size); | |
set.forEach(function(value) { | |
result[++index] = value; | |
}); | |
return result; | |
} | |
module.exports = setToArray; | |
},{}],66:[function(require,module,exports){ | |
var ListCache = require('./_ListCache'); | |
/** | |
* Removes all key-value entries from the stack. | |
* | |
* @private | |
* @name clear | |
* @memberOf Stack | |
*/ | |
function stackClear() { | |
this.__data__ = new ListCache; | |
this.size = 0; | |
} | |
module.exports = stackClear; | |
},{"./_ListCache":6}],67:[function(require,module,exports){ | |
/** | |
* Removes `key` and its value from the stack. | |
* | |
* @private | |
* @name delete | |
* @memberOf Stack | |
* @param {string} key The key of the value to remove. | |
* @returns {boolean} Returns `true` if the entry was removed, else `false`. | |
*/ | |
function stackDelete(key) { | |
var data = this.__data__, | |
result = data['delete'](key); | |
this.size = data.size; | |
return result; | |
} | |
module.exports = stackDelete; | |
},{}],68:[function(require,module,exports){ | |
/** | |
* Gets the stack value for `key`. | |
* | |
* @private | |
* @name get | |
* @memberOf Stack | |
* @param {string} key The key of the value to get. | |
* @returns {*} Returns the entry value. | |
*/ | |
function stackGet(key) { | |
return this.__data__.get(key); | |
} | |
module.exports = stackGet; | |
},{}],69:[function(require,module,exports){ | |
/** | |
* Checks if a stack value for `key` exists. | |
* | |
* @private | |
* @name has | |
* @memberOf Stack | |
* @param {string} key The key of the entry to check. | |
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | |
*/ | |
function stackHas(key) { | |
return this.__data__.has(key); | |
} | |
module.exports = stackHas; | |
},{}],70:[function(require,module,exports){ | |
var ListCache = require('./_ListCache'), | |
Map = require('./_Map'), | |
MapCache = require('./_MapCache'); | |
/** Used as the size to enable large array optimizations. */ | |
var LARGE_ARRAY_SIZE = 200; | |
/** | |
* Sets the stack `key` to `value`. | |
* | |
* @private | |
* @name set | |
* @memberOf Stack | |
* @param {string} key The key of the value to set. | |
* @param {*} value The value to set. | |
* @returns {Object} Returns the stack cache instance. | |
*/ | |
function stackSet(key, value) { | |
var data = this.__data__; | |
if (data instanceof ListCache) { | |
var pairs = data.__data__; | |
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { | |
pairs.push([key, value]); | |
this.size = ++data.size; | |
return this; | |
} | |
data = this.__data__ = new MapCache(pairs); | |
} | |
data.set(key, value); | |
this.size = data.size; | |
return this; | |
} | |
module.exports = stackSet; | |
},{"./_ListCache":6,"./_Map":7,"./_MapCache":8}],71:[function(require,module,exports){ | |
/** Used for built-in method references. */ | |
var funcProto = Function.prototype; | |
/** Used to resolve the decompiled source of functions. */ | |
var funcToString = funcProto.toString; | |
/** | |
* Converts `func` to its source code. | |
* | |
* @private | |
* @param {Function} func The function to process. | |
* @returns {string} Returns the source code. | |
*/ | |
function toSource(func) { | |
if (func != null) { | |
try { | |
return funcToString.call(func); | |
} catch (e) {} | |
try { | |
return (func + ''); | |
} catch (e) {} | |
} | |
return ''; | |
} | |
module.exports = toSource; | |
},{}],72:[function(require,module,exports){ | |
/** | |
* Performs a | |
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) | |
* comparison between two values to determine if they are equivalent. | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.0.0 | |
* @category Lang | |
* @param {*} value The value to compare. | |
* @param {*} other The other value to compare. | |
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. | |
* @example | |
* | |
* var object = { 'a': 1 }; | |
* var other = { 'a': 1 }; | |
* | |
* _.eq(object, object); | |
* // => true | |
* | |
* _.eq(object, other); | |
* // => false | |
* | |
* _.eq('a', 'a'); | |
* // => true | |
* | |
* _.eq('a', Object('a')); | |
* // => false | |
* | |
* _.eq(NaN, NaN); | |
* // => true | |
*/ | |
function eq(value, other) { | |
return value === other || (value !== value && other !== other); | |
} | |
module.exports = eq; | |
},{}],73:[function(require,module,exports){ | |
var baseIsArguments = require('./_baseIsArguments'), | |
isObjectLike = require('./isObjectLike'); | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** Used to check objects for own properties. */ | |
var hasOwnProperty = objectProto.hasOwnProperty; | |
/** Built-in value references. */ | |
var propertyIsEnumerable = objectProto.propertyIsEnumerable; | |
/** | |
* Checks if `value` is likely an `arguments` object. | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is an `arguments` object, | |
* else `false`. | |
* @example | |
* | |
* _.isArguments(function() { return arguments; }()); | |
* // => true | |
* | |
* _.isArguments([1, 2, 3]); | |
* // => false | |
*/ | |
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { | |
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && | |
!propertyIsEnumerable.call(value, 'callee'); | |
}; | |
module.exports = isArguments; | |
},{"./_baseIsArguments":20,"./isObjectLike":81}],74:[function(require,module,exports){ | |
/** | |
* Checks if `value` is classified as an `Array` object. | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is an array, else `false`. | |
* @example | |
* | |
* _.isArray([1, 2, 3]); | |
* // => true | |
* | |
* _.isArray(document.body.children); | |
* // => false | |
* | |
* _.isArray('abc'); | |
* // => false | |
* | |
* _.isArray(_.noop); | |
* // => false | |
*/ | |
var isArray = Array.isArray; | |
module.exports = isArray; | |
},{}],75:[function(require,module,exports){ | |
var isFunction = require('./isFunction'), | |
isLength = require('./isLength'); | |
/** | |
* Checks if `value` is array-like. A value is considered array-like if it's | |
* not a function and has a `value.length` that's an integer greater than or | |
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.0.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is array-like, else `false`. | |
* @example | |
* | |
* _.isArrayLike([1, 2, 3]); | |
* // => true | |
* | |
* _.isArrayLike(document.body.children); | |
* // => true | |
* | |
* _.isArrayLike('abc'); | |
* // => true | |
* | |
* _.isArrayLike(_.noop); | |
* // => false | |
*/ | |
function isArrayLike(value) { | |
return value != null && isLength(value.length) && !isFunction(value); | |
} | |
module.exports = isArrayLike; | |
},{"./isFunction":78,"./isLength":79}],76:[function(require,module,exports){ | |
var root = require('./_root'), | |
stubFalse = require('./stubFalse'); | |
/** Detect free variable `exports`. */ | |
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; | |
/** Detect free variable `module`. */ | |
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; | |
/** Detect the popular CommonJS extension `module.exports`. */ | |
var moduleExports = freeModule && freeModule.exports === freeExports; | |
/** Built-in value references. */ | |
var Buffer = moduleExports ? root.Buffer : undefined; | |
/* Built-in method references for those with the same name as other `lodash` methods. */ | |
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; | |
/** | |
* Checks if `value` is a buffer. | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.3.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`. | |
* @example | |
* | |
* _.isBuffer(new Buffer(2)); | |
* // => true | |
* | |
* _.isBuffer(new Uint8Array(2)); | |
* // => false | |
*/ | |
var isBuffer = nativeIsBuffer || stubFalse; | |
module.exports = isBuffer; | |
},{"./_root":62,"./stubFalse":84}],77:[function(require,module,exports){ | |
var baseIsEqual = require('./_baseIsEqual'); | |
/** | |
* Performs a deep comparison between two values to determine if they are | |
* equivalent. | |
* | |
* **Note:** This method supports comparing arrays, array buffers, booleans, | |
* date objects, error objects, maps, numbers, `Object` objects, regexes, | |
* sets, strings, symbols, and typed arrays. `Object` objects are compared | |
* by their own, not inherited, enumerable properties. Functions and DOM | |
* nodes are **not** supported. | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Lang | |
* @param {*} value The value to compare. | |
* @param {*} other The other value to compare. | |
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. | |
* @example | |
* | |
* var object = { 'a': 1 }; | |
* var other = { 'a': 1 }; | |
* | |
* _.isEqual(object, other); | |
* // => true | |
* | |
* object === other; | |
* // => false | |
*/ | |
function isEqual(value, other) { | |
return baseIsEqual(value, other); | |
} | |
module.exports = isEqual; | |
},{"./_baseIsEqual":21}],78:[function(require,module,exports){ | |
var isObject = require('./isObject'); | |
/** `Object#toString` result references. */ | |
var funcTag = '[object Function]', | |
genTag = '[object GeneratorFunction]', | |
proxyTag = '[object Proxy]'; | |
/** Used for built-in method references. */ | |
var objectProto = Object.prototype; | |
/** | |
* Used to resolve the | |
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | |
* of values. | |
*/ | |
var objectToString = objectProto.toString; | |
/** | |
* Checks if `value` is classified as a `Function` object. | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a function, else `false`. | |
* @example | |
* | |
* _.isFunction(_); | |
* // => true | |
* | |
* _.isFunction(/abc/); | |
* // => false | |
*/ | |
function isFunction(value) { | |
// The use of `Object#toString` avoids issues with the `typeof` operator | |
// in Safari 9 which returns 'object' for typed array and other constructors. | |
var tag = isObject(value) ? objectToString.call(value) : ''; | |
return tag == funcTag || tag == genTag || tag == proxyTag; | |
} | |
module.exports = isFunction; | |
},{"./isObject":80}],79:[function(require,module,exports){ | |
/** Used as references for various `Number` constants. */ | |
var MAX_SAFE_INTEGER = 9007199254740991; | |
/** | |
* Checks if `value` is a valid array-like length. | |
* | |
* **Note:** This method is loosely based on | |
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.0.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`. | |
* @example | |
* | |
* _.isLength(3); | |
* // => true | |
* | |
* _.isLength(Number.MIN_VALUE); | |
* // => false | |
* | |
* _.isLength(Infinity); | |
* // => false | |
* | |
* _.isLength('3'); | |
* // => false | |
*/ | |
function isLength(value) { | |
return typeof value == 'number' && | |
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; | |
} | |
module.exports = isLength; | |
},{}],80:[function(require,module,exports){ | |
/** | |
* Checks if `value` is the | |
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) | |
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is an object, else `false`. | |
* @example | |
* | |
* _.isObject({}); | |
* // => true | |
* | |
* _.isObject([1, 2, 3]); | |
* // => true | |
* | |
* _.isObject(_.noop); | |
* // => true | |
* | |
* _.isObject(null); | |
* // => false | |
*/ | |
function isObject(value) { | |
var type = typeof value; | |
return value != null && (type == 'object' || type == 'function'); | |
} | |
module.exports = isObject; | |
},{}],81:[function(require,module,exports){ | |
/** | |
* Checks if `value` is object-like. A value is object-like if it's not `null` | |
* and has a `typeof` result of "object". | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.0.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | |
* @example | |
* | |
* _.isObjectLike({}); | |
* // => true | |
* | |
* _.isObjectLike([1, 2, 3]); | |
* // => true | |
* | |
* _.isObjectLike(_.noop); | |
* // => false | |
* | |
* _.isObjectLike(null); | |
* // => false | |
*/ | |
function isObjectLike(value) { | |
return value != null && typeof value == 'object'; | |
} | |
module.exports = isObjectLike; | |
},{}],82:[function(require,module,exports){ | |
var baseIsTypedArray = require('./_baseIsTypedArray'), | |
baseUnary = require('./_baseUnary'), | |
nodeUtil = require('./_nodeUtil'); | |
/* Node.js helper references. */ | |
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; | |
/** | |
* Checks if `value` is classified as a typed array. | |
* | |
* @static | |
* @memberOf _ | |
* @since 3.0.0 | |
* @category Lang | |
* @param {*} value The value to check. | |
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`. | |
* @example | |
* | |
* _.isTypedArray(new Uint8Array); | |
* // => true | |
* | |
* _.isTypedArray([]); | |
* // => false | |
*/ | |
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; | |
module.exports = isTypedArray; | |
},{"./_baseIsTypedArray":24,"./_baseUnary":27,"./_nodeUtil":60}],83:[function(require,module,exports){ | |
var arrayLikeKeys = require('./_arrayLikeKeys'), | |
baseKeys = require('./_baseKeys'), | |
isArrayLike = require('./isArrayLike'); | |
/** | |
* Creates an array of the own enumerable property names of `object`. | |
* | |
* **Note:** Non-object values are coerced to objects. See the | |
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) | |
* for more details. | |
* | |
* @static | |
* @since 0.1.0 | |
* @memberOf _ | |
* @category Object | |
* @param {Object} object The object to query. | |
* @returns {Array} Returns the array of property names. | |
* @example | |
* | |
* function Foo() { | |
* this.a = 1; | |
* this.b = 2; | |
* } | |
* | |
* Foo.prototype.c = 3; | |
* | |
* _.keys(new Foo); | |
* // => ['a', 'b'] (iteration order is not guaranteed) | |
* | |
* _.keys('hi'); | |
* // => ['0', '1'] | |
*/ | |
function keys(object) { | |
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); | |
} | |
module.exports = keys; | |
},{"./_arrayLikeKeys":16,"./_baseKeys":25,"./isArrayLike":75}],84:[function(require,module,exports){ | |
/** | |
* This method returns `false`. | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.13.0 | |
* @category Util | |
* @returns {boolean} Returns `false`. | |
* @example | |
* | |
* _.times(2, _.stubFalse); | |
* // => [false, false] | |
*/ | |
function stubFalse() { | |
return false; | |
} | |
module.exports = stubFalse; | |
},{}],"normalizr":[function(require,module,exports){ | |
'use strict'; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
exports.Schema = undefined; | |
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | |
exports.arrayOf = arrayOf; | |
exports.valuesOf = valuesOf; | |
exports.unionOf = unionOf; | |
exports.normalize = normalize; | |
var _EntitySchema = require('./EntitySchema'); | |
var _EntitySchema2 = _interopRequireDefault(_EntitySchema); | |
var _IterableSchema = require('./IterableSchema'); | |
var _IterableSchema2 = _interopRequireDefault(_IterableSchema); | |
var _UnionSchema = require('./UnionSchema'); | |
var _UnionSchema2 = _interopRequireDefault(_UnionSchema); | |
var _isEqual = require('lodash/isEqual'); | |
var _isEqual2 = _interopRequireDefault(_isEqual); | |
var _isObject = require('lodash/isObject'); | |
var _isObject2 = _interopRequireDefault(_isObject); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function defaultAssignEntity(normalized, key, entity) { | |
normalized[key] = entity; | |
} | |
function visitObject(obj, schema, bag, options) { | |
var _options$assignEntity = options.assignEntity; | |
var assignEntity = _options$assignEntity === undefined ? defaultAssignEntity : _options$assignEntity; | |
var defaults = schema && schema.getDefaults && schema.getDefaults(); | |
var schemaAssignEntity = schema && schema.getAssignEntity && schema.getAssignEntity(); | |
var normalized = (0, _isObject2.default)(defaults) ? _extends({}, defaults) : {}; | |
for (var key in obj) { | |
if (obj.hasOwnProperty(key)) { | |
var entity = visit(obj[key], schema[key], bag, options); | |
assignEntity.call(null, normalized, key, entity, obj, schema); | |
if (schemaAssignEntity) { | |
schemaAssignEntity.call(null, normalized, key, entity, obj, schema); | |
} | |
} | |
} | |
return normalized; | |
} | |
function defaultMapper(iterableSchema, itemSchema, bag, options) { | |
return function (obj) { | |
return visit(obj, itemSchema, bag, options); | |
}; | |
} | |
function polymorphicMapper(iterableSchema, itemSchema, bag, options) { | |
return function (obj) { | |
var schemaKey = iterableSchema.getSchemaKey(obj); | |
var result = visit(obj, itemSchema[schemaKey], bag, options); | |
return { id: result, schema: schemaKey }; | |
}; | |
} | |
function visitIterable(obj, iterableSchema, bag, options) { | |
var itemSchema = iterableSchema.getItemSchema(); | |
var curriedItemMapper = defaultMapper(iterableSchema, itemSchema, bag, options); | |
if (Array.isArray(obj)) { | |
return obj.map(curriedItemMapper); | |
} else { | |
return Object.keys(obj).reduce(function (objMap, key) { | |
objMap[key] = curriedItemMapper(obj[key]); | |
return objMap; | |
}, {}); | |
} | |
} | |
function visitUnion(obj, unionSchema, bag, options) { | |
var itemSchema = unionSchema.getItemSchema(); | |
return polymorphicMapper(unionSchema, itemSchema, bag, options)(obj); | |
} | |
function defaultMergeIntoEntity(entityA, entityB, entityKey) { | |
for (var key in entityB) { | |
if (!entityB.hasOwnProperty(key)) { | |
continue; | |
} | |
if (!entityA.hasOwnProperty(key) || (0, _isEqual2.default)(entityA[key], entityB[key])) { | |
entityA[key] = entityB[key]; | |
continue; | |
} | |
console.warn('When merging two ' + entityKey + ', found unequal data in their "' + key + '" values. Using the earlier value.', entityA[key], entityB[key]); | |
} | |
} | |
function visitEntity(entity, entitySchema, bag, options) { | |
var _options$mergeIntoEnt = options.mergeIntoEntity; | |
var mergeIntoEntity = _options$mergeIntoEnt === undefined ? defaultMergeIntoEntity : _options$mergeIntoEnt; | |
var entityKey = entitySchema.getKey(); | |
var id = entitySchema.getId(entity); | |
if (!bag.hasOwnProperty(entityKey)) { | |
bag[entityKey] = {}; | |
} | |
if (!bag[entityKey].hasOwnProperty(id)) { | |
bag[entityKey][id] = {}; | |
} | |
var stored = bag[entityKey][id]; | |
var normalized = visitObject(entity, entitySchema, bag, options); | |
mergeIntoEntity(stored, normalized, entityKey); | |
return id; | |
} | |
function visit(obj, schema, bag, options) { | |
if (!(0, _isObject2.default)(obj) || !(0, _isObject2.default)(schema)) { | |
return obj; | |
} | |
if (schema instanceof _EntitySchema2.default) { | |
return visitEntity(obj, schema, bag, options); | |
} else if (schema instanceof _IterableSchema2.default) { | |
return visitIterable(obj, schema, bag, options); | |
} else if (schema instanceof _UnionSchema2.default) { | |
return visitUnion(obj, schema, bag, options); | |
} else { | |
return visitObject(obj, schema, bag, options); | |
} | |
} | |
function arrayOf(schema, options) { | |
return new _IterableSchema2.default(schema, options); | |
} | |
function valuesOf(schema, options) { | |
return new _IterableSchema2.default(schema, options); | |
} | |
function unionOf(schema, options) { | |
return new _UnionSchema2.default(schema, options); | |
} | |
exports.Schema = _EntitySchema2.default; | |
function normalize(obj, schema) { | |
var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; | |
if (!(0, _isObject2.default)(obj)) { | |
throw new Error('Normalize accepts an object or an array as its input.'); | |
} | |
if (!(0, _isObject2.default)(schema) || Array.isArray(schema)) { | |
throw new Error('Normalize accepts an object for schema.'); | |
} | |
var bag = {}; | |
var result = visit(obj, schema, bag, options); | |
return { | |
entities: bag, | |
result: result | |
}; | |
} | |
},{"./EntitySchema":1,"./IterableSchema":2,"./UnionSchema":3,"lodash/isEqual":77,"lodash/isObject":80}]},{},[]) | |
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4u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c1syXTtcblxuICBpZiAoISgwLCBfaXNPYmplY3QyLmRlZmF1bHQpKG9iaikpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoJ05vcm1hbGl6ZSBhY2NlcHRzIGFuIG9iamVjdCBvciBhbiBhcnJheSBhcyBpdHMgaW5wdXQuJyk7XG4gIH1cblxuICBpZiAoISgwLCBfaXNPYmplY3QyLmRlZmF1bHQpKHNjaGVtYSkgfHwgQXJyYXkuaXNBcnJheShzY2hlbWEpKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdOb3JtYWxpemUgYWNjZXB0cyBhbiBvYmplY3QgZm9yIHNjaGVtYS4nKTtcbiAgfVxuXG4gIHZhciBiYWcgPSB7fTtcbiAgdmFyIHJlc3VsdCA9IHZpc2l0KG9iaiwgc2NoZW1hLCBiYWcsIG9wdGlvbnMpO1xuXG4gIHJldHVybiB7XG4gICAgZW50aXRpZXM6IGJhZyxcbiAgICByZXN1bHQ6IHJlc3VsdFxuICB9O1xufSJdfQ== | |
const { normalize, Schema, arrayOf } = require('normalizr'); | |
const { v4 } = require('uuid'); | |
const group = new Schema('groups'); | |
const groups = arrayOf(group); | |
group.define({ | |
children: groups | |
}); | |
const structure = [ | |
{ | |
id: v4(), | |
title: "Test 1", | |
children: [ | |
{ | |
id: v4(), | |
title: "Child 1", | |
children: [ | |
{ | |
id: v4(), | |
title: "Sub Child 1", | |
children: [] | |
} | |
] | |
}, | |
{ | |
id: v4(), | |
title: "Child 2", | |
children: [] | |
}, | |
{ | |
id: v4(), | |
title: "Child 3", | |
children: [] | |
} | |
] | |
}, | |
{ | |
id: v4(), | |
title: "Test 2", | |
children: [] | |
} | |
]; | |
document.querySelector('pre').innerHTML = JSON.stringify( | |
normalize(structure, groups), | |
undefined, | |
2 | |
); | |
;}, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "requirebin-sketch", | |
"version": "1.0.0", | |
"dependencies": { | |
"uuid": "2.0.3", | |
"normalizr": "2.2.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- contents of this file will be placed inside the <body> --> | |
<pre></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- contents of this file will be placed inside the <head> --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment