From 3f0804001debcc1e74be8a19404206df8ee50abf Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sat, 11 Nov 2017 10:16:44 -0500 Subject: [PATCH 01/11] Add yarn as devDep In order for the package to be installable via git (and to remove dist from git), then the `prepare` script will need to be runnable from the user's machine. Which means `yarn` needs to be available to npm users. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8cb37a88..7a75f3b1 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,8 @@ "teenytest": "^5.1.1", "testdouble": "3.2.6", "testem": "^1.18.0", - "typescript": "^2.4.1" + "typescript": "^2.4.1", + "yarn": "^1.3.2" }, "directories": { "doc": "./docs", From 8525f21ff9119f57fb38e39d4ef1df27cf338807 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sat, 11 Nov 2017 10:32:15 -0500 Subject: [PATCH 02/11] prepare is the new prepublish --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a75f3b1..eea913c9 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "preversion": "git pull --rebase && yarn run test:ci", "version": "yarn run version:write && yarn run compile && git add dist src/version.js", "postversion": "git push --tags && yarn run version:changelog && git push && npm publish", - "prepublish": "yarn run compile" + "prepare": "yarn compile" }, "babel": { "presets": [ From a171b40969a2ff3bd3cd53e4b54e49fbb9184c4a Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sat, 11 Nov 2017 10:35:24 -0500 Subject: [PATCH 03/11] Yarn doesn't need 'run' for running package scripts --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index eea913c9..30d4a256 100644 --- a/package.json +++ b/package.json @@ -15,32 +15,32 @@ "mocha_reporter": "dot" }, "scripts": { - "clean": "rm -rf generated dist lib coverage && yarn run clean:dist", + "clean": "rm -rf generated dist lib coverage && yarn clean:dist", "clean:dist": "git checkout -- dist", "compile:browser": "browserify src/index.js --standalone td --outfile $npm_package_config_build_file -p headerify -t babelify", "compile:browser:test": "mkdir -p generated && browserify regression/browser-helper.js --outfile $npm_package_config_test_bundle -t babelify -t coffeeify --extension=\".coffee\" -t require-globify --ignore-missing", "compile:node": "babel src -d lib", - "compile": "yarn run compile:node && yarn run compile:browser && yarn run compile:browser:test", + "compile": "yarn compile:node && yarn compile:browser && yarn compile:browser:test", "cover": "nyc --reporter=lcov --reporter=text-summary --require babel-core/register _mocha --ui mocha-given --reporter $npm_package_config_mocha_reporter --compilers coffee:coffee-script --recursive regression/node-helper.coffee regression/src", "cover:unit": "nyc --reporter=html yarn test:unit", "cover:report": "codeclimate-test-reporter < coverage/lcov.info", "style": "standard --fix", "test": "mocha --ui mocha-given --reporter $npm_package_config_mocha_reporter --compilers js:babel-core/register,coffee:coffee-script --recursive regression/node-helper.coffee regression/src", - "test:all": "yarn test:unit && yarn test && yarn run test:browser && yarn run test:example && yarn run test:typescript", + "test:all": "yarn test:unit && yarn test && yarn test:browser && yarn test:example && yarn test:typescript", "test:browser": "testem ci", "test:unit": "teenytest", - "test:ci": "yarn run clean && yarn run compile && yarn run style && yarn run test:all && yarn run clean:dist && echo \"All done!\"", + "test:ci": "yarn clean && yarn compile && yarn style && yarn test:all && yarn clean:dist && echo \"All done!\"", "test:typescript": "tsc --outDir generated/typescript -p regression/typescript && node generated/typescript/test.js", "test:example:webpack": "cd examples/webpack && npm install && npm test", "test:example:node": "cd examples/node && npm install && npm test", "test:example:lineman": "cd examples/lineman && yarn install && yarn test", "test:example:babel": "cd examples/babel && npm install && npm test", - "test:example": "yarn run test:example:node && yarn run test:example:lineman && yarn run test:example:webpack && yarn run test:example:babel", + "test:example": "yarn test:example:node && yarn test:example:lineman && yarn test:example:webpack && yarn test:example:babel", "version:write": "echo \"export default '$npm_package_version'\" > src/version.js", "version:changelog": "if command -v github_changelog_generator &>/dev/null; then github_changelog_generator; git commit -m \"Changelog for $npm_package_version\" CHANGELOG.md; else echo Versioning requires you first run 'gem install github_changelog_generator' >&2; fi", - "preversion": "git pull --rebase && yarn run test:ci", - "version": "yarn run version:write && yarn run compile && git add dist src/version.js", - "postversion": "git push --tags && yarn run version:changelog && git push && npm publish", + "preversion": "git pull --rebase && yarn test:ci", + "version": "yarn version:write && yarn compile && git add dist src/version.js", + "postversion": "git push --tags && yarn version:changelog && git push && npm publish", "prepare": "yarn compile" }, "babel": { From fad13a28546cf00561fd81eb8b9b7f57f09aedc5 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sat, 11 Nov 2017 10:42:00 -0500 Subject: [PATCH 04/11] Remove dist from git --- .gitignore | 3 +- dist/testdouble.js | 11480 ------------------------------------------- package.json | 8 +- 3 files changed, 6 insertions(+), 11485 deletions(-) delete mode 100644 dist/testdouble.js diff --git a/.gitignore b/.gitignore index af9107a9..3220058e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ npm-debug.log* /generated /lib /coverage +/dist .node-version -.vscode \ No newline at end of file +.vscode diff --git a/dist/testdouble.js b/dist/testdouble.js deleted file mode 100644 index 46866d06..00000000 --- a/dist/testdouble.js +++ /dev/null @@ -1,11480 +0,0 @@ -/* - * testdouble@3.3.3 - * - * A minimal test double library for TDD with JavaScript - * - * https://github.com/testdouble/testdouble.js - */ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.td = f()}})(function(){var define,module,exports;return (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= 0) fromIndex = floor(fromIndex); - else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); - - for (i = fromIndex; i < length; ++i) { - if (objHasOwnProperty.call(this, i)) { - val = this[i]; - if (numberIsNaN(val)) return i; // Jslint: ignore - } - } - return -1; -}; - -},{"../../number/is-nan":15,"../../number/to-pos-integer":19,"../../object/valid-value":40}],6:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Array.from - : require("./shim"); - -},{"./is-implemented":7,"./shim":8}],7:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var from = Array.from, arr, result; - if (typeof from !== "function") return false; - arr = ["raz", "dwa"]; - result = from(arr); - return Boolean(result && (result !== arr) && (result[1] === "dwa")); -}; - -},{}],8:[function(require,module,exports){ -"use strict"; - -var iteratorSymbol = require("es6-symbol").iterator - , isArguments = require("../../function/is-arguments") - , isFunction = require("../../function/is-function") - , toPosInt = require("../../number/to-pos-integer") - , callable = require("../../object/valid-callable") - , validValue = require("../../object/valid-value") - , isValue = require("../../object/is-value") - , isString = require("../../string/is-string") - , isArray = Array.isArray - , call = Function.prototype.call - , desc = { configurable: true, enumerable: true, writable: true, value: null } - , defineProperty = Object.defineProperty; - -// eslint-disable-next-line complexity -module.exports = function (arrayLike /*, mapFn, thisArg*/) { - var mapFn = arguments[1] - , thisArg = arguments[2] - , Context - , i - , j - , arr - , length - , code - , iterator - , result - , getIterator - , value; - - arrayLike = Object(validValue(arrayLike)); - - if (isValue(mapFn)) callable(mapFn); - if (!this || this === Array || !isFunction(this)) { - // Result: Plain array - if (!mapFn) { - if (isArguments(arrayLike)) { - // Source: Arguments - length = arrayLike.length; - if (length !== 1) return Array.apply(null, arrayLike); - arr = new Array(1); - arr[0] = arrayLike[0]; - return arr; - } - if (isArray(arrayLike)) { - // Source: Array - arr = new Array(length = arrayLike.length); - for (i = 0; i < length; ++i) arr[i] = arrayLike[i]; - return arr; - } - } - arr = []; - } else { - // Result: Non plain array - Context = this; - } - - if (!isArray(arrayLike)) { - if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) { - // Source: Iterator - iterator = callable(getIterator).call(arrayLike); - if (Context) arr = new Context(); - result = iterator.next(); - i = 0; - while (!result.done) { - value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; - if (Context) { - desc.value = value; - defineProperty(arr, i, desc); - } else { - arr[i] = value; - } - result = iterator.next(); - ++i; - } - length = i; - } else if (isString(arrayLike)) { - // Source: String - length = arrayLike.length; - if (Context) arr = new Context(); - for (i = 0, j = 0; i < length; ++i) { - value = arrayLike[i]; - if (i + 1 < length) { - code = value.charCodeAt(0); - // eslint-disable-next-line max-depth - if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i]; - } - value = mapFn ? call.call(mapFn, thisArg, value, j) : value; - if (Context) { - desc.value = value; - defineProperty(arr, j, desc); - } else { - arr[j] = value; - } - ++j; - } - length = j; - } - } - if (length === undefined) { - // Source: array or array-like - length = toPosInt(arrayLike.length); - if (Context) arr = new Context(length); - for (i = 0; i < length; ++i) { - value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; - if (Context) { - desc.value = value; - defineProperty(arr, i, desc); - } else { - arr[i] = value; - } - } - } - if (Context) { - desc.value = null; - arr.length = length; - } - return arr; -}; - -},{"../../function/is-arguments":9,"../../function/is-function":10,"../../number/to-pos-integer":19,"../../object/is-value":29,"../../object/valid-callable":39,"../../object/valid-value":40,"../../string/is-string":44,"es6-symbol":58}],9:[function(require,module,exports){ -"use strict"; - -var objToString = Object.prototype.toString - , id = objToString.call( - (function () { - return arguments; - })() -); - -module.exports = function (value) { - return objToString.call(value) === id; -}; - -},{}],10:[function(require,module,exports){ -"use strict"; - -var objToString = Object.prototype.toString, id = objToString.call(require("./noop")); - -module.exports = function (value) { - return typeof value === "function" && objToString.call(value) === id; -}; - -},{"./noop":11}],11:[function(require,module,exports){ -"use strict"; - -// eslint-disable-next-line no-empty-function -module.exports = function () {}; - -},{}],12:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Math.sign - : require("./shim"); - -},{"./is-implemented":13,"./shim":14}],13:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var sign = Math.sign; - if (typeof sign !== "function") return false; - return (sign(10) === 1) && (sign(-20) === -1); -}; - -},{}],14:[function(require,module,exports){ -"use strict"; - -module.exports = function (value) { - value = Number(value); - if (isNaN(value) || (value === 0)) return value; - return value > 0 ? 1 : -1; -}; - -},{}],15:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Number.isNaN - : require("./shim"); - -},{"./is-implemented":16,"./shim":17}],16:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var numberIsNaN = Number.isNaN; - if (typeof numberIsNaN !== "function") return false; - return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34); -}; - -},{}],17:[function(require,module,exports){ -"use strict"; - -module.exports = function (value) { - // eslint-disable-next-line no-self-compare - return value !== value; -}; - -},{}],18:[function(require,module,exports){ -"use strict"; - -var sign = require("../math/sign") - - , abs = Math.abs, floor = Math.floor; - -module.exports = function (value) { - if (isNaN(value)) return 0; - value = Number(value); - if ((value === 0) || !isFinite(value)) return value; - return sign(value) * floor(abs(value)); -}; - -},{"../math/sign":12}],19:[function(require,module,exports){ -"use strict"; - -var toInteger = require("./to-integer") - - , max = Math.max; - -module.exports = function (value) { - return max(0, toInteger(value)); -}; - -},{"./to-integer":18}],20:[function(require,module,exports){ -// Internal method, used by iteration functions. -// Calls a function for each key-value pair found in object -// Optionally takes compareFn to iterate object in specific order - -"use strict"; - -var callable = require("./valid-callable") - , value = require("./valid-value") - , bind = Function.prototype.bind - , call = Function.prototype.call - , keys = Object.keys - , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; - -module.exports = function (method, defVal) { - return function (obj, cb /*, thisArg, compareFn*/) { - var list, thisArg = arguments[2], compareFn = arguments[3]; - obj = Object(value(obj)); - callable(cb); - - list = keys(obj); - if (compareFn) { - list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined); - } - if (typeof method !== "function") method = list[method]; - return call.call(method, list, function (key, index) { - if (!objPropertyIsEnumerable.call(obj, key)) return defVal; - return call.call(cb, thisArg, obj[key], key, obj, index); - }); - }; -}; - -},{"./valid-callable":39,"./valid-value":40}],21:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Object.assign - : require("./shim"); - -},{"./is-implemented":22,"./shim":23}],22:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - var assign = Object.assign, obj; - if (typeof assign !== "function") return false; - obj = { foo: "raz" }; - assign(obj, { bar: "dwa" }, { trzy: "trzy" }); - return (obj.foo + obj.bar + obj.trzy) === "razdwatrzy"; -}; - -},{}],23:[function(require,module,exports){ -"use strict"; - -var keys = require("../keys") - , value = require("../valid-value") - , max = Math.max; - -module.exports = function (dest, src /*, …srcn*/) { - var error, i, length = max(arguments.length, 2), assign; - dest = Object(value(dest)); - assign = function (key) { - try { - dest[key] = src[key]; - } catch (e) { - if (!error) error = e; - } - }; - for (i = 1; i < length; ++i) { - src = arguments[i]; - keys(src).forEach(assign); - } - if (error !== undefined) throw error; - return dest; -}; - -},{"../keys":30,"../valid-value":40}],24:[function(require,module,exports){ -"use strict"; - -var aFrom = require("../array/from") - , assign = require("./assign") - , value = require("./valid-value"); - -module.exports = function (obj/*, propertyNames, options*/) { - var copy = Object(value(obj)), propertyNames = arguments[1], options = Object(arguments[2]); - if (copy !== obj && !propertyNames) return copy; - var result = {}; - if (propertyNames) { - aFrom(propertyNames, function (propertyName) { - if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName]; - }); - } else { - assign(result, obj); - } - return result; -}; - -},{"../array/from":6,"./assign":21,"./valid-value":40}],25:[function(require,module,exports){ -// Workaround for http://code.google.com/p/v8/issues/detail?id=2804 - -"use strict"; - -var create = Object.create, shim; - -if (!require("./set-prototype-of/is-implemented")()) { - shim = require("./set-prototype-of/shim"); -} - -module.exports = (function () { - var nullObject, polyProps, desc; - if (!shim) return create; - if (shim.level !== 1) return create; - - nullObject = {}; - polyProps = {}; - desc = { - configurable: false, - enumerable: false, - writable: true, - value: undefined - }; - Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { - if (name === "__proto__") { - polyProps[name] = { - configurable: true, - enumerable: false, - writable: true, - value: undefined - }; - return; - } - polyProps[name] = desc; - }); - Object.defineProperties(nullObject, polyProps); - - Object.defineProperty(shim, "nullPolyfill", { - configurable: false, - enumerable: false, - writable: false, - value: nullObject - }); - - return function (prototype, props) { - return create(prototype === null ? nullObject : prototype, props); - }; -}()); - -},{"./set-prototype-of/is-implemented":37,"./set-prototype-of/shim":38}],26:[function(require,module,exports){ -"use strict"; - -module.exports = require("./_iterate")("forEach"); - -},{"./_iterate":20}],27:[function(require,module,exports){ -// Deprecated - -"use strict"; - -module.exports = function (obj) { - return typeof obj === "function"; -}; - -},{}],28:[function(require,module,exports){ -"use strict"; - -var isValue = require("./is-value"); - -var map = { function: true, object: true }; - -module.exports = function (value) { - return (isValue(value) && map[typeof value]) || false; -}; - -},{"./is-value":29}],29:[function(require,module,exports){ -"use strict"; - -var _undefined = require("../function/noop")(); // Support ES3 engines - -module.exports = function (val) { - return (val !== _undefined) && (val !== null); -}; - -},{"../function/noop":11}],30:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Object.keys - : require("./shim"); - -},{"./is-implemented":31,"./shim":32}],31:[function(require,module,exports){ -"use strict"; - -module.exports = function () { - try { - Object.keys("primitive"); - return true; - } catch (e) { - return false; -} -}; - -},{}],32:[function(require,module,exports){ -"use strict"; - -var isValue = require("../is-value"); - -var keys = Object.keys; - -module.exports = function (object) { - return keys(isValue(object) ? Object(object) : object); -}; - -},{"../is-value":29}],33:[function(require,module,exports){ -"use strict"; - -var callable = require("./valid-callable") - , forEach = require("./for-each") - , call = Function.prototype.call; - -module.exports = function (obj, cb /*, thisArg*/) { - var result = {}, thisArg = arguments[2]; - callable(cb); - forEach(obj, function (value, key, targetObj, index) { - result[key] = call.call(cb, thisArg, value, key, targetObj, index); - }); - return result; -}; - -},{"./for-each":26,"./valid-callable":39}],34:[function(require,module,exports){ -"use strict"; - -var isValue = require("./is-value"); - -var forEach = Array.prototype.forEach, create = Object.create; - -var process = function (src, obj) { - var key; - for (key in src) obj[key] = src[key]; -}; - -// eslint-disable-next-line no-unused-vars -module.exports = function (opts1 /*, …options*/) { - var result = create(null); - forEach.call(arguments, function (options) { - if (!isValue(options)) return; - process(Object(options), result); - }); - return result; -}; - -},{"./is-value":29}],35:[function(require,module,exports){ -"use strict"; - -var forEach = Array.prototype.forEach, create = Object.create; - -// eslint-disable-next-line no-unused-vars -module.exports = function (arg /*, …args*/) { - var set = create(null); - forEach.call(arguments, function (name) { - set[name] = true; - }); - return set; -}; - -},{}],36:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? Object.setPrototypeOf - : require("./shim"); - -},{"./is-implemented":37,"./shim":38}],37:[function(require,module,exports){ -"use strict"; - -var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; - -module.exports = function (/* CustomCreate*/) { - var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create; - if (typeof setPrototypeOf !== "function") return false; - return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; -}; - -},{}],38:[function(require,module,exports){ -/* eslint no-proto: "off" */ - -// Big thanks to @WebReflection for sorting this out -// https://gist.github.com/WebReflection/5593554 - -"use strict"; - -var isObject = require("../is-object") - , value = require("../valid-value") - , objIsPrototypeOf = Object.prototype.isPrototypeOf - , defineProperty = Object.defineProperty - , nullDesc = { - configurable: true, - enumerable: false, - writable: true, - value: undefined -} - , validate; - -validate = function (obj, prototype) { - value(obj); - if (prototype === null || isObject(prototype)) return obj; - throw new TypeError("Prototype must be null or an object"); -}; - -module.exports = (function (status) { - var fn, set; - if (!status) return null; - if (status.level === 2) { - if (status.set) { - set = status.set; - fn = function (obj, prototype) { - set.call(validate(obj, prototype), prototype); - return obj; - }; - } else { - fn = function (obj, prototype) { - validate(obj, prototype).__proto__ = prototype; - return obj; - }; - } - } else { - fn = function self(obj, prototype) { - var isNullBase; - validate(obj, prototype); - isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj); - if (isNullBase) delete self.nullPolyfill.__proto__; - if (prototype === null) prototype = self.nullPolyfill; - obj.__proto__ = prototype; - if (isNullBase) defineProperty(self.nullPolyfill, "__proto__", nullDesc); - return obj; - }; - } - return Object.defineProperty(fn, "level", { - configurable: false, - enumerable: false, - writable: false, - value: status.level - }); -}( - (function () { - var tmpObj1 = Object.create(null) - , tmpObj2 = {} - , set - , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__"); - - if (desc) { - try { - set = desc.set; // Opera crashes at this point - set.call(tmpObj1, tmpObj2); - } catch (ignore) {} - if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { set: set, level: 2 }; - } - - tmpObj1.__proto__ = tmpObj2; - if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 2 }; - - tmpObj1 = {}; - tmpObj1.__proto__ = tmpObj2; - if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 1 }; - - return false; - })() -)); - -require("../create"); - -},{"../create":25,"../is-object":28,"../valid-value":40}],39:[function(require,module,exports){ -"use strict"; - -module.exports = function (fn) { - if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); - return fn; -}; - -},{}],40:[function(require,module,exports){ -"use strict"; - -var isValue = require("./is-value"); - -module.exports = function (value) { - if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); - return value; -}; - -},{"./is-value":29}],41:[function(require,module,exports){ -"use strict"; - -module.exports = require("./is-implemented")() - ? String.prototype.contains - : require("./shim"); - -},{"./is-implemented":42,"./shim":43}],42:[function(require,module,exports){ -"use strict"; - -var str = "razdwatrzy"; - -module.exports = function () { - if (typeof str.contains !== "function") return false; - return (str.contains("dwa") === true) && (str.contains("foo") === false); -}; - -},{}],43:[function(require,module,exports){ -"use strict"; - -var indexOf = String.prototype.indexOf; - -module.exports = function (searchString/*, position*/) { - return indexOf.call(this, searchString, arguments[1]) > -1; -}; - -},{}],44:[function(require,module,exports){ -"use strict"; - -var objToString = Object.prototype.toString, id = objToString.call(""); - -module.exports = function (value) { - return ( - typeof value === "string" || - (value && - typeof value === "object" && - (value instanceof String || objToString.call(value) === id)) || - false - ); -}; - -},{}],45:[function(require,module,exports){ -"use strict"; - -var setPrototypeOf = require("es5-ext/object/set-prototype-of") - , contains = require("es5-ext/string/#/contains") - , d = require("d") - , Symbol = require("es6-symbol") - , Iterator = require("./"); - -var defineProperty = Object.defineProperty, ArrayIterator; - -ArrayIterator = module.exports = function (arr, kind) { - if (!(this instanceof ArrayIterator)) throw new TypeError("Constructor requires 'new'"); - Iterator.call(this, arr); - if (!kind) kind = "value"; - else if (contains.call(kind, "key+value")) kind = "key+value"; - else if (contains.call(kind, "key")) kind = "key"; - else kind = "value"; - defineProperty(this, "__kind__", d("", kind)); -}; -if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator); - -// Internal %ArrayIteratorPrototype% doesn't expose its constructor -delete ArrayIterator.prototype.constructor; - -ArrayIterator.prototype = Object.create(Iterator.prototype, { - _resolve: d(function (i) { - if (this.__kind__ === "value") return this.__list__[i]; - if (this.__kind__ === "key+value") return [i, this.__list__[i]]; - return i; - }) -}); -defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); - -},{"./":48,"d":3,"es5-ext/object/set-prototype-of":36,"es5-ext/string/#/contains":41,"es6-symbol":58}],46:[function(require,module,exports){ -"use strict"; - -var isArguments = require("es5-ext/function/is-arguments") - , callable = require("es5-ext/object/valid-callable") - , isString = require("es5-ext/string/is-string") - , get = require("./get"); - -var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some; - -module.exports = function (iterable, cb /*, thisArg*/) { - var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code; - if (isArray(iterable) || isArguments(iterable)) mode = "array"; - else if (isString(iterable)) mode = "string"; - else iterable = get(iterable); - - callable(cb); - doBreak = function () { - broken = true; - }; - if (mode === "array") { - some.call(iterable, function (value) { - call.call(cb, thisArg, value, doBreak); - return broken; - }); - return; - } - if (mode === "string") { - length = iterable.length; - for (i = 0; i < length; ++i) { - char = iterable[i]; - if (i + 1 < length) { - code = char.charCodeAt(0); - if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i]; - } - call.call(cb, thisArg, char, doBreak); - if (broken) break; - } - return; - } - result = iterable.next(); - - while (!result.done) { - call.call(cb, thisArg, result.value, doBreak); - if (broken) return; - result = iterable.next(); - } -}; - -},{"./get":47,"es5-ext/function/is-arguments":9,"es5-ext/object/valid-callable":39,"es5-ext/string/is-string":44}],47:[function(require,module,exports){ -"use strict"; - -var isArguments = require("es5-ext/function/is-arguments") - , isString = require("es5-ext/string/is-string") - , ArrayIterator = require("./array") - , StringIterator = require("./string") - , iterable = require("./valid-iterable") - , iteratorSymbol = require("es6-symbol").iterator; - -module.exports = function (obj) { - if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol](); - if (isArguments(obj)) return new ArrayIterator(obj); - if (isString(obj)) return new StringIterator(obj); - return new ArrayIterator(obj); -}; - -},{"./array":45,"./string":50,"./valid-iterable":51,"es5-ext/function/is-arguments":9,"es5-ext/string/is-string":44,"es6-symbol":58}],48:[function(require,module,exports){ -"use strict"; - -var clear = require("es5-ext/array/#/clear") - , assign = require("es5-ext/object/assign") - , callable = require("es5-ext/object/valid-callable") - , value = require("es5-ext/object/valid-value") - , d = require("d") - , autoBind = require("d/auto-bind") - , Symbol = require("es6-symbol"); - -var defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, Iterator; - -module.exports = Iterator = function (list, context) { - if (!(this instanceof Iterator)) throw new TypeError("Constructor requires 'new'"); - defineProperties(this, { - __list__: d("w", value(list)), - __context__: d("w", context), - __nextIndex__: d("w", 0) - }); - if (!context) return; - callable(context.on); - context.on("_add", this._onAdd); - context.on("_delete", this._onDelete); - context.on("_clear", this._onClear); -}; - -// Internal %IteratorPrototype% doesn't expose its constructor -delete Iterator.prototype.constructor; - -defineProperties( - Iterator.prototype, - assign( - { - _next: d(function () { - var i; - if (!this.__list__) return undefined; - if (this.__redo__) { - i = this.__redo__.shift(); - if (i !== undefined) return i; - } - if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; - this._unBind(); - return undefined; - }), - next: d(function () { - return this._createResult(this._next()); - }), - _createResult: d(function (i) { - if (i === undefined) return { done: true, value: undefined }; - return { done: false, value: this._resolve(i) }; - }), - _resolve: d(function (i) { - return this.__list__[i]; - }), - _unBind: d(function () { - this.__list__ = null; - delete this.__redo__; - if (!this.__context__) return; - this.__context__.off("_add", this._onAdd); - this.__context__.off("_delete", this._onDelete); - this.__context__.off("_clear", this._onClear); - this.__context__ = null; - }), - toString: d(function () { - return "[object " + (this[Symbol.toStringTag] || "Object") + "]"; - }) - }, - autoBind({ - _onAdd: d(function (index) { - if (index >= this.__nextIndex__) return; - ++this.__nextIndex__; - if (!this.__redo__) { - defineProperty(this, "__redo__", d("c", [index])); - return; - } - this.__redo__.forEach(function (redo, i) { - if (redo >= index) this.__redo__[i] = ++redo; - }, this); - this.__redo__.push(index); - }), - _onDelete: d(function (index) { - var i; - if (index >= this.__nextIndex__) return; - --this.__nextIndex__; - if (!this.__redo__) return; - i = this.__redo__.indexOf(index); - if (i !== -1) this.__redo__.splice(i, 1); - this.__redo__.forEach(function (redo, j) { - if (redo > index) this.__redo__[j] = --redo; - }, this); - }), - _onClear: d(function () { - if (this.__redo__) clear.call(this.__redo__); - this.__nextIndex__ = 0; - }) - }) - ) -); - -defineProperty( - Iterator.prototype, - Symbol.iterator, - d(function () { - return this; - }) -); - -},{"d":3,"d/auto-bind":2,"es5-ext/array/#/clear":4,"es5-ext/object/assign":21,"es5-ext/object/valid-callable":39,"es5-ext/object/valid-value":40,"es6-symbol":58}],49:[function(require,module,exports){ -"use strict"; - -var isArguments = require("es5-ext/function/is-arguments") - , isValue = require("es5-ext/object/is-value") - , isString = require("es5-ext/string/is-string"); - -var iteratorSymbol = require("es6-symbol").iterator - , isArray = Array.isArray; - -module.exports = function (value) { - if (!isValue(value)) return false; - if (isArray(value)) return true; - if (isString(value)) return true; - if (isArguments(value)) return true; - return typeof value[iteratorSymbol] === "function"; -}; - -},{"es5-ext/function/is-arguments":9,"es5-ext/object/is-value":29,"es5-ext/string/is-string":44,"es6-symbol":58}],50:[function(require,module,exports){ -// Thanks @mathiasbynens -// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols - -"use strict"; - -var setPrototypeOf = require("es5-ext/object/set-prototype-of") - , d = require("d") - , Symbol = require("es6-symbol") - , Iterator = require("./"); - -var defineProperty = Object.defineProperty, StringIterator; - -StringIterator = module.exports = function (str) { - if (!(this instanceof StringIterator)) throw new TypeError("Constructor requires 'new'"); - str = String(str); - Iterator.call(this, str); - defineProperty(this, "__length__", d("", str.length)); -}; -if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator); - -// Internal %ArrayIteratorPrototype% doesn't expose its constructor -delete StringIterator.prototype.constructor; - -StringIterator.prototype = Object.create(Iterator.prototype, { - _next: d(function () { - if (!this.__list__) return undefined; - if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++; - this._unBind(); - return undefined; - }), - _resolve: d(function (i) { - var char = this.__list__[i], code; - if (this.__nextIndex__ === this.__length__) return char; - code = char.charCodeAt(0); - if (code >= 0xd800 && code <= 0xdbff) return char + this.__list__[this.__nextIndex__++]; - return char; - }) -}); -defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); - -},{"./":48,"d":3,"es5-ext/object/set-prototype-of":36,"es6-symbol":58}],51:[function(require,module,exports){ -"use strict"; - -var isIterable = require("./is-iterable"); - -module.exports = function (value) { - if (!isIterable(value)) throw new TypeError(value + " is not iterable"); - return value; -}; - -},{"./is-iterable":49}],52:[function(require,module,exports){ -'use strict'; - -module.exports = require('./is-implemented')() ? Map : require('./polyfill'); - -},{"./is-implemented":53,"./polyfill":57}],53:[function(require,module,exports){ -'use strict'; - -module.exports = function () { - var map, iterator, result; - if (typeof Map !== 'function') return false; - try { - // WebKit doesn't support arguments and crashes - map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]); - } catch (e) { - return false; - } - if (String(map) !== '[object Map]') return false; - if (map.size !== 3) return false; - if (typeof map.clear !== 'function') return false; - if (typeof map.delete !== 'function') return false; - if (typeof map.entries !== 'function') return false; - if (typeof map.forEach !== 'function') return false; - if (typeof map.get !== 'function') return false; - if (typeof map.has !== 'function') return false; - if (typeof map.keys !== 'function') return false; - if (typeof map.set !== 'function') return false; - if (typeof map.values !== 'function') return false; - - iterator = map.entries(); - result = iterator.next(); - if (result.done !== false) return false; - if (!result.value) return false; - if (result.value[0] !== 'raz') return false; - if (result.value[1] !== 'one') return false; - - return true; -}; - -},{}],54:[function(require,module,exports){ -// Exports true if environment provides native `Map` implementation, -// whatever that is. - -'use strict'; - -module.exports = (function () { - if (typeof Map === 'undefined') return false; - return (Object.prototype.toString.call(new Map()) === '[object Map]'); -}()); - -},{}],55:[function(require,module,exports){ -'use strict'; - -module.exports = require('es5-ext/object/primitive-set')('key', - 'value', 'key+value'); - -},{"es5-ext/object/primitive-set":35}],56:[function(require,module,exports){ -'use strict'; - -var setPrototypeOf = require('es5-ext/object/set-prototype-of') - , d = require('d') - , Iterator = require('es6-iterator') - , toStringTagSymbol = require('es6-symbol').toStringTag - , kinds = require('./iterator-kinds') - - , defineProperties = Object.defineProperties - , unBind = Iterator.prototype._unBind - , MapIterator; - -MapIterator = module.exports = function (map, kind) { - if (!(this instanceof MapIterator)) return new MapIterator(map, kind); - Iterator.call(this, map.__mapKeysData__, map); - if (!kind || !kinds[kind]) kind = 'key+value'; - defineProperties(this, { - __kind__: d('', kind), - __values__: d('w', map.__mapValuesData__) - }); -}; -if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator); - -MapIterator.prototype = Object.create(Iterator.prototype, { - constructor: d(MapIterator), - _resolve: d(function (i) { - if (this.__kind__ === 'value') return this.__values__[i]; - if (this.__kind__ === 'key') return this.__list__[i]; - return [this.__list__[i], this.__values__[i]]; - }), - _unBind: d(function () { - this.__values__ = null; - unBind.call(this); - }), - toString: d(function () { return '[object Map Iterator]'; }) -}); -Object.defineProperty(MapIterator.prototype, toStringTagSymbol, - d('c', 'Map Iterator')); - -},{"./iterator-kinds":55,"d":3,"es5-ext/object/set-prototype-of":36,"es6-iterator":48,"es6-symbol":58}],57:[function(require,module,exports){ -'use strict'; - -var clear = require('es5-ext/array/#/clear') - , eIndexOf = require('es5-ext/array/#/e-index-of') - , setPrototypeOf = require('es5-ext/object/set-prototype-of') - , callable = require('es5-ext/object/valid-callable') - , validValue = require('es5-ext/object/valid-value') - , d = require('d') - , ee = require('event-emitter') - , Symbol = require('es6-symbol') - , iterator = require('es6-iterator/valid-iterable') - , forOf = require('es6-iterator/for-of') - , Iterator = require('./lib/iterator') - , isNative = require('./is-native-implemented') - - , call = Function.prototype.call - , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf - , MapPoly; - -module.exports = MapPoly = function (/*iterable*/) { - var iterable = arguments[0], keys, values, self; - if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\''); - if (isNative && setPrototypeOf && (Map !== MapPoly)) { - self = setPrototypeOf(new Map(), getPrototypeOf(this)); - } else { - self = this; - } - if (iterable != null) iterator(iterable); - defineProperties(self, { - __mapKeysData__: d('c', keys = []), - __mapValuesData__: d('c', values = []) - }); - if (!iterable) return self; - forOf(iterable, function (value) { - var key = validValue(value)[0]; - value = value[1]; - if (eIndexOf.call(keys, key) !== -1) return; - keys.push(key); - values.push(value); - }, self); - return self; -}; - -if (isNative) { - if (setPrototypeOf) setPrototypeOf(MapPoly, Map); - MapPoly.prototype = Object.create(Map.prototype, { - constructor: d(MapPoly) - }); -} - -ee(defineProperties(MapPoly.prototype, { - clear: d(function () { - if (!this.__mapKeysData__.length) return; - clear.call(this.__mapKeysData__); - clear.call(this.__mapValuesData__); - this.emit('_clear'); - }), - delete: d(function (key) { - var index = eIndexOf.call(this.__mapKeysData__, key); - if (index === -1) return false; - this.__mapKeysData__.splice(index, 1); - this.__mapValuesData__.splice(index, 1); - this.emit('_delete', index, key); - return true; - }), - entries: d(function () { return new Iterator(this, 'key+value'); }), - forEach: d(function (cb/*, thisArg*/) { - var thisArg = arguments[1], iterator, result; - callable(cb); - iterator = this.entries(); - result = iterator._next(); - while (result !== undefined) { - call.call(cb, thisArg, this.__mapValuesData__[result], - this.__mapKeysData__[result], this); - result = iterator._next(); - } - }), - get: d(function (key) { - var index = eIndexOf.call(this.__mapKeysData__, key); - if (index === -1) return; - return this.__mapValuesData__[index]; - }), - has: d(function (key) { - return (eIndexOf.call(this.__mapKeysData__, key) !== -1); - }), - keys: d(function () { return new Iterator(this, 'key'); }), - set: d(function (key, value) { - var index = eIndexOf.call(this.__mapKeysData__, key), emit; - if (index === -1) { - index = this.__mapKeysData__.push(key) - 1; - emit = true; - } - this.__mapValuesData__[index] = value; - if (emit) this.emit('_add', index, key); - return this; - }), - size: d.gs(function () { return this.__mapKeysData__.length; }), - values: d(function () { return new Iterator(this, 'value'); }), - toString: d(function () { return '[object Map]'; }) -})); -Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () { - return this.entries(); -})); -Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map')); - -},{"./is-native-implemented":54,"./lib/iterator":56,"d":3,"es5-ext/array/#/clear":4,"es5-ext/array/#/e-index-of":5,"es5-ext/object/set-prototype-of":36,"es5-ext/object/valid-callable":39,"es5-ext/object/valid-value":40,"es6-iterator/for-of":46,"es6-iterator/valid-iterable":51,"es6-symbol":58,"event-emitter":63}],58:[function(require,module,exports){ -'use strict'; - -module.exports = require('./is-implemented')() ? Symbol : require('./polyfill'); - -},{"./is-implemented":59,"./polyfill":61}],59:[function(require,module,exports){ -'use strict'; - -var validTypes = { object: true, symbol: true }; - -module.exports = function () { - var symbol; - if (typeof Symbol !== 'function') return false; - symbol = Symbol('test symbol'); - try { String(symbol); } catch (e) { return false; } - - // Return 'true' also for polyfills - if (!validTypes[typeof Symbol.iterator]) return false; - if (!validTypes[typeof Symbol.toPrimitive]) return false; - if (!validTypes[typeof Symbol.toStringTag]) return false; - - return true; -}; - -},{}],60:[function(require,module,exports){ -'use strict'; - -module.exports = function (x) { - if (!x) return false; - if (typeof x === 'symbol') return true; - if (!x.constructor) return false; - if (x.constructor.name !== 'Symbol') return false; - return (x[x.constructor.toStringTag] === 'Symbol'); -}; - -},{}],61:[function(require,module,exports){ -// ES2015 Symbol polyfill for environments that do not (or partially) support it - -'use strict'; - -var d = require('d') - , validateSymbol = require('./validate-symbol') - - , create = Object.create, defineProperties = Object.defineProperties - , defineProperty = Object.defineProperty, objPrototype = Object.prototype - , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) - , isNativeSafe; - -if (typeof Symbol === 'function') { - NativeSymbol = Symbol; - try { - String(NativeSymbol()); - isNativeSafe = true; - } catch (ignore) {} -} - -var generateName = (function () { - var created = create(null); - return function (desc) { - var postfix = 0, name, ie11BugWorkaround; - while (created[desc + (postfix || '')]) ++postfix; - desc += (postfix || ''); - created[desc] = true; - name = '@@' + desc; - defineProperty(objPrototype, name, d.gs(null, function (value) { - // For IE11 issue see: - // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ - // ie11-broken-getters-on-dom-objects - // https://github.com/medikoo/es6-symbol/issues/12 - if (ie11BugWorkaround) return; - ie11BugWorkaround = true; - defineProperty(this, name, d(value)); - ie11BugWorkaround = false; - })); - return name; - }; -}()); - -// Internal constructor (not one exposed) for creating Symbol instances. -// This one is used to ensure that `someSymbol instanceof Symbol` always return false -HiddenSymbol = function Symbol(description) { - if (this instanceof HiddenSymbol) throw new TypeError('Symbol is not a constructor'); - return SymbolPolyfill(description); -}; - -// Exposed `Symbol` constructor -// (returns instances of HiddenSymbol) -module.exports = SymbolPolyfill = function Symbol(description) { - var symbol; - if (this instanceof Symbol) throw new TypeError('Symbol is not a constructor'); - if (isNativeSafe) return NativeSymbol(description); - symbol = create(HiddenSymbol.prototype); - description = (description === undefined ? '' : String(description)); - return defineProperties(symbol, { - __description__: d('', description), - __name__: d('', generateName(description)) - }); -}; -defineProperties(SymbolPolyfill, { - for: d(function (key) { - if (globalSymbols[key]) return globalSymbols[key]; - return (globalSymbols[key] = SymbolPolyfill(String(key))); - }), - keyFor: d(function (s) { - var key; - validateSymbol(s); - for (key in globalSymbols) if (globalSymbols[key] === s) return key; - }), - - // To ensure proper interoperability with other native functions (e.g. Array.from) - // fallback to eventual native implementation of given symbol - hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), - isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || - SymbolPolyfill('isConcatSpreadable')), - iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), - match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), - replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), - search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), - species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), - split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), - toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), - toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), - unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) -}); - -// Internal tweaks for real symbol producer -defineProperties(HiddenSymbol.prototype, { - constructor: d(SymbolPolyfill), - toString: d('', function () { return this.__name__; }) -}); - -// Proper implementation of methods exposed on Symbol.prototype -// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype -defineProperties(SymbolPolyfill.prototype, { - toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), - valueOf: d(function () { return validateSymbol(this); }) -}); -defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { - var symbol = validateSymbol(this); - if (typeof symbol === 'symbol') return symbol; - return symbol.toString(); -})); -defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); - -// Proper implementaton of toPrimitive and toStringTag for returned symbol instances -defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, - d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); - -// Note: It's important to define `toPrimitive` as last one, as some implementations -// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) -// And that may invoke error in definition flow: -// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 -defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, - d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); - -},{"./validate-symbol":62,"d":3}],62:[function(require,module,exports){ -'use strict'; - -var isSymbol = require('./is-symbol'); - -module.exports = function (value) { - if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); - return value; -}; - -},{"./is-symbol":60}],63:[function(require,module,exports){ -'use strict'; - -var d = require('d') - , callable = require('es5-ext/object/valid-callable') - - , apply = Function.prototype.apply, call = Function.prototype.call - , create = Object.create, defineProperty = Object.defineProperty - , defineProperties = Object.defineProperties - , hasOwnProperty = Object.prototype.hasOwnProperty - , descriptor = { configurable: true, enumerable: false, writable: true } - - , on, once, off, emit, methods, descriptors, base; - -on = function (type, listener) { - var data; - - callable(listener); - - if (!hasOwnProperty.call(this, '__ee__')) { - data = descriptor.value = create(null); - defineProperty(this, '__ee__', descriptor); - descriptor.value = null; - } else { - data = this.__ee__; - } - if (!data[type]) data[type] = listener; - else if (typeof data[type] === 'object') data[type].push(listener); - else data[type] = [data[type], listener]; - - return this; -}; - -once = function (type, listener) { - var once, self; - - callable(listener); - self = this; - on.call(this, type, once = function () { - off.call(self, type, once); - apply.call(listener, this, arguments); - }); - - once.__eeOnceListener__ = listener; - return this; -}; - -off = function (type, listener) { - var data, listeners, candidate, i; - - callable(listener); - - if (!hasOwnProperty.call(this, '__ee__')) return this; - data = this.__ee__; - if (!data[type]) return this; - listeners = data[type]; - - if (typeof listeners === 'object') { - for (i = 0; (candidate = listeners[i]); ++i) { - if ((candidate === listener) || - (candidate.__eeOnceListener__ === listener)) { - if (listeners.length === 2) data[type] = listeners[i ? 0 : 1]; - else listeners.splice(i, 1); - } - } - } else { - if ((listeners === listener) || - (listeners.__eeOnceListener__ === listener)) { - delete data[type]; - } - } - - return this; -}; - -emit = function (type) { - var i, l, listener, listeners, args; - - if (!hasOwnProperty.call(this, '__ee__')) return; - listeners = this.__ee__[type]; - if (!listeners) return; - - if (typeof listeners === 'object') { - l = arguments.length; - args = new Array(l - 1); - for (i = 1; i < l; ++i) args[i - 1] = arguments[i]; - - listeners = listeners.slice(); - for (i = 0; (listener = listeners[i]); ++i) { - apply.call(listener, this, args); - } - } else { - switch (arguments.length) { - case 1: - call.call(listeners, this); - break; - case 2: - call.call(listeners, this, arguments[1]); - break; - case 3: - call.call(listeners, this, arguments[1], arguments[2]); - break; - default: - l = arguments.length; - args = new Array(l - 1); - for (i = 1; i < l; ++i) { - args[i - 1] = arguments[i]; - } - apply.call(listeners, this, args); - } - } -}; - -methods = { - on: on, - once: once, - off: off, - emit: emit -}; - -descriptors = { - on: d(on), - once: d(once), - off: d(off), - emit: d(emit) -}; - -base = defineProperties({}, descriptors); - -module.exports = exports = function (o) { - return (o == null) ? create(base) : defineProperties(Object(o), descriptors); -}; -exports.methods = methods; - -},{"d":3,"es5-ext/object/valid-callable":39}],64:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; - } - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - } else if (isObject(handler)) { - args = Array.prototype.slice.call(arguments, 1); - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.prototype.listenerCount = function(type) { - if (this._events) { - var evlistener = this._events[type]; - - if (isFunction(evlistener)) - return 1; - else if (evlistener) - return evlistener.length; - } - return 0; -}; - -EventEmitter.listenerCount = function(emitter, type) { - return emitter.listenerCount(type); -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} - -},{}],65:[function(require,module,exports){ -'use strict'; -var toString = Object.prototype.toString; - -module.exports = function (x) { - var prototype; - return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); -}; - -},{}],66:[function(require,module,exports){ -'use strict'; -module.exports = function (re) { - return Object.prototype.toString.call(re) === '[object RegExp]'; -}; - -},{}],67:[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":170,"./_root":216}],68:[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 == null ? 0 : entries.length; - - 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":179,"./_hashDelete":180,"./_hashGet":181,"./_hashHas":182,"./_hashSet":183}],69:[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 == null ? 0 : entries.length; - - 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":195,"./_listCacheDelete":196,"./_listCacheGet":197,"./_listCacheHas":198,"./_listCacheSet":199}],70:[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":170,"./_root":216}],71:[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 == null ? 0 : entries.length; - - 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":200,"./_mapCacheDelete":201,"./_mapCacheGet":202,"./_mapCacheHas":203,"./_mapCacheSet":204}],72:[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":170,"./_root":216}],73:[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":170,"./_root":216}],74:[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 == null ? 0 : values.length; - - 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":71,"./_setCacheAdd":217,"./_setCacheHas":218}],75:[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":69,"./_stackClear":222,"./_stackDelete":223,"./_stackGet":224,"./_stackHas":225,"./_stackSet":226}],76:[function(require,module,exports){ -var root = require('./_root'); - -/** Built-in value references. */ -var Symbol = root.Symbol; - -module.exports = Symbol; - -},{"./_root":216}],77:[function(require,module,exports){ -var root = require('./_root'); - -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; - -module.exports = Uint8Array; - -},{"./_root":216}],78:[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":170,"./_root":216}],79:[function(require,module,exports){ -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -module.exports = addMapEntry; - -},{}],80:[function(require,module,exports){ -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; -} - -module.exports = addSetEntry; - -},{}],81:[function(require,module,exports){ -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -module.exports = apply; - -},{}],82:[function(require,module,exports){ -/** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ -function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; -} - -module.exports = arrayAggregator; - -},{}],83:[function(require,module,exports){ -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEach; - -},{}],84:[function(require,module,exports){ -/** - * A specialized version of `_.every` 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 all elements pass the predicate check, - * else `false`. - */ -function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; -} - -module.exports = arrayEvery; - -},{}],85:[function(require,module,exports){ -/** - * A specialized version of `_.filter` 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 {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; -} - -module.exports = arrayFilter; - -},{}],86:[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":134,"./_isIndex":187,"./isArguments":257,"./isArray":258,"./isBuffer":261,"./isTypedArray":273}],87:[function(require,module,exports){ -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -module.exports = arrayMap; - -},{}],88:[function(require,module,exports){ -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -module.exports = arrayPush; - -},{}],89:[function(require,module,exports){ -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -module.exports = arrayReduce; - -},{}],90:[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 == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; -} - -module.exports = arraySome; - -},{}],91:[function(require,module,exports){ -/** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function asciiToArray(string) { - return string.split(''); -} - -module.exports = asciiToArray; - -},{}],92:[function(require,module,exports){ -var baseAssignValue = require('./_baseAssignValue'), - eq = require('./eq'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } -} - -module.exports = assignValue; - -},{"./_baseAssignValue":97,"./eq":242}],93:[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":242}],94:[function(require,module,exports){ -var baseEach = require('./_baseEach'); - -/** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ -function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; -} - -module.exports = baseAggregator; - -},{"./_baseEach":101}],95:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - keys = require('./keys'); - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -module.exports = baseAssign; - -},{"./_copyObject":151,"./keys":274}],96:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - keysIn = require('./keysIn'); - -/** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); -} - -module.exports = baseAssignIn; - -},{"./_copyObject":151,"./keysIn":275}],97:[function(require,module,exports){ -var defineProperty = require('./_defineProperty'); - -/** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } -} - -module.exports = baseAssignValue; - -},{"./_defineProperty":161}],98:[function(require,module,exports){ -var Stack = require('./_Stack'), - arrayEach = require('./_arrayEach'), - assignValue = require('./_assignValue'), - baseAssign = require('./_baseAssign'), - baseAssignIn = require('./_baseAssignIn'), - cloneBuffer = require('./_cloneBuffer'), - copyArray = require('./_copyArray'), - copySymbols = require('./_copySymbols'), - copySymbolsIn = require('./_copySymbolsIn'), - getAllKeys = require('./_getAllKeys'), - getAllKeysIn = require('./_getAllKeysIn'), - getTag = require('./_getTag'), - initCloneArray = require('./_initCloneArray'), - initCloneByTag = require('./_initCloneByTag'), - initCloneObject = require('./_initCloneObject'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isObject = require('./isObject'), - keys = require('./keys'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - 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 supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; -} - -module.exports = baseClone; - -},{"./_Stack":75,"./_arrayEach":83,"./_assignValue":92,"./_baseAssign":95,"./_baseAssignIn":96,"./_cloneBuffer":143,"./_copyArray":150,"./_copySymbols":152,"./_copySymbolsIn":153,"./_getAllKeys":166,"./_getAllKeysIn":167,"./_getTag":175,"./_initCloneArray":184,"./_initCloneByTag":185,"./_initCloneObject":186,"./isArray":258,"./isBuffer":261,"./isObject":268,"./keys":274}],99:[function(require,module,exports){ -var isObject = require('./isObject'); - -/** Built-in value references. */ -var objectCreate = Object.create; - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); - -module.exports = baseCreate; - -},{"./isObject":268}],100:[function(require,module,exports){ -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ -function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); -} - -module.exports = baseDelay; - -},{}],101:[function(require,module,exports){ -var baseForOwn = require('./_baseForOwn'), - createBaseEach = require('./_createBaseEach'); - -/** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEach = createBaseEach(baseForOwn); - -module.exports = baseEach; - -},{"./_baseForOwn":106,"./_createBaseEach":157}],102:[function(require,module,exports){ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ -function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; -} - -module.exports = baseEvery; - -},{"./_baseEach":101}],103:[function(require,module,exports){ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; -} - -module.exports = baseFilter; - -},{"./_baseEach":101}],104:[function(require,module,exports){ -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -module.exports = baseFindIndex; - -},{}],105:[function(require,module,exports){ -var createBaseFor = require('./_createBaseFor'); - -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -module.exports = baseFor; - -},{"./_createBaseFor":158}],106:[function(require,module,exports){ -var baseFor = require('./_baseFor'), - keys = require('./keys'); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -module.exports = baseForOwn; - -},{"./_baseFor":105,"./keys":274}],107:[function(require,module,exports){ -var castPath = require('./_castPath'), - toKey = require('./_toKey'); - -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} - -module.exports = baseGet; - -},{"./_castPath":140,"./_toKey":230}],108:[function(require,module,exports){ -var arrayPush = require('./_arrayPush'), - isArray = require('./isArray'); - -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} - -module.exports = baseGetAllKeys; - -},{"./_arrayPush":88,"./isArray":258}],109:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - getRawTag = require('./_getRawTag'), - objectToString = require('./_objectToString'); - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -module.exports = baseGetTag; - -},{"./_Symbol":76,"./_getRawTag":172,"./_objectToString":212}],110:[function(require,module,exports){ -/** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHasIn(object, key) { - return object != null && key in Object(object); -} - -module.exports = baseHasIn; - -},{}],111:[function(require,module,exports){ -var baseFindIndex = require('./_baseFindIndex'), - baseIsNaN = require('./_baseIsNaN'), - strictIndexOf = require('./_strictIndexOf'); - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); -} - -module.exports = baseIndexOf; - -},{"./_baseFindIndex":104,"./_baseIsNaN":117,"./_strictIndexOf":227}],112:[function(require,module,exports){ -var apply = require('./_apply'), - castPath = require('./_castPath'), - last = require('./last'), - parent = require('./_parent'), - toKey = require('./_toKey'); - -/** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ -function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); -} - -module.exports = baseInvoke; - -},{"./_apply":81,"./_castPath":140,"./_parent":215,"./_toKey":230,"./last":276}],113:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; - -/** - * 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) && baseGetTag(value) == argsTag; -} - -module.exports = baseIsArguments; - -},{"./_baseGetTag":109,"./isObjectLike":269}],114:[function(require,module,exports){ -var baseIsEqualDeep = require('./_baseIsEqualDeep'), - 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 {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ -function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); -} - -module.exports = baseIsEqual; - -},{"./_baseIsEqualDeep":115,"./isObjectLike":269}],115:[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 value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** `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 {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - 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, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_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, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); -} - -module.exports = baseIsEqualDeep; - -},{"./_Stack":75,"./_equalArrays":162,"./_equalByTag":163,"./_equalObjects":164,"./_getTag":175,"./isArray":258,"./isBuffer":261,"./isTypedArray":273}],116:[function(require,module,exports){ -var Stack = require('./_Stack'), - baseIsEqual = require('./_baseIsEqual'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; -} - -module.exports = baseIsMatch; - -},{"./_Stack":75,"./_baseIsEqual":114}],117:[function(require,module,exports){ -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -module.exports = baseIsNaN; - -},{}],118:[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":191,"./_toSource":231,"./isFunction":265,"./isObject":268}],119:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var regexpTag = '[object RegExp]'; - -/** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ -function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; -} - -module.exports = baseIsRegExp; - -},{"./_baseGetTag":109,"./isObjectLike":269}],120:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - 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; - -/** - * 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[baseGetTag(value)]; -} - -module.exports = baseIsTypedArray; - -},{"./_baseGetTag":109,"./isLength":266,"./isObjectLike":269}],121:[function(require,module,exports){ -var baseMatches = require('./_baseMatches'), - baseMatchesProperty = require('./_baseMatchesProperty'), - identity = require('./identity'), - isArray = require('./isArray'), - property = require('./property'); - -/** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ -function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); -} - -module.exports = baseIteratee; - -},{"./_baseMatches":125,"./_baseMatchesProperty":126,"./identity":254,"./isArray":258,"./property":280}],122:[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":192,"./_nativeKeys":209}],123:[function(require,module,exports){ -var isObject = require('./isObject'), - isPrototype = require('./_isPrototype'), - nativeKeysIn = require('./_nativeKeysIn'); - -/** 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 `_.keysIn` 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 baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = baseKeysIn; - -},{"./_isPrototype":192,"./_nativeKeysIn":210,"./isObject":268}],124:[function(require,module,exports){ -var baseEach = require('./_baseEach'), - isArrayLike = require('./isArrayLike'); - -/** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; -} - -module.exports = baseMap; - -},{"./_baseEach":101,"./isArrayLike":259}],125:[function(require,module,exports){ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'), - matchesStrictComparable = require('./_matchesStrictComparable'); - -/** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; -} - -module.exports = baseMatches; - -},{"./_baseIsMatch":116,"./_getMatchData":169,"./_matchesStrictComparable":206}],126:[function(require,module,exports){ -var baseIsEqual = require('./_baseIsEqual'), - get = require('./get'), - hasIn = require('./hasIn'), - isKey = require('./_isKey'), - isStrictComparable = require('./_isStrictComparable'), - matchesStrictComparable = require('./_matchesStrictComparable'), - toKey = require('./_toKey'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; -} - -module.exports = baseMatchesProperty; - -},{"./_baseIsEqual":114,"./_isKey":189,"./_isStrictComparable":193,"./_matchesStrictComparable":206,"./_toKey":230,"./get":251,"./hasIn":253}],127:[function(require,module,exports){ -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -module.exports = baseProperty; - -},{}],128:[function(require,module,exports){ -var baseGet = require('./_baseGet'); - -/** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; -} - -module.exports = basePropertyDeep; - -},{"./_baseGet":107}],129:[function(require,module,exports){ -/** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ -function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; -} - -module.exports = baseReduce; - -},{}],130:[function(require,module,exports){ -var identity = require('./identity'), - overRest = require('./_overRest'), - setToString = require('./_setToString'); - -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); -} - -module.exports = baseRest; - -},{"./_overRest":214,"./_setToString":220,"./identity":254}],131:[function(require,module,exports){ -var constant = require('./constant'), - defineProperty = require('./_defineProperty'), - identity = require('./identity'); - -/** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; - -module.exports = baseSetToString; - -},{"./_defineProperty":161,"./constant":238,"./identity":254}],132:[function(require,module,exports){ -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; - -},{}],133:[function(require,module,exports){ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection 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 baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; -} - -module.exports = baseSome; - -},{"./_baseEach":101}],134:[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; - -},{}],135:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - arrayMap = require('./_arrayMap'), - isArray = require('./isArray'), - isSymbol = require('./isSymbol'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -module.exports = baseToString; - -},{"./_Symbol":76,"./_arrayMap":87,"./isArray":258,"./isSymbol":272}],136:[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; - -},{}],137:[function(require,module,exports){ -var arrayMap = require('./_arrayMap'); - -/** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ -function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); -} - -module.exports = baseValues; - -},{"./_arrayMap":87}],138:[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; - -},{}],139:[function(require,module,exports){ -var identity = require('./identity'); - -/** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ -function castFunction(value) { - return typeof value == 'function' ? value : identity; -} - -module.exports = castFunction; - -},{"./identity":254}],140:[function(require,module,exports){ -var isArray = require('./isArray'), - isKey = require('./_isKey'), - stringToPath = require('./_stringToPath'), - toString = require('./toString'); - -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); -} - -module.exports = castPath; - -},{"./_isKey":189,"./_stringToPath":229,"./isArray":258,"./toString":291}],141:[function(require,module,exports){ -var baseSlice = require('./_baseSlice'); - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -module.exports = castSlice; - -},{"./_baseSlice":132}],142:[function(require,module,exports){ -var Uint8Array = require('./_Uint8Array'); - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -module.exports = cloneArrayBuffer; - -},{"./_Uint8Array":77}],143:[function(require,module,exports){ -var root = require('./_root'); - -/** 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, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; -} - -module.exports = cloneBuffer; - -},{"./_root":216}],144:[function(require,module,exports){ -var cloneArrayBuffer = require('./_cloneArrayBuffer'); - -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} - -module.exports = cloneDataView; - -},{"./_cloneArrayBuffer":142}],145:[function(require,module,exports){ -var addMapEntry = require('./_addMapEntry'), - arrayReduce = require('./_arrayReduce'), - mapToArray = require('./_mapToArray'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); -} - -module.exports = cloneMap; - -},{"./_addMapEntry":79,"./_arrayReduce":89,"./_mapToArray":205}],146:[function(require,module,exports){ -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -module.exports = cloneRegExp; - -},{}],147:[function(require,module,exports){ -var addSetEntry = require('./_addSetEntry'), - arrayReduce = require('./_arrayReduce'), - setToArray = require('./_setToArray'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); -} - -module.exports = cloneSet; - -},{"./_addSetEntry":80,"./_arrayReduce":89,"./_setToArray":219}],148:[function(require,module,exports){ -var Symbol = require('./_Symbol'); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - -module.exports = cloneSymbol; - -},{"./_Symbol":76}],149:[function(require,module,exports){ -var cloneArrayBuffer = require('./_cloneArrayBuffer'); - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -module.exports = cloneTypedArray; - -},{"./_cloneArrayBuffer":142}],150:[function(require,module,exports){ -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -module.exports = copyArray; - -},{}],151:[function(require,module,exports){ -var assignValue = require('./_assignValue'), - baseAssignValue = require('./_baseAssignValue'); - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; -} - -module.exports = copyObject; - -},{"./_assignValue":92,"./_baseAssignValue":97}],152:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - getSymbols = require('./_getSymbols'); - -/** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -module.exports = copySymbols; - -},{"./_copyObject":151,"./_getSymbols":173}],153:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - getSymbolsIn = require('./_getSymbolsIn'); - -/** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); -} - -module.exports = copySymbolsIn; - -},{"./_copyObject":151,"./_getSymbolsIn":174}],154:[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":216}],155:[function(require,module,exports){ -var arrayAggregator = require('./_arrayAggregator'), - baseAggregator = require('./_baseAggregator'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ -function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, baseIteratee(iteratee, 2), accumulator); - }; -} - -module.exports = createAggregator; - -},{"./_arrayAggregator":82,"./_baseAggregator":94,"./_baseIteratee":121,"./isArray":258}],156:[function(require,module,exports){ -var baseRest = require('./_baseRest'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); -} - -module.exports = createAssigner; - -},{"./_baseRest":130,"./_isIterateeCall":188}],157:[function(require,module,exports){ -var isArrayLike = require('./isArrayLike'); - -/** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; -} - -module.exports = createBaseEach; - -},{"./isArrayLike":259}],158:[function(require,module,exports){ -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -module.exports = createBaseFor; - -},{}],159:[function(require,module,exports){ -var castSlice = require('./_castSlice'), - hasUnicode = require('./_hasUnicode'), - stringToArray = require('./_stringToArray'), - toString = require('./toString'); - -/** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ -function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; -} - -module.exports = createCaseFirst; - -},{"./_castSlice":141,"./_hasUnicode":178,"./_stringToArray":228,"./toString":291}],160:[function(require,module,exports){ -var baseIteratee = require('./_baseIteratee'), - isArrayLike = require('./isArrayLike'), - keys = require('./keys'); - -/** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ -function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = baseIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; -} - -module.exports = createFind; - -},{"./_baseIteratee":121,"./isArrayLike":259,"./keys":274}],161:[function(require,module,exports){ -var getNative = require('./_getNative'); - -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); - -module.exports = defineProperty; - -},{"./_getNative":170}],162:[function(require,module,exports){ -var SetCache = require('./_SetCache'), - arraySome = require('./_arraySome'), - cacheHas = require('./_cacheHas'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_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 {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ -function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_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 & COMPARE_UNORDERED_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, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; -} - -module.exports = equalArrays; - -},{"./_SetCache":74,"./_arraySome":90,"./_cacheHas":138}],163:[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 value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_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 {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @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, bitmask, customizer, equalFunc, 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 & COMPARE_PARTIAL_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 |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; -} - -module.exports = equalByTag; - -},{"./_Symbol":76,"./_Uint8Array":77,"./_equalArrays":162,"./_mapToArray":205,"./_setToArray":219,"./eq":242}],164:[function(require,module,exports){ -var getAllKeys = require('./_getAllKeys'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** 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 {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(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, bitmask, customizer, 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; - -},{"./_getAllKeys":166}],165:[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 : {}) -},{}],166:[function(require,module,exports){ -var baseGetAllKeys = require('./_baseGetAllKeys'), - getSymbols = require('./_getSymbols'), - keys = require('./keys'); - -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} - -module.exports = getAllKeys; - -},{"./_baseGetAllKeys":108,"./_getSymbols":173,"./keys":274}],167:[function(require,module,exports){ -var baseGetAllKeys = require('./_baseGetAllKeys'), - getSymbolsIn = require('./_getSymbolsIn'), - keysIn = require('./keysIn'); - -/** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); -} - -module.exports = getAllKeysIn; - -},{"./_baseGetAllKeys":108,"./_getSymbolsIn":174,"./keysIn":275}],168:[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":190}],169:[function(require,module,exports){ -var isStrictComparable = require('./_isStrictComparable'), - keys = require('./keys'); - -/** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ -function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; -} - -module.exports = getMatchData; - -},{"./_isStrictComparable":193,"./keys":274}],170:[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":118,"./_getValue":176}],171:[function(require,module,exports){ -var overArg = require('./_overArg'); - -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); - -module.exports = getPrototype; - -},{"./_overArg":213}],172:[function(require,module,exports){ -var Symbol = require('./_Symbol'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -module.exports = getRawTag; - -},{"./_Symbol":76}],173:[function(require,module,exports){ -var arrayFilter = require('./_arrayFilter'), - stubArray = require('./stubArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; - -/** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); -}; - -module.exports = getSymbols; - -},{"./_arrayFilter":85,"./stubArray":284}],174:[function(require,module,exports){ -var arrayPush = require('./_arrayPush'), - getPrototype = require('./_getPrototype'), - getSymbols = require('./_getSymbols'), - stubArray = require('./stubArray'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; - -/** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; -}; - -module.exports = getSymbolsIn; - -},{"./_arrayPush":88,"./_getPrototype":171,"./_getSymbols":173,"./stubArray":284}],175:[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 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 = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - 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":67,"./_Map":70,"./_Promise":72,"./_Set":73,"./_WeakMap":78,"./_baseGetTag":109,"./_toSource":231}],176:[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; - -},{}],177:[function(require,module,exports){ -var castPath = require('./_castPath'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isIndex = require('./_isIndex'), - isLength = require('./isLength'), - toKey = require('./_toKey'); - -/** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ -function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); -} - -module.exports = hasPath; - -},{"./_castPath":140,"./_isIndex":187,"./_toKey":230,"./isArguments":257,"./isArray":258,"./isLength":266}],178:[function(require,module,exports){ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - -/** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ -function hasUnicode(string) { - return reHasUnicode.test(string); -} - -module.exports = hasUnicode; - -},{}],179:[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":208}],180:[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; - -},{}],181:[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":208}],182:[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":208}],183:[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":208}],184:[function(require,module,exports){ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -module.exports = initCloneArray; - -},{}],185:[function(require,module,exports){ -var cloneArrayBuffer = require('./_cloneArrayBuffer'), - cloneDataView = require('./_cloneDataView'), - cloneMap = require('./_cloneMap'), - cloneRegExp = require('./_cloneRegExp'), - cloneSet = require('./_cloneSet'), - cloneSymbol = require('./_cloneSymbol'), - cloneTypedArray = require('./_cloneTypedArray'); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - 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]', - 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]'; - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } -} - -module.exports = initCloneByTag; - -},{"./_cloneArrayBuffer":142,"./_cloneDataView":144,"./_cloneMap":145,"./_cloneRegExp":146,"./_cloneSet":147,"./_cloneSymbol":148,"./_cloneTypedArray":149}],186:[function(require,module,exports){ -var baseCreate = require('./_baseCreate'), - getPrototype = require('./_getPrototype'), - isPrototype = require('./_isPrototype'); - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} - -module.exports = initCloneObject; - -},{"./_baseCreate":99,"./_getPrototype":171,"./_isPrototype":192}],187:[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; - -},{}],188:[function(require,module,exports){ -var eq = require('./eq'), - isArrayLike = require('./isArrayLike'), - isIndex = require('./_isIndex'), - isObject = require('./isObject'); - -/** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; -} - -module.exports = isIterateeCall; - -},{"./_isIndex":187,"./eq":242,"./isArrayLike":259,"./isObject":268}],189:[function(require,module,exports){ -var isArray = require('./isArray'), - isSymbol = require('./isSymbol'); - -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; - -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); -} - -module.exports = isKey; - -},{"./isArray":258,"./isSymbol":272}],190:[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; - -},{}],191:[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":154}],192:[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; - -},{}],193:[function(require,module,exports){ -var isObject = require('./isObject'); - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && !isObject(value); -} - -module.exports = isStrictComparable; - -},{"./isObject":268}],194:[function(require,module,exports){ -/** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ -function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; -} - -module.exports = iteratorToArray; - -},{}],195:[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; - -},{}],196:[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":93}],197:[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":93}],198:[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":93}],199:[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":93}],200:[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":68,"./_ListCache":69,"./_Map":70}],201:[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":168}],202:[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":168}],203:[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":168}],204:[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":168}],205:[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; - -},{}],206:[function(require,module,exports){ -/** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; -} - -module.exports = matchesStrictComparable; - -},{}],207:[function(require,module,exports){ -var memoize = require('./memoize'); - -/** Used as the maximum memoize cache size. */ -var MAX_MEMOIZE_SIZE = 500; - -/** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ -function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; -} - -module.exports = memoizeCapped; - -},{"./memoize":278}],208:[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":170}],209:[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":213}],210:[function(require,module,exports){ -/** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; -} - -module.exports = nativeKeysIn; - -},{}],211:[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 && freeProcess.binding('util'); - } catch (e) {} -}()); - -module.exports = nodeUtil; - -},{"./_freeGlobal":165}],212:[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 nativeObjectToString = objectProto.toString; - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -module.exports = objectToString; - -},{}],213:[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; - -},{}],214:[function(require,module,exports){ -var apply = require('./_apply'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ -function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; -} - -module.exports = overRest; - -},{"./_apply":81}],215:[function(require,module,exports){ -var baseGet = require('./_baseGet'), - baseSlice = require('./_baseSlice'); - -/** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ -function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); -} - -module.exports = parent; - -},{"./_baseGet":107,"./_baseSlice":132}],216:[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":165}],217:[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; - -},{}],218:[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; - -},{}],219:[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; - -},{}],220:[function(require,module,exports){ -var baseSetToString = require('./_baseSetToString'), - shortOut = require('./_shortOut'); - -/** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ -var setToString = shortOut(baseSetToString); - -module.exports = setToString; - -},{"./_baseSetToString":131,"./_shortOut":221}],221:[function(require,module,exports){ -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 800, - HOT_SPAN = 16; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeNow = Date.now; - -/** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ -function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; -} - -module.exports = shortOut; - -},{}],222:[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":69}],223:[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; - -},{}],224:[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; - -},{}],225:[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; - -},{}],226:[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":69,"./_Map":70,"./_MapCache":71}],227:[function(require,module,exports){ -/** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -module.exports = strictIndexOf; - -},{}],228:[function(require,module,exports){ -var asciiToArray = require('./_asciiToArray'), - hasUnicode = require('./_hasUnicode'), - unicodeToArray = require('./_unicodeToArray'); - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); -} - -module.exports = stringToArray; - -},{"./_asciiToArray":91,"./_hasUnicode":178,"./_unicodeToArray":232}],229:[function(require,module,exports){ -var memoizeCapped = require('./_memoizeCapped'); - -/** Used to match property names within property paths. */ -var reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; - -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -var stringToPath = memoizeCapped(function(string) { - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); - -module.exports = stringToPath; - -},{"./_memoizeCapped":207}],230:[function(require,module,exports){ -var isSymbol = require('./isSymbol'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -module.exports = toKey; - -},{"./isSymbol":272}],231:[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 convert. - * @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; - -},{}],232:[function(require,module,exports){ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function unicodeToArray(string) { - return string.match(reUnicode) || []; -} - -module.exports = unicodeToArray; - -},{}],233:[function(require,module,exports){ -var assignValue = require('./_assignValue'), - copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - isArrayLike = require('./isArrayLike'), - isPrototype = require('./_isPrototype'), - keys = require('./keys'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ -var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } -}); - -module.exports = assign; - -},{"./_assignValue":92,"./_copyObject":151,"./_createAssigner":156,"./_isPrototype":192,"./isArrayLike":259,"./keys":274}],234:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - keysIn = require('./keysIn'); - -/** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ -var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); -}); - -module.exports = assignIn; - -},{"./_copyObject":151,"./_createAssigner":156,"./keysIn":275}],235:[function(require,module,exports){ -var toString = require('./toString'), - upperFirst = require('./upperFirst'); - -/** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ -function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); -} - -module.exports = capitalize; - -},{"./toString":291,"./upperFirst":293}],236:[function(require,module,exports){ -var baseClone = require('./_baseClone'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_SYMBOLS_FLAG = 4; - -/** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ -function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); -} - -module.exports = clone; - -},{"./_baseClone":98}],237:[function(require,module,exports){ -/** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ -function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; -} - -module.exports = compact; - -},{}],238:[function(require,module,exports){ -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ -function constant(value) { - return function() { - return value; - }; -} - -module.exports = constant; - -},{}],239:[function(require,module,exports){ -var baseDelay = require('./_baseDelay'), - baseRest = require('./_baseRest'); - -/** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ -var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); -}); - -module.exports = defer; - -},{"./_baseDelay":100,"./_baseRest":130}],240:[function(require,module,exports){ -var baseDelay = require('./_baseDelay'), - baseRest = require('./_baseRest'), - toNumber = require('./toNumber'); - -/** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ -var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); -}); - -module.exports = delay; - -},{"./_baseDelay":100,"./_baseRest":130,"./toNumber":290}],241:[function(require,module,exports){ -module.exports = require('./forEach'); - -},{"./forEach":250}],242:[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; - -},{}],243:[function(require,module,exports){ -var arrayEvery = require('./_arrayEvery'), - baseEvery = require('./_baseEvery'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ -function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = every; - -},{"./_arrayEvery":84,"./_baseEvery":102,"./_baseIteratee":121,"./_isIterateeCall":188,"./isArray":258}],244:[function(require,module,exports){ -module.exports = require('./assignIn'); - -},{"./assignIn":234}],245:[function(require,module,exports){ -var arrayFilter = require('./_arrayFilter'), - baseFilter = require('./_baseFilter'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - */ -function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = filter; - -},{"./_arrayFilter":85,"./_baseFilter":103,"./_baseIteratee":121,"./isArray":258}],246:[function(require,module,exports){ -var createFind = require('./_createFind'), - findIndex = require('./findIndex'); - -/** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ -var find = createFind(findIndex); - -module.exports = find; - -},{"./_createFind":160,"./findIndex":247}],247:[function(require,module,exports){ -var baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ -function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, baseIteratee(predicate, 3), index); -} - -module.exports = findIndex; - -},{"./_baseFindIndex":104,"./_baseIteratee":121,"./toInteger":289}],248:[function(require,module,exports){ -var createFind = require('./_createFind'), - findLastIndex = require('./findLastIndex'); - -/** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ -var findLast = createFind(findLastIndex); - -module.exports = findLast; - -},{"./_createFind":160,"./findLastIndex":249}],249:[function(require,module,exports){ -var baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ -function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, baseIteratee(predicate, 3), index, true); -} - -module.exports = findLastIndex; - -},{"./_baseFindIndex":104,"./_baseIteratee":121,"./toInteger":289}],250:[function(require,module,exports){ -var arrayEach = require('./_arrayEach'), - baseEach = require('./_baseEach'), - castFunction = require('./_castFunction'), - isArray = require('./isArray'); - -/** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ -function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, castFunction(iteratee)); -} - -module.exports = forEach; - -},{"./_arrayEach":83,"./_baseEach":101,"./_castFunction":139,"./isArray":258}],251:[function(require,module,exports){ -var baseGet = require('./_baseGet'); - -/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; -} - -module.exports = get; - -},{"./_baseGet":107}],252:[function(require,module,exports){ -var baseAssignValue = require('./_baseAssignValue'), - createAggregator = require('./_createAggregator'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ -var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } -}); - -module.exports = groupBy; - -},{"./_baseAssignValue":97,"./_createAggregator":155}],253:[function(require,module,exports){ -var baseHasIn = require('./_baseHasIn'), - hasPath = require('./_hasPath'); - -/** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ -function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); -} - -module.exports = hasIn; - -},{"./_baseHasIn":110,"./_hasPath":177}],254:[function(require,module,exports){ -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -module.exports = identity; - -},{}],255:[function(require,module,exports){ -var baseIndexOf = require('./_baseIndexOf'), - isArrayLike = require('./isArrayLike'), - isString = require('./isString'), - toInteger = require('./toInteger'), - values = require('./values'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ -function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); -} - -module.exports = includes; - -},{"./_baseIndexOf":111,"./isArrayLike":259,"./isString":271,"./toInteger":289,"./values":294}],256:[function(require,module,exports){ -var baseInvoke = require('./_baseInvoke'), - baseRest = require('./_baseRest'); - -/** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ -var invoke = baseRest(baseInvoke); - -module.exports = invoke; - -},{"./_baseInvoke":112,"./_baseRest":130}],257:[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":113,"./isObjectLike":269}],258:[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; - -},{}],259:[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":265,"./isLength":266}],260:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]'; - -/** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ -function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); -} - -module.exports = isBoolean; - -},{"./_baseGetTag":109,"./isObjectLike":269}],261:[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":216,"./stubFalse":285}],262:[function(require,module,exports){ -var baseKeys = require('./_baseKeys'), - getTag = require('./_getTag'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isArrayLike = require('./isArrayLike'), - isBuffer = require('./isBuffer'), - isPrototype = require('./_isPrototype'), - isTypedArray = require('./isTypedArray'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - setTag = '[object Set]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ -function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; -} - -module.exports = isEmpty; - -},{"./_baseKeys":122,"./_getTag":175,"./_isPrototype":192,"./isArguments":257,"./isArray":258,"./isArrayLike":259,"./isBuffer":261,"./isTypedArray":273}],263:[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 compared by strict equality, i.e. `===`. - * - * @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":114}],264:[function(require,module,exports){ -var baseIsEqual = require('./_baseIsEqual'); - -/** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ -function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; -} - -module.exports = isEqualWith; - -},{"./_baseIsEqual":114}],265:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObject = require('./isObject'); - -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; - -/** - * 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) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} - -module.exports = isFunction; - -},{"./_baseGetTag":109,"./isObject":268}],266:[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; - -},{}],267:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var numberTag = '[object Number]'; - -/** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ -function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); -} - -module.exports = isNumber; - -},{"./_baseGetTag":109,"./isObjectLike":269}],268:[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; - -},{}],269:[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; - -},{}],270:[function(require,module,exports){ -var baseIsRegExp = require('./_baseIsRegExp'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; - -/** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ -var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - -module.exports = isRegExp; - -},{"./_baseIsRegExp":119,"./_baseUnary":136,"./_nodeUtil":211}],271:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isArray = require('./isArray'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var stringTag = '[object String]'; - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); -} - -module.exports = isString; - -},{"./_baseGetTag":109,"./isArray":258,"./isObjectLike":269}],272:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); -} - -module.exports = isSymbol; - -},{"./_baseGetTag":109,"./isObjectLike":269}],273:[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":120,"./_baseUnary":136,"./_nodeUtil":211}],274:[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":86,"./_baseKeys":122,"./isArrayLike":259}],275:[function(require,module,exports){ -var arrayLikeKeys = require('./_arrayLikeKeys'), - baseKeysIn = require('./_baseKeysIn'), - isArrayLike = require('./isArrayLike'); - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @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; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); -} - -module.exports = keysIn; - -},{"./_arrayLikeKeys":86,"./_baseKeysIn":123,"./isArrayLike":259}],276:[function(require,module,exports){ -/** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ -function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; -} - -module.exports = last; - -},{}],277:[function(require,module,exports){ -var arrayMap = require('./_arrayMap'), - baseIteratee = require('./_baseIteratee'), - baseMap = require('./_baseMap'), - isArray = require('./isArray'); - -/** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ -function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, baseIteratee(iteratee, 3)); -} - -module.exports = map; - -},{"./_arrayMap":87,"./_baseIteratee":121,"./_baseMap":124,"./isArray":258}],278:[function(require,module,exports){ -var MapCache = require('./_MapCache'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; -} - -// Expose `MapCache`. -memoize.Cache = MapCache; - -module.exports = memoize; - -},{"./_MapCache":71}],279:[function(require,module,exports){ -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ -function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; -} - -module.exports = negate; - -},{}],280:[function(require,module,exports){ -var baseProperty = require('./_baseProperty'), - basePropertyDeep = require('./_basePropertyDeep'), - isKey = require('./_isKey'), - toKey = require('./_toKey'); - -/** - * Creates a function that returns the value at `path` of a given object. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - * @example - * - * var objects = [ - * { 'a': { 'b': 2 } }, - * { 'a': { 'b': 1 } } - * ]; - * - * _.map(objects, _.property('a.b')); - * // => [2, 1] - * - * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); - * // => [1, 2] - */ -function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); -} - -module.exports = property; - -},{"./_baseProperty":127,"./_basePropertyDeep":128,"./_isKey":189,"./_toKey":230}],281:[function(require,module,exports){ -var arrayReduce = require('./_arrayReduce'), - baseEach = require('./_baseEach'), - baseIteratee = require('./_baseIteratee'), - baseReduce = require('./_baseReduce'), - isArray = require('./isArray'); - -/** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ -function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); -} - -module.exports = reduce; - -},{"./_arrayReduce":89,"./_baseEach":101,"./_baseIteratee":121,"./_baseReduce":129,"./isArray":258}],282:[function(require,module,exports){ -var arrayFilter = require('./_arrayFilter'), - baseFilter = require('./_baseFilter'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'), - negate = require('./negate'); - -/** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] - */ -function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(baseIteratee(predicate, 3))); -} - -module.exports = reject; - -},{"./_arrayFilter":85,"./_baseFilter":103,"./_baseIteratee":121,"./isArray":258,"./negate":279}],283:[function(require,module,exports){ -var arraySome = require('./_arraySome'), - baseIteratee = require('./_baseIteratee'), - baseSome = require('./_baseSome'), - isArray = require('./isArray'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ -function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = some; - -},{"./_arraySome":90,"./_baseIteratee":121,"./_baseSome":133,"./_isIterateeCall":188,"./isArray":258}],284:[function(require,module,exports){ -/** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ -function stubArray() { - return []; -} - -module.exports = stubArray; - -},{}],285:[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; - -},{}],286:[function(require,module,exports){ -/** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ -function tap(value, interceptor) { - interceptor(value); - return value; -} - -module.exports = tap; - -},{}],287:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - copyArray = require('./_copyArray'), - getTag = require('./_getTag'), - isArrayLike = require('./isArrayLike'), - isString = require('./isString'), - iteratorToArray = require('./_iteratorToArray'), - mapToArray = require('./_mapToArray'), - setToArray = require('./_setToArray'), - stringToArray = require('./_stringToArray'), - values = require('./values'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - setTag = '[object Set]'; - -/** Built-in value references. */ -var symIterator = Symbol ? Symbol.iterator : undefined; - -/** - * Converts `value` to an array. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ -function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - - return func(value); -} - -module.exports = toArray; - -},{"./_Symbol":76,"./_copyArray":150,"./_getTag":175,"./_iteratorToArray":194,"./_mapToArray":205,"./_setToArray":219,"./_stringToArray":228,"./isArrayLike":259,"./isString":271,"./values":294}],288:[function(require,module,exports){ -var toNumber = require('./toNumber'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308; - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -module.exports = toFinite; - -},{"./toNumber":290}],289:[function(require,module,exports){ -var toFinite = require('./toFinite'); - -/** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -module.exports = toInteger; - -},{"./toFinite":288}],290:[function(require,module,exports){ -var isObject = require('./isObject'), - isSymbol = require('./isSymbol'); - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = toNumber; - -},{"./isObject":268,"./isSymbol":272}],291:[function(require,module,exports){ -var baseToString = require('./_baseToString'); - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -module.exports = toString; - -},{"./_baseToString":135}],292:[function(require,module,exports){ -var arrayEach = require('./_arrayEach'), - baseCreate = require('./_baseCreate'), - baseForOwn = require('./_baseForOwn'), - baseIteratee = require('./_baseIteratee'), - getPrototype = require('./_getPrototype'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isFunction = require('./isFunction'), - isObject = require('./isObject'), - isTypedArray = require('./isTypedArray'); - -/** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ -function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); - - iteratee = baseIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; -} - -module.exports = transform; - -},{"./_arrayEach":83,"./_baseCreate":99,"./_baseForOwn":106,"./_baseIteratee":121,"./_getPrototype":171,"./isArray":258,"./isBuffer":261,"./isFunction":265,"./isObject":268,"./isTypedArray":273}],293:[function(require,module,exports){ -var createCaseFirst = require('./_createCaseFirst'); - -/** - * Converts the first character of `string` to upper case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.upperFirst('fred'); - * // => 'Fred' - * - * _.upperFirst('FRED'); - * // => 'FRED' - */ -var upperFirst = createCaseFirst('toUpperCase'); - -module.exports = upperFirst; - -},{"./_createCaseFirst":159}],294:[function(require,module,exports){ -var baseValues = require('./_baseValues'), - keys = require('./keys'); - -/** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ -function values(object) { - return object == null ? [] : baseValues(object, keys(object)); -} - -module.exports = values; - -},{"./_baseValues":137,"./keys":274}],295:[function(require,module,exports){ -(function (process){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":296}],296:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],297:[function(require,module,exports){ -'use strict'; -var isRegexp = require('is-regexp'); -var isPlainObj = require('is-plain-obj'); - -module.exports = function (val, opts, pad) { - var seen = []; - - return (function stringify(val, opts, pad) { - opts = opts || {}; - opts.indent = opts.indent || '\t'; - pad = pad || ''; - var tokens; - if(opts.inlineCharacterLimit == void 0) { - tokens = { - newLine: '\n', - newLineOrSpace: '\n', - pad: pad, - indent: pad + opts.indent - }; - } else { - tokens = { - newLine: '@@__STRINGIFY_OBJECT_NEW_LINE__@@', - newLineOrSpace: '@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@', - pad: '@@__STRINGIFY_OBJECT_PAD__@@', - indent: '@@__STRINGIFY_OBJECT_INDENT__@@' - } - } - var expandWhiteSpace = function(string) { - if (opts.inlineCharacterLimit == void 0) { return string; } - var oneLined = string. - replace(new RegExp(tokens.newLine, 'g'), ''). - replace(new RegExp(tokens.newLineOrSpace, 'g'), ' '). - replace(new RegExp(tokens.pad + '|' + tokens.indent, 'g'), ''); - - if(oneLined.length <= opts.inlineCharacterLimit) { - return oneLined; - } else { - return string. - replace(new RegExp(tokens.newLine + '|' + tokens.newLineOrSpace, 'g'), '\n'). - replace(new RegExp(tokens.pad, 'g'), pad). - replace(new RegExp(tokens.indent, 'g'), pad + opts.indent); - } - }; - - if (seen.indexOf(val) !== -1) { - return '"[Circular]"'; - } - - if (val === null || - val === undefined || - typeof val === 'number' || - typeof val === 'boolean' || - typeof val === 'function' || - isRegexp(val)) { - return String(val); - } - - if (val instanceof Date) { - return 'new Date(\'' + val.toISOString() + '\')'; - } - - if (Array.isArray(val)) { - if (val.length === 0) { - return '[]'; - } - - seen.push(val); - - var ret = '[' + tokens.newLine + val.map(function (el, i) { - var eol = val.length - 1 === i ? tokens.newLine : ',' + tokens.newLineOrSpace; - var value = stringify(el, opts, pad + opts.indent); - if (opts.transform) { - value = opts.transform(val, i, value); - } - return tokens.indent + value + eol; - }).join('') + tokens.pad + ']'; - - seen.pop(val); - - return expandWhiteSpace(ret); - } - - if (isPlainObj(val)) { - var objKeys = Object.keys(val); - - if (objKeys.length === 0) { - return '{}'; - } - - seen.push(val); - - var ret = '{' + tokens.newLine + objKeys.map(function (el, i) { - if (opts.filter && !opts.filter(val, el)) { - return ''; - } - - var eol = objKeys.length - 1 === i ? tokens.newLine : ',' + tokens.newLineOrSpace; - var key = /^[a-z$_][a-z$_0-9]*$/i.test(el) ? el : stringify(el, opts); - var value = stringify(val[el], opts, pad + opts.indent); - if (opts.transform) { - value = opts.transform(val, el, value); - } - return tokens.indent + String(key) + ': ' + value + eol; - }).join('') + tokens.pad + '}'; - - seen.pop(val); - - return expandWhiteSpace(ret); - } - - val = String(val).replace(/[\r\n]/g, function (x) { - return x === '\n' ? '\\n' : '\\r'; - }); - - if (opts.singleQuotes === false) { - return '"' + val.replace(/"/g, '\\\"') + '"'; - } - - return '\'' + val.replace(/'/g, '\\\'') + '\''; - })(val, opts, pad); -}; - -},{"is-plain-obj":65,"is-regexp":66}],298:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _isMatcher = require('./matchers/is-matcher'); - -var _isMatcher2 = _interopRequireDefault(_isMatcher); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (expectedArgs, actualArgs) { - var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - if (arityMismatch(expectedArgs, actualArgs, config)) { - return false; - } else if (config.allowMatchers !== false) { - return equalsWithMatchers(expectedArgs, actualArgs); - } else { - return _lodash2.default.isEqual(expectedArgs, actualArgs); - } -}; - -var arityMismatch = function arityMismatch(expectedArgs, actualArgs, config) { - return expectedArgs.length !== actualArgs.length && !config.ignoreExtraArgs; -}; - -var equalsWithMatchers = function equalsWithMatchers(expectedArgs, actualArgs) { - return _lodash2.default.every(expectedArgs, function (expectedArg, key) { - return argumentMatchesExpectation(expectedArg, actualArgs[key]); - }); -}; - -var argumentMatchesExpectation = function argumentMatchesExpectation(expectedArg, actualArg) { - if ((0, _isMatcher2.default)(expectedArg)) { - return matcherTestFor(expectedArg)(actualArg); - } else { - return _lodash2.default.isEqualWith(expectedArg, actualArg, function (expectedEl, actualEl) { - if ((0, _isMatcher2.default)(expectedEl)) { - return matcherTestFor(expectedEl)(actualEl); - } - }); - } -}; - -var matcherTestFor = function matcherTestFor(matcher) { - return matcher.__matches; -}; - -},{"./matchers/is-matcher":325,"./wrap/lodash":340}],299:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _create = require('./matchers/create'); - -var _create2 = _interopRequireDefault(_create); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var callback = (0, _create2.default)({ - name: 'callback', - matches: function matches(matcherArgs, actual) { - return _lodash2.default.isFunction(actual); - }, - onCreate: function onCreate(matcherInstance, matcherArgs) { - matcherInstance.args = matcherArgs; - matcherInstance.__testdouble_callback = true; - } -}); - -// Make callback itself quack like a matcher for its non-invoked use case. -callback.__name = 'callback'; -callback.__matches = _lodash2.default.isFunction; - -exports.default = callback; - -},{"./matchers/create":322,"./wrap/lodash":340}],300:[function(require,module,exports){ -(function (global){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _log = require('./log'); - -var _log2 = _interopRequireDefault(_log); - -var _anything = require('./stringify/anything'); - -var _anything2 = _interopRequireDefault(_anything); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var DEFAULTS = { - ignoreWarnings: false, - promiseConstructor: global.Promise, - suppressErrors: false -}; -var DELETED_OPTIONS = ['extendWhenReplacingConstructors']; - -var configData = _lodash2.default.extend({}, DEFAULTS); - -exports.default = _lodash2.default.tap(function (overrides) { - deleteDeletedOptions(overrides); - ensureOverridesExist(overrides); - return _lodash2.default.extend(configData, overrides); -}, function (config) { - config.reset = function () { - configData = _lodash2.default.extend({}, DEFAULTS); - }; -}); - - -var deleteDeletedOptions = function deleteDeletedOptions(overrides) { - _lodash2.default.each(overrides, function (val, key) { - if (_lodash2.default.includes(DELETED_OPTIONS, key)) { - _log2.default.warn('td.config', '"' + key + '" is no longer a valid configuration key. Remove it from your calls to td.config() or it may throw an error in the future. For more information, try hunting around our GitHub repo for it:\n\n https://github.com/testdouble/testdouble.js/search?q=' + key); - delete overrides[key]; - } - }); -}; - -var ensureOverridesExist = function ensureOverridesExist(overrides) { - _lodash2.default.each(overrides, function (val, key) { - if (!configData.hasOwnProperty(key)) { - _log2.default.error('td.config', '"' + key + '" is not a valid configuration key (valid keys are: ' + (0, _anything2.default)(_lodash2.default.keys(configData)) + ')'); - } - }); -}; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./log":315,"./stringify/anything":335,"./wrap/lodash":340}],301:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _function = require('./function'); - -var _function2 = _interopRequireDefault(_function); - -var _imitate = require('./imitate'); - -var _imitate2 = _interopRequireDefault(_imitate); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (typeOrNames) { - return _lodash2.default.isFunction(typeOrNames) ? (0, _imitate2.default)(typeOrNames) : fakeConstructorFromNames(typeOrNames); -}; - -var fakeConstructorFromNames = function fakeConstructorFromNames(funcNames) { - return _lodash2.default.tap((0, _function2.default)('(unnamed constructor)'), function (fakeConstructor) { - fakeConstructor.prototype.toString = function () { - return '[test double instance of constructor]'; - }; - - _lodash2.default.each(funcNames, function (funcName) { - fakeConstructor.prototype[funcName] = (0, _function2.default)('#' + String(funcName)); - }); - }); -}; - -},{"./function":303,"./imitate":305,"./wrap/lodash":340}],302:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _calls = require('./store/calls'); - -var _calls2 = _interopRequireDefault(_calls); - -var _store = require('./store'); - -var _store2 = _interopRequireDefault(_store); - -var _arguments = require('./stringify/arguments'); - -var _arguments2 = _interopRequireDefault(_arguments); - -var _stubbings = require('./store/stubbings'); - -var _stubbings2 = _interopRequireDefault(_stubbings); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (testDouble) { - if (_store2.default.for(testDouble, false) == null) { - return nullDescription(); - } - var calls = _calls2.default.for(testDouble); - var stubs = _stubbings2.default.for(testDouble); - - return { - name: _store2.default.for(testDouble).name, - callCount: calls.length, - calls: calls, - description: testdoubleDescription(testDouble, stubs, calls) + stubbingDescription(stubs) + callDescription(calls), - isTestDouble: true - }; -}; - -var nullDescription = function nullDescription() { - return { - name: undefined, - callCount: 0, - calls: [], - description: 'This is not a test double.', - isTestDouble: false - }; -}; - -var testdoubleDescription = function testdoubleDescription(testDouble, stubs, calls) { - return 'This test double ' + stringifyName(testDouble) + 'has ' + stubs.length + ' stubbings and ' + calls.length + ' invocations.'; -}; - -var stubbingDescription = function stubbingDescription(stubs) { - return stubs.length > 0 ? _lodash2.default.reduce(stubs, function (desc, stub) { - return desc + ('\n - when called with `(' + (0, _arguments2.default)(stub.args) + ')`, then ' + planFor(stub) + ' ' + argsFor(stub) + '.'); - }, '\n\nStubbings:') : ''; -}; - -var planFor = function planFor(stub) { - switch (stub.config.plan) { - case 'thenCallback': - return 'callback'; - case 'thenResolve': - return 'resolve'; - case 'thenReject': - return 'reject'; - default: - return 'return'; - } -}; - -var argsFor = function argsFor(stub) { - switch (stub.config.plan) { - case 'thenCallback': - return '`(' + (0, _arguments2.default)(stub.stubbedValues, ', ') + ')`'; - default: - return (0, _arguments2.default)(stub.stubbedValues, ', then ', '`'); - } -}; - -var callDescription = function callDescription(calls) { - return calls.length > 0 ? _lodash2.default.reduce(calls, function (desc, call) { - return desc + ('\n - called with `(' + (0, _arguments2.default)(call.args) + ')`.'); - }, '\n\nInvocations:') : ''; -}; - -var stringifyName = function stringifyName(testDouble) { - var name = _store2.default.for(testDouble).name; - return name ? '`' + name + '` ' : ''; -}; - -},{"./store":333,"./store/calls":332,"./store/stubbings":334,"./stringify/arguments":336,"./wrap/lodash":340}],303:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _calls = require('./store/calls'); - -var _calls2 = _interopRequireDefault(_calls); - -var _store = require('./store'); - -var _store2 = _interopRequireDefault(_store); - -var _stubbings = require('./store/stubbings'); - -var _stubbings2 = _interopRequireDefault(_stubbings); - -var _imitate = require('./imitate'); - -var _imitate2 = _interopRequireDefault(_imitate); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (nameOrFunc, __optionalName) { - return _lodash2.default.isFunction(nameOrFunc) ? (0, _imitate2.default)(nameOrFunc) : createTestDoubleNamed(nameOrFunc || __optionalName); -}; - -var createTestDoubleNamed = function createTestDoubleNamed(name) { - return _lodash2.default.tap(createTestDoubleFunction(), function (testDouble) { - var entry = _store2.default.for(testDouble, true); - if (name != null) { - entry.name = name; - testDouble.toString = function () { - return '[test double for "' + name + '"]'; - }; - } else { - testDouble.toString = function () { - return '[test double (unnamed)]'; - }; - } - }); -}; - -var createTestDoubleFunction = function createTestDoubleFunction() { - return function testDouble() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - _calls2.default.log(testDouble, args, this); - return _stubbings2.default.invoke(testDouble, args, this); - }; -}; - -},{"./imitate":305,"./store":333,"./store/calls":332,"./store/stubbings":334,"./wrap/lodash":340}],304:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _function = require('../function'); - -var _function2 = _interopRequireDefault(_function); - -var _isGenerator = require('./is-generator'); - -var _isGenerator2 = _interopRequireDefault(_isGenerator); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (original, names) { - if (_lodash2.default.isArray(original) || _lodash2.default.isArguments(original)) { - return []; - } else if (_lodash2.default.isFunction(original)) { - if ((0, _isGenerator2.default)(original)) { - return original; - } else { - // TODO: this will become src/function/create and include parent reference instead of name joining here - return (0, _function2.default)(_lodash2.default.map(names, String).join('') || '(anonymous function)'); - } - } else { - return _lodash2.default.clone(original); - } -}; - -},{"../function":303,"../wrap/lodash":340,"./is-generator":307}],305:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = imitate; - -var _es6Map = require('es6-map'); - -var _es6Map2 = _interopRequireDefault(_es6Map); - -var _initializeNames = require('./initialize-names'); - -var _initializeNames2 = _interopRequireDefault(_initializeNames); - -var _createImitation = require('./create-imitation'); - -var _createImitation2 = _interopRequireDefault(_createImitation); - -var _overwriteChildren = require('./overwrite-children'); - -var _overwriteChildren2 = _interopRequireDefault(_overwriteChildren); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function imitate(original, names) { - var encounteredObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new _es6Map2.default(); - - if (encounteredObjects.has(original)) return encounteredObjects.get(original); - names = (0, _initializeNames2.default)(original, names); - var target = (0, _createImitation2.default)(original, names); - encounteredObjects.set(original, target); - (0, _overwriteChildren2.default)(original, target, function (originalValue, name) { - return imitate(originalValue, names.concat(name), encounteredObjects); - }); - return target; -} - -},{"./create-imitation":304,"./initialize-names":306,"./overwrite-children":311,"es6-map":52}],306:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (original, names) { - if (names != null) return names; - if (_lodash2.default.isFunction(original) && original.name) { - return [original.name]; - } else { - return []; - } -}; - -},{"../wrap/lodash":340}],307:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var generatorsAreSupported = function () { - try { - eval('(function* () {})'); // eslint-disable-line - return true; - } catch (e) { - return false; - } -}(); - -var GeneratorFunction = function () { - if (!generatorsAreSupported) return; - var func = eval('(function* () {})'); // eslint-disable-line - return Object.getPrototypeOf(func).constructor; -}(); - -exports.default = function (func) { - return generatorsAreSupported && func.constructor === GeneratorFunction; -}; - -},{}],308:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (original, target, name, originalValue, targetValue) { - if (name !== 'prototype' || !_lodash2.default.isFunction(original)) return targetValue; - - targetValue.__proto__ = originalValue; // eslint-disable-line - targetValue.constructor = target; - return targetValue; -}; - -},{"../../wrap/lodash":340}],309:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (target, props, visitor) { - Object.defineProperties(target, _lodash2.default.transform(props, function (acc, descriptor, name) { - if (propOnTargetAndNotWritable(target, name, descriptor)) { - if (name === 'prototype') { - // Functions' prototype is not configurable but is assignable: - target.prototype = newValue(name, descriptor.value, visitor); - } - } else { - acc[name] = { - configurable: true, - writable: true, - value: newValue(name, descriptor.value, visitor), - enumerable: descriptor.enumerable - }; - } - })); -}; - -var propOnTargetAndNotWritable = function propOnTargetAndNotWritable(target, name, originalDescriptor) { - var targetDescriptor = Object.getOwnPropertyDescriptor(target, name); - if (targetDescriptor && (!targetDescriptor.writable || !targetDescriptor.configurable)) { - return true; - } -}; - -var newValue = function newValue(name, value, visitor) { - return visitor ? visitor(name, value) : value; -}; - -},{"../../wrap/lodash":340}],310:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = gatherProps; - -var _isFakeable = require('./is-fakeable'); - -var _isFakeable2 = _interopRequireDefault(_isFakeable); - -var _isNativePrototype = require('./is-native-prototype'); - -var _isNativePrototype2 = _interopRequireDefault(_isNativePrototype); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function gatherProps(thing) { - var props = {}; - while ((0, _isFakeable2.default)(thing) && !(0, _isNativePrototype2.default)(thing)) { - Object.getOwnPropertyNames(thing).forEach(function (propName) { - if (!props[propName] && propName !== 'constructor') { - props[propName] = Object.getOwnPropertyDescriptor(thing, propName); - } - }); - thing = Object.getPrototypeOf(thing); - } - return props; -} - -},{"./is-fakeable":312,"./is-native-prototype":313}],311:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _isFakeable = require('./is-fakeable'); - -var _isFakeable2 = _interopRequireDefault(_isFakeable); - -var _gatherProps = require('./gather-props'); - -var _gatherProps2 = _interopRequireDefault(_gatherProps); - -var _copyProps = require('./copy-props'); - -var _copyProps2 = _interopRequireDefault(_copyProps); - -var _chainPrototype = require('./chain-prototype'); - -var _chainPrototype2 = _interopRequireDefault(_chainPrototype); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (original, target, overwriteChild) { - if (!(0, _isFakeable2.default)(target)) return; - - if (_lodash2.default.isArray(target)) { - _lodash2.default.each(original, function (item, index) { - return target.push(overwriteChild(item, '[' + index + ']')); - }); - } else { - (0, _copyProps2.default)(target, (0, _gatherProps2.default)(original), function (name, originalValue) { - return (0, _chainPrototype2.default)(original, target, name, originalValue, overwriteChild(originalValue, '.' + name)); - }); - } -}; - -},{"../../wrap/lodash":340,"./chain-prototype":308,"./copy-props":309,"./gather-props":310,"./is-fakeable":312}],312:[function(require,module,exports){ -(function (global){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _isGenerator = require('../is-generator'); - -var _isGenerator2 = _interopRequireDefault(_isGenerator); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (thing) { - return !(!_lodash2.default.isObject(thing) || isBoxedType(thing) || (0, _isGenerator2.default)(thing)); -}; - -var isBoxedType = function isBoxedType(thing) { - return _lodash2.default.compact([Boolean, Date, Number, RegExp, String, global.Symbol]).some(function (type) { - return thing instanceof type; - }); -}; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../../wrap/lodash":340,"../is-generator":307}],313:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isNativePrototype; - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isNativePrototype(thing) { - if (thing == null || !_lodash2.default.isFunction(thing.isPrototypeOf)) return false; - return _lodash2.default.some([Object, Function], function (nativeType) { - return thing.isPrototypeOf(nativeType); - }); -} - -},{"../../wrap/lodash":340}],314:[function(require,module,exports){ -'use strict'; - -var _function = require('./function'); - -var _function2 = _interopRequireDefault(_function); - -var _object = require('./object'); - -var _object2 = _interopRequireDefault(_object); - -var _constructor = require('./constructor'); - -var _constructor2 = _interopRequireDefault(_constructor); - -var _when = require('./when'); - -var _when2 = _interopRequireDefault(_when); - -var _verify = require('./verify'); - -var _verify2 = _interopRequireDefault(_verify); - -var _matchers = require('./matchers'); - -var _matchers2 = _interopRequireDefault(_matchers); - -var _replace = require('./replace'); - -var _replace2 = _interopRequireDefault(_replace); - -var _explain = require('./explain'); - -var _explain2 = _interopRequireDefault(_explain); - -var _reset = require('./reset'); - -var _reset2 = _interopRequireDefault(_reset); - -var _config = require('./config'); - -var _config2 = _interopRequireDefault(_config); - -var _callback = require('./callback'); - -var _callback2 = _interopRequireDefault(_callback); - -var _version = require('./version'); - -var _version2 = _interopRequireDefault(_version); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = { - function: _function2.default, - func: _function2.default, - object: _object2.default, - constructor: _constructor2.default, - when: _when2.default, - verify: _verify2.default, - matchers: _matchers2.default, - replace: _replace2.default, - explain: _explain2.default, - reset: _reset2.default, - config: _config2.default, - callback: _callback2.default, - version: _version2.default -}; - -},{"./callback":299,"./config":300,"./constructor":301,"./explain":302,"./function":303,"./matchers":323,"./object":327,"./replace":328,"./reset":331,"./verify":337,"./version":338,"./when":339}],315:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _config = require('./config'); - -var _config2 = _interopRequireDefault(_config); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - warn: function warn(func, msg, url) { - if (!(0, _config2.default)().ignoreWarnings && (typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.warn) { - console.warn('Warning: testdouble.js - ' + func + ' - ' + msg + withUrl(url)); - } - }, - error: function error(func, msg, url) { - if (!(0, _config2.default)().suppressErrors) { - throw new Error('Error: testdouble.js - ' + func + ' - ' + msg + withUrl(url)); - } - }, - fail: function fail(msg) { - throw new Error(msg); - } -}; - - -var withUrl = function withUrl(url) { - return url != null ? ' (see: ' + url + ' )' : ''; -}; - -},{"./config":300}],316:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _create = require('../create'); - -var _create2 = _interopRequireDefault(_create); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = (0, _create2.default)({ - name: 'anything', - matches: function matches() { - return true; - } -}); - -},{"../create":322}],317:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _create = require('../create'); - -var _create2 = _interopRequireDefault(_create); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = (0, _create2.default)({ - name: 'argThat', - matches: function matches(matcherArgs, actual) { - var predicate = matcherArgs[0]; - return predicate(actual); - } -}); - -},{"../create":322}],318:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _create = require('../create'); - -var _create2 = _interopRequireDefault(_create); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function () { - var captor = { - capture: (0, _create2.default)({ - name: 'captor.capture', - matches: function matches(matcherArgs, actual) { - return true; - }, - afterSatisfaction: function afterSatisfaction(matcherArgs, actual) { - captor.values = captor.values || []; - captor.values.push(actual); - captor.value = actual; - } - }) - }; - return captor; -}; - -},{"../create":322}],319:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _create = require('../create'); - -var _create2 = _interopRequireDefault(_create); - -var _isMatcher = require('../is-matcher'); - -var _isMatcher2 = _interopRequireDefault(_isMatcher); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = (0, _create2.default)({ - name: 'contains', - matches: function matches(containings, actualArg) { - if (containings.length === 0) return false; - - return _lodash2.default.every(containings, function (containing) { - return argumentContains(containing, actualArg); - }); - } -}); - - -var argumentContains = function argumentContains(containing, actualArg) { - if (_lodash2.default.isArray(containing)) { - return _lodash2.default.some(actualArg, function (actualElement) { - return _lodash2.default.isEqual(actualElement, containing); - }); - } else if (_lodash2.default.isRegExp(containing)) { - return containing.test(actualArg); - } else if ((0, _isMatcher2.default)(containing)) { - return _lodash2.default.some(actualArg, containing.__matches); - } else if (_lodash2.default.isObjectLike(containing) && _lodash2.default.isObjectLike(actualArg)) { - return containsPartialObject(containing, actualArg); - } else { - return _lodash2.default.includes(actualArg, containing); - } -}; - -var containsPartialObject = function containsPartialObject(containing, actual) { - return actual != null && _lodash2.default.every(containing, function (val, key) { - if ((0, _isMatcher2.default)(val)) { - return val.__matches(actual[key]); - } else if (_lodash2.default.isObjectLike(val)) { - return containsPartialObject(val, actual[key]); - } else { - return _lodash2.default.isEqual(val, actual[key]); - } - }); -}; - -},{"../../wrap/lodash":340,"../create":322,"../is-matcher":325}],320:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _create = require('../create'); - -var _create2 = _interopRequireDefault(_create); - -var _arguments = require('../../stringify/arguments'); - -var _arguments2 = _interopRequireDefault(_arguments); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = (0, _create2.default)({ - name: function name(matcherArgs) { - var desc = _lodash2.default.get(matcherArgs[0], 'name') || (0, _arguments2.default)(matcherArgs); - return 'isA(' + desc + ')'; - }, - matches: function matches(matcherArgs, actual) { - var type = matcherArgs[0]; - - if (type === Number) { - return _lodash2.default.isNumber(actual); - } else if (type === String) { - return _lodash2.default.isString(actual); - } else if (type === Boolean) { - return _lodash2.default.isBoolean(actual); - } else { - return actual instanceof type; - } - } -}); - -},{"../../stringify/arguments":336,"../../wrap/lodash":340,"../create":322}],321:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _create = require('../create'); - -var _create2 = _interopRequireDefault(_create); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = (0, _create2.default)({ - name: 'not', - matches: function matches(matcherArgs, actual) { - var expected = matcherArgs[0]; - return !_lodash2.default.isEqual(expected, actual); - } -}); - -},{"../../wrap/lodash":340,"../create":322}],322:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _arguments = require('../stringify/arguments'); - -var _arguments2 = _interopRequireDefault(_arguments); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (config) { - return function () { - for (var _len = arguments.length, matcherArgs = Array(_len), _key = 0; _key < _len; _key++) { - matcherArgs[_key] = arguments[_key]; - } - - return _lodash2.default.tap({ - __name: nameFor(config, matcherArgs), - __matches: function __matches(actualArg) { - return config.matches(matcherArgs, actualArg); - } - }, function (matcherInstance) { - matcherInstance.__matches.afterSatisfaction = function (actualArg) { - _lodash2.default.invoke(config, 'afterSatisfaction', matcherArgs, actualArg); - }; - _lodash2.default.invoke(config, 'onCreate', matcherInstance, matcherArgs); - }); - }; -}; - -var nameFor = function nameFor(config, matcherArgs) { - if (_lodash2.default.isFunction(config.name)) { - return config.name(matcherArgs); - } else if (config.name != null) { - return config.name + '(' + (0, _arguments2.default)(matcherArgs) + ')'; - } else { - return '[Matcher for (' + (0, _arguments2.default)(matcherArgs) + ')]'; - } -}; - -},{"../stringify/arguments":336,"../wrap/lodash":340}],323:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _create = require('./create'); - -var _create2 = _interopRequireDefault(_create); - -var _captor = require('./builtin/captor'); - -var _captor2 = _interopRequireDefault(_captor); - -var _isA = require('./builtin/is-a'); - -var _isA2 = _interopRequireDefault(_isA); - -var _contains = require('./builtin/contains'); - -var _contains2 = _interopRequireDefault(_contains); - -var _anything = require('./builtin/anything'); - -var _anything2 = _interopRequireDefault(_anything); - -var _argThat = require('./builtin/arg-that'); - -var _argThat2 = _interopRequireDefault(_argThat); - -var _not = require('./builtin/not'); - -var _not2 = _interopRequireDefault(_not); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - create: _create2.default, - captor: _captor2.default, - isA: _isA2.default, - anything: _anything2.default, - contains: _contains2.default, - argThat: _argThat2.default, - not: _not2.default -}; - -},{"./builtin/anything":316,"./builtin/arg-that":317,"./builtin/captor":318,"./builtin/contains":319,"./builtin/is-a":320,"./builtin/not":321,"./create":322}],324:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isCallback; - -var _callback = require('../callback'); - -var _callback2 = _interopRequireDefault(_callback); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isCallback(obj) { - return obj && (obj === _callback2.default || obj.__testdouble_callback === true); -} - -},{"../callback":299}],325:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (thing) { - return thing && thing.__matches; -}; - -},{}],326:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = notifyAfterSatisfaction; - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _isMatcher = require('./is-matcher'); - -var _isMatcher2 = _interopRequireDefault(_isMatcher); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// TODO: after rewrite, update signature to take (Stubbing/Verification, Call) -function notifyAfterSatisfaction(expectedArgs, actualArgs) { - _lodash2.default.each(expectedArgs, function (expectedArg, i) { - if ((0, _isMatcher2.default)(expectedArg)) { - _lodash2.default.invoke(expectedArg, '__matches.afterSatisfaction', actualArgs[i]); - } - }); -} - -},{"../wrap/lodash":340,"./is-matcher":325}],327:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = object; - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _log = require('./log'); - -var _log2 = _interopRequireDefault(_log); - -var _function = require('./function'); - -var _function2 = _interopRequireDefault(_function); - -var _imitate = require('./imitate'); - -var _imitate2 = _interopRequireDefault(_imitate); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var DEFAULT_OPTIONS = { excludeMethods: ['then'] }; - -function object(nameOrType, config) { - return _lodash2.default.tap(fakeObject(nameOrType, config, arguments.length), function (obj) { - addToStringToDouble(obj, nameOrType); - }); -} - -var fakeObject = function fakeObject(nameOrType, config, argCount) { - if (_lodash2.default.isArray(nameOrType)) { - return createTestDoublesForFunctionNames(nameOrType); - } else if (_lodash2.default.isObjectLike(nameOrType)) { - return (0, _imitate2.default)(nameOrType); - } else if (_lodash2.default.isString(nameOrType) || argCount === 0) { - return createTestDoubleViaProxy(nameOrType, withDefaults(config)); - } else if (_lodash2.default.isFunction(nameOrType)) { - ensureFunctionIsNotPassed(); - } else { - ensureOtherGarbageIsNotPassed(); - } -}; - -var createTestDoublesForFunctionNames = function createTestDoublesForFunctionNames(names) { - return _lodash2.default.transform(names, function (acc, funcName) { - acc[funcName] = (0, _function2.default)('.' + String(funcName)); - }); -}; - -var createTestDoubleViaProxy = function createTestDoubleViaProxy(name, config) { - ensureProxySupport(name); - var obj = {}; - return new Proxy(obj, { - get: function get(target, propKey, receiver) { - if (!obj.hasOwnProperty(propKey) && !_lodash2.default.includes(config.excludeMethods, propKey)) { - obj[propKey] = (0, _function2.default)(nameOf(name) + '.' + String(propKey)); - } - return obj[propKey]; - } - }); -}; - -var ensureProxySupport = function ensureProxySupport(name) { - if (typeof Proxy === 'undefined') { - _log2.default.error('td.object', 'The current runtime does not have Proxy support, which is what\ntestdouble.js depends on when a string name is passed to `td.object()`.\n\nMore details here:\n https://github.com/testdouble/testdouble.js/blob/master/docs/4-creating-test-doubles.md#objectobjectname\n\nDid you mean `td.object([\'' + name + '\'])`?'); - } -}; - -var ensureFunctionIsNotPassed = function ensureFunctionIsNotPassed() { - return _log2.default.error('td.object', 'Functions are not valid arguments to `td.object` (as of testdouble@2.0.0). Please use `td.function()` or `td.constructor()` instead for creating fake functions.'); -}; - -var ensureOtherGarbageIsNotPassed = function ensureOtherGarbageIsNotPassed() { - return _log2.default.error('td.object', 'To create a fake object with td.object(), pass it a plain object that contains\nfunctions, an array of function names, or (if your runtime supports ES Proxy\nobjects) a string name.\n\nIf you passed td.object an instance of a custom type, consider passing the\ntype\'s constructor to `td.constructor()` instead.\n'); -}; - -var withDefaults = function withDefaults(config) { - return _lodash2.default.extend({}, DEFAULT_OPTIONS, config); -}; - -var addToStringToDouble = function addToStringToDouble(fakeObject, nameOrType) { - var name = nameOf(nameOrType); - fakeObject.toString = function () { - return '[test double object' + (name ? ' for "' + name + '"' : '') + ']'; - }; -}; - -var nameOf = function nameOf(nameOrType) { - return _lodash2.default.isString(nameOrType) ? nameOrType : ''; -}; - -},{"./function":303,"./imitate":305,"./log":315,"./wrap/lodash":340}],328:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (target) { - if (_lodash2.default.isString(target)) { - return _module2.default.apply(undefined, arguments); - } else { - return _property2.default.apply(undefined, arguments); - } -}; - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _quibble = require('quibble'); - -var _quibble2 = _interopRequireDefault(_quibble); - -var _module = require('./module'); - -var _module2 = _interopRequireDefault(_module); - -var _property = require('./property'); - -var _property2 = _interopRequireDefault(_property); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -_quibble2.default.ignoreCallsFromThisFile(); - -},{"../wrap/lodash":340,"./module":329,"./property":330,"quibble":1}],329:[function(require,module,exports){ -(function (process){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (path, stub) { - if (arguments.length > 1) { - return (0, _quibble2.default)(path, stub); - } - var realThing = requireAt(path); - var fakeThing = (0, _imitate2.default)(realThing, [path + ': ' + nameFor(realThing)]); - (0, _quibble2.default)(path, fakeThing); - return fakeThing; -}; - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _quibble = require('quibble'); - -var _quibble2 = _interopRequireDefault(_quibble); - -var _imitate = require('../imitate'); - -var _imitate2 = _interopRequireDefault(_imitate); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -_quibble2.default.ignoreCallsFromThisFile(); - -var nameFor = function nameFor(realThing) { - if (!_lodash2.default.isFunction(realThing)) return ''; - return realThing.name ? realThing.name : '(anonymous function)'; -}; - -var requireAt = function requireAt(modulePath) { - try { - // 1. Try just following quibble's inferred path - return require(_quibble2.default.absolutify(modulePath)); - } catch (e) { - // 2. Try including npm packages - return require(require.resolve(modulePath, { paths: [_path2.default.join(process.cwd(), 'node_modules')] })); - } -}; - -}).call(this,require('_process')) -},{"../imitate":305,"../wrap/lodash":340,"_process":296,"path":295,"quibble":1}],330:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -exports.default = function (object, property, manualReplacement) { - var isManual = arguments.length > 2; - var realThingExists = object[property] || object.hasOwnProperty(property); - - if (isManual || realThingExists) { - var realThing = object[property]; - return _lodash2.default.tap(getFake(isManual, property, manualReplacement, realThing), function (fakeThing) { - object[property] = fakeThing; - _reset2.default.onNextReset(function () { - if (realThingExists) { - object[property] = realThing; - } else { - delete object[property]; - } - }); - }); - } else { - _log2.default.error('td.replace', 'No "' + property + '" property was found.'); - } -}; - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _imitate = require('../imitate'); - -var _imitate2 = _interopRequireDefault(_imitate); - -var _log = require('../log'); - -var _log2 = _interopRequireDefault(_log); - -var _reset = require('../reset'); - -var _reset2 = _interopRequireDefault(_reset); - -var _anything = require('../stringify/anything'); - -var _anything2 = _interopRequireDefault(_anything); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var getFake = function getFake(isManual, property, manualReplacement, realThing) { - if (isManual) { - warnIfTypeMismatch(property, manualReplacement, realThing); - return manualReplacement; - } else { - return (0, _imitate2.default)(realThing, [property]); - } -}; - -var warnIfTypeMismatch = function warnIfTypeMismatch(property, fakeThing, realThing) { - var fakeType = typeof fakeThing === 'undefined' ? 'undefined' : _typeof(fakeThing); - var realType = typeof realThing === 'undefined' ? 'undefined' : _typeof(realThing); - if (realThing !== undefined && fakeType !== realType) { - _log2.default.warn('td.replace', 'property "' + property + '" ' + (0, _anything2.default)(realThing) + ' (' + _lodash2.default.capitalize(realType) + ') was replaced with ' + (0, _anything2.default)(fakeThing) + ', which has a different type (' + _lodash2.default.capitalize(fakeType) + ').'); - } -}; - -},{"../imitate":305,"../log":315,"../reset":331,"../stringify/anything":335,"../wrap/lodash":340}],331:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _quibble = require('quibble'); - -var _quibble2 = _interopRequireDefault(_quibble); - -var _store = require('./store'); - -var _store2 = _interopRequireDefault(_store); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var resetHandlers = []; - -exports.default = _lodash2.default.tap(function () { - _store2.default.reset(); - _quibble2.default.reset(); - _lodash2.default.each(resetHandlers, function (resetHandler) { - return resetHandler(); - }); - resetHandlers = []; -}, function (reset) { - reset.onNextReset = function (func) { - return resetHandlers.push(func); - }; -}); - -},{"./store":333,"./wrap/lodash":340,"quibble":1}],332:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _argsMatch = require('../args-match'); - -var _argsMatch2 = _interopRequireDefault(_argsMatch); - -var _index = require('./index'); - -var _index2 = _interopRequireDefault(_index); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var callHistory = []; // <-- remember this to pop our DSL of when()/verify() -_index2.default.onReset(function () { - callHistory = []; -}); - -exports.default = { - log: function log(testDouble, args, context) { - _index2.default.for(testDouble).calls.push({ args: args, context: context }); - return callHistory.push({ testDouble: testDouble, args: args, context: context }); - }, - pop: function pop() { - return _lodash2.default.tap(callHistory.pop(), function (call) { - if (call != null) { - _index2.default.for(call.testDouble).calls.pop(); - } - }); - }, - wasInvoked: function wasInvoked(testDouble, args, config) { - var matchingInvocationCount = this.where(testDouble, args, config).length; - if (config.times != null) { - return matchingInvocationCount === config.times; - } else { - return matchingInvocationCount > 0; - } - }, - where: function where(testDouble, args, config) { - return _lodash2.default.filter(_index2.default.for(testDouble).calls, function (call) { - return (0, _argsMatch2.default)(args, call.args, config); - }); - }, - for: function _for(testDouble) { - return _index2.default.for(testDouble).calls; - } -}; - -},{"../args-match":298,"../wrap/lodash":340,"./index":333}],333:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _events = require('events'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var storeEmitter = new _events.EventEmitter(); -var globalStore = []; - -exports.default = { - onReset: function onReset(func) { - storeEmitter.on('reset', func); - }, - reset: function reset() { - globalStore = []; - storeEmitter.emit('reset'); - }, - for: function _for(testDouble) { - var createIfNew = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - var entry = _lodash2.default.find(globalStore, { testDouble: testDouble }); - if (entry) { - return entry; - } else if (createIfNew) { - return _lodash2.default.tap({ - testDouble: testDouble, - stubbings: [], - calls: [], - verifications: [] - }, function (newEntry) { - return globalStore.push(newEntry); - }); - } - } -}; - -},{"../wrap/lodash":340,"events":64}],334:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _argsMatch = require('../args-match'); - -var _argsMatch2 = _interopRequireDefault(_argsMatch); - -var _isCallback = require('../matchers/is-callback'); - -var _isCallback2 = _interopRequireDefault(_isCallback); - -var _notifyAfterSatisfaction = require('../matchers/notify-after-satisfaction'); - -var _notifyAfterSatisfaction2 = _interopRequireDefault(_notifyAfterSatisfaction); - -var _config = require('../config'); - -var _config2 = _interopRequireDefault(_config); - -var _log = require('../log'); - -var _log2 = _interopRequireDefault(_log); - -var _index = require('./index'); - -var _index2 = _interopRequireDefault(_index); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -exports.default = { - add: function add(testDouble, args, stubbedValues, config) { - return _index2.default.for(testDouble).stubbings.push({ - callCount: 0, - stubbedValues: stubbedValues, - args: args, - config: config - }); - }, - invoke: function invoke(testDouble, actualArgs, actualContext) { - var stubbing = stubbingFor(testDouble, actualArgs); - if (stubbing) { - (0, _notifyAfterSatisfaction2.default)(stubbing.args, actualArgs); - return executePlan(stubbing, actualArgs, actualContext); - } - }, - for: function _for(testDouble) { - return _index2.default.for(testDouble).stubbings; - } -}; - - -var stubbingFor = function stubbingFor(testDouble, actualArgs) { - return _lodash2.default.findLast(_index2.default.for(testDouble).stubbings, function (stubbing) { - return isSatisfied(stubbing, actualArgs); - }); -}; - -var executePlan = function executePlan(stubbing, actualArgs, actualContext) { - var value = stubbedValueFor(stubbing); - stubbing.callCount += 1; - invokeCallbackFor(stubbing, actualArgs); - switch (stubbing.config.plan) { - case 'thenReturn': - return value; - case 'thenDo': - return value.apply(actualContext, actualArgs); - case 'thenThrow': - throw value; - case 'thenResolve': - return createPromise(stubbing, value, true); - case 'thenReject': - return createPromise(stubbing, value, false); - } -}; - -var invokeCallbackFor = function invokeCallbackFor(stubbing, actualArgs) { - if (_lodash2.default.some(stubbing.args, _isCallback2.default)) { - _lodash2.default.each(stubbing.args, function (expectedArg, i) { - if ((0, _isCallback2.default)(expectedArg)) { - callCallback(stubbing, actualArgs[i], callbackArgs(stubbing, expectedArg)); - } - }); - } -}; - -var callbackArgs = function callbackArgs(stubbing, expectedArg) { - if (expectedArg.args != null) { - return expectedArg.args; - } else if (stubbing.config.plan === 'thenCallback') { - return stubbing.stubbedValues; - } else { - return []; - } -}; - -var callCallback = function callCallback(stubbing, callback, args) { - if (stubbing.config.delay) { - _lodash2.default.delay.apply(_lodash2.default, [callback, stubbing.config.delay].concat(_toConsumableArray(args))); - } else if (stubbing.config.defer) { - _lodash2.default.defer.apply(_lodash2.default, [callback].concat(_toConsumableArray(args))); - } else { - callback.apply(undefined, _toConsumableArray(args)); // eslint-disable-line - } -}; - -var createPromise = function createPromise(stubbing, value, willResolve) { - var Promise = (0, _config2.default)().promiseConstructor; - ensurePromise(Promise); - return new Promise(function (resolve, reject) { - callCallback(stubbing, function () { - return willResolve ? resolve(value) : reject(value); - }, [value]); - }); -}; - -var stubbedValueFor = function stubbedValueFor(stubbing) { - return stubbing.callCount < stubbing.stubbedValues.length ? stubbing.stubbedValues[stubbing.callCount] : _lodash2.default.last(stubbing.stubbedValues); -}; - -var isSatisfied = function isSatisfied(stubbing, actualArgs) { - return (0, _argsMatch2.default)(stubbing.args, actualArgs, stubbing.config) && hasTimesRemaining(stubbing); -}; - -var hasTimesRemaining = function hasTimesRemaining(stubbing) { - return stubbing.config.times == null ? true : stubbing.callCount < stubbing.config.times; -}; - -var ensurePromise = function ensurePromise(Promise) { - if (Promise == null) { - return _log2.default.error('td.when', 'no promise constructor is set (perhaps this runtime lacks a native Promise\nfunction?), which means this stubbing can\'t return a promise to your\nsubject under test, resulting in this error. To resolve the issue, set\na promise constructor with `td.config`, like this:\n\n td.config({\n promiseConstructor: require(\'bluebird\')\n })'); - } -}; - -},{"../args-match":298,"../config":300,"../log":315,"../matchers/is-callback":324,"../matchers/notify-after-satisfaction":326,"../wrap/lodash":340,"./index":333}],335:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _isMatcher = require('../matchers/is-matcher'); - -var _isMatcher2 = _interopRequireDefault(_isMatcher); - -var _stringifyObjectEs = require('stringify-object-es5'); - -var _stringifyObjectEs2 = _interopRequireDefault(_stringifyObjectEs); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (anything) { - if (_lodash2.default.isString(anything)) { - return stringifyString(anything); - } else if ((0, _isMatcher2.default)(anything)) { - return anything.__name; - } else { - return (0, _stringifyObjectEs2.default)(anything, { - indent: ' ', - singleQuotes: false, - inlineCharacterLimit: 65, - transform: function transform(obj, prop, originalResult) { - if ((0, _isMatcher2.default)(obj[prop])) { - return obj[prop].__name; - } else { - return originalResult; - } - } - }); - } -}; - -var stringifyString = function stringifyString(string) { - return _lodash2.default.includes(string, '\n') ? '"""\n' + string + '\n"""' : '"' + string.replace(new RegExp('"', 'g'), '\\"') + '"'; -}; - -},{"../matchers/is-matcher":325,"../wrap/lodash":340,"stringify-object-es5":297}],336:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('../wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _anything = require('./anything'); - -var _anything2 = _interopRequireDefault(_anything); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (args) { - var joiner = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ', '; - var wrapper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - return _lodash2.default.map(args, function (arg) { - return '' + wrapper + (0, _anything2.default)(arg) + wrapper; - }).join(joiner); -}; - -},{"../wrap/lodash":340,"./anything":335}],337:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _argsMatch = require('./args-match'); - -var _argsMatch2 = _interopRequireDefault(_argsMatch); - -var _calls = require('./store/calls'); - -var _calls2 = _interopRequireDefault(_calls); - -var _log = require('./log'); - -var _log2 = _interopRequireDefault(_log); - -var _store = require('./store'); - -var _store2 = _interopRequireDefault(_store); - -var _arguments = require('./stringify/arguments'); - -var _arguments2 = _interopRequireDefault(_arguments); - -var _stubbings = require('./store/stubbings'); - -var _stubbings2 = _interopRequireDefault(_stubbings); - -var _notifyAfterSatisfaction = require('./matchers/notify-after-satisfaction'); - -var _notifyAfterSatisfaction2 = _interopRequireDefault(_notifyAfterSatisfaction); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (__userDoesRehearsalInvocationHere__) { - var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var last = _calls2.default.pop(); - ensureRehearsalOccurred(last); - if (_calls2.default.wasInvoked(last.testDouble, last.args, config)) { - notifyMatchers(last.testDouble, last.args, config); - warnIfStubbed(last.testDouble, last.args); - } else { - _log2.default.fail(unsatisfiedErrorMessage(last.testDouble, last.args, config)); - } -}; - -var ensureRehearsalOccurred = function ensureRehearsalOccurred(last) { - if (!last) { - _log2.default.error('td.verify', 'No test double invocation detected for `verify()`.\n\n Usage:\n verify(myTestDouble(\'foo\'))'); - } -}; - -var notifyMatchers = function notifyMatchers(testDouble, expectedArgs, config) { - _lodash2.default.each(_calls2.default.where(testDouble, expectedArgs, config), function (invocation) { - (0, _notifyAfterSatisfaction2.default)(expectedArgs, invocation.args); - }); -}; - -var warnIfStubbed = function warnIfStubbed(testDouble, actualArgs) { - if (_lodash2.default.some(_stubbings2.default.for(testDouble), function (stubbing) { - return (0, _argsMatch2.default)(stubbing.args, actualArgs, stubbing.config); - })) { - _log2.default.warn('td.verify', 'test double' + stringifyName(testDouble) + ' was both stubbed and verified with arguments (' + (0, _arguments2.default)(actualArgs) + '), which is redundant and probably unnecessary.', 'https://github.com/testdouble/testdouble.js/blob/master/docs/B-frequently-asked-questions.md#why-shouldnt-i-call-both-tdwhen-and-tdverify-for-a-single-interaction-with-a-test-double'); - } -}; - -var unsatisfiedErrorMessage = function unsatisfiedErrorMessage(testDouble, args, config) { - return baseSummary(testDouble, args, config) + matchedInvocationSummary(testDouble, args, config) + invocationSummary(testDouble, args, config); -}; - -var stringifyName = function stringifyName(testDouble) { - var name = _store2.default.for(testDouble).name; - return name ? ' `' + name + '`' : ''; -}; - -var baseSummary = function baseSummary(testDouble, args, config) { - return 'Unsatisfied verification on test double' + stringifyName(testDouble) + '.\n\n Wanted:\n - called with `(' + (0, _arguments2.default)(args) + ')`' + timesMessage(config) + ignoreMessage(config) + '.'; -}; - -var invocationSummary = function invocationSummary(testDouble, args, config) { - var calls = _calls2.default.for(testDouble); - if (calls.length === 0) { - return '\n\n But there were no invocations of the test double.'; - } else { - return _lodash2.default.reduce(calls, function (desc, call) { - return desc + ('\n - called with `(' + (0, _arguments2.default)(call.args) + ')`.'); - }, '\n\n All calls of the test double, in order were:'); - } -}; - -var matchedInvocationSummary = function matchedInvocationSummary(testDouble, args, config) { - var calls = _calls2.default.where(testDouble, args, config); - var expectedCalls = config.times || 0; - - if (calls.length === 0 || calls.length > expectedCalls) { - return ''; - } else { - return _lodash2.default.reduce(_lodash2.default.groupBy(calls, 'args'), function (desc, callsMatchingArgs, args) { - return desc + ('\n - called ' + pluralize(callsMatchingArgs.length, 'time') + ' with `(' + (0, _arguments2.default)(callsMatchingArgs[0].args) + ')`.'); - }, '\n\n ' + pluralize(calls.length, 'call') + ' that satisfied this verification:'); - } -}; - -var pluralize = function pluralize(x, msg) { - return x + ' ' + msg + (x === 1 ? '' : 's'); -}; - -var timesMessage = function timesMessage(config) { - return config.times != null ? ' ' + pluralize(config.times, 'time') : ''; -}; - -var ignoreMessage = function ignoreMessage(config) { - return config.ignoreExtraArgs != null ? ', ignoring any additional arguments' : ''; -}; - -},{"./args-match":298,"./log":315,"./matchers/notify-after-satisfaction":326,"./store":333,"./store/calls":332,"./store/stubbings":334,"./stringify/arguments":336,"./wrap/lodash":340}],338:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = '3.3.3'; - -},{}],339:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lodash = require('./wrap/lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _callback = require('./callback'); - -var _callback2 = _interopRequireDefault(_callback); - -var _isCallback = require('./matchers/is-callback'); - -var _isCallback2 = _interopRequireDefault(_isCallback); - -var _calls = require('./store/calls'); - -var _calls2 = _interopRequireDefault(_calls); - -var _log = require('./log'); - -var _log2 = _interopRequireDefault(_log); - -var _stubbings = require('./store/stubbings'); - -var _stubbings2 = _interopRequireDefault(_stubbings); - -var _config = require('./config'); - -var _config2 = _interopRequireDefault(_config); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (__userDoesRehearsalInvocationHere__) { - var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return { - thenReturn: function thenReturn() { - for (var _len = arguments.length, stubbedValues = Array(_len), _key = 0; _key < _len; _key++) { - stubbedValues[_key] = arguments[_key]; - } - - return addStubbing(stubbedValues, config, 'thenReturn'); - }, - thenCallback: function thenCallback() { - for (var _len2 = arguments.length, stubbedValues = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - stubbedValues[_key2] = arguments[_key2]; - } - - return addStubbing(stubbedValues, config, 'thenCallback'); - }, - thenDo: function thenDo() { - for (var _len3 = arguments.length, stubbedValues = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - stubbedValues[_key3] = arguments[_key3]; - } - - return addStubbing(stubbedValues, config, 'thenDo'); - }, - thenThrow: function thenThrow() { - for (var _len4 = arguments.length, stubbedValues = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - stubbedValues[_key4] = arguments[_key4]; - } - - return addStubbing(stubbedValues, config, 'thenThrow'); - }, - thenResolve: function thenResolve() { - warnIfPromiseless(); - - for (var _len5 = arguments.length, stubbedValues = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - stubbedValues[_key5] = arguments[_key5]; - } - - return addStubbing(stubbedValues, config, 'thenResolve'); - }, - thenReject: function thenReject() { - warnIfPromiseless(); - - for (var _len6 = arguments.length, stubbedValues = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { - stubbedValues[_key6] = arguments[_key6]; - } - - return addStubbing(stubbedValues, config, 'thenReject'); - } - }; -}; - -var addStubbing = function addStubbing(stubbedValues, config, plan) { - var last = _calls2.default.pop(); - ensureRehearsalOccurred(last); - _lodash2.default.assign(config, { plan: plan }); - _stubbings2.default.add(last.testDouble, concatImpliedCallback(last.args, config), stubbedValues, config); - return last.testDouble; -}; - -var ensureRehearsalOccurred = function ensureRehearsalOccurred(last) { - if (!last) { - return _log2.default.error('td.when', 'No test double invocation call detected for `when()`.\n\n Usage:\n when(myTestDouble(\'foo\')).thenReturn(\'bar\')'); - } -}; - -var concatImpliedCallback = function concatImpliedCallback(args, config) { - if (config.plan !== 'thenCallback') { - return args; - } else if (!_lodash2.default.some(args, _isCallback2.default)) { - return args.concat(_callback2.default); - } else { - return args; - } -}; - -var warnIfPromiseless = function warnIfPromiseless() { - if ((0, _config2.default)().promiseConstructor == null) { - _log2.default.warn('td.when', 'no promise constructor is set, so this `thenResolve` or `thenReject` stubbing\nwill fail if it\'s satisfied by an invocation on the test double. You can tell\ntestdouble.js which promise constructor to use with `td.config`, like so:\n\n td.config({\n promiseConstructor: require(\'bluebird\')\n })'); - } -}; - -},{"./callback":299,"./config":300,"./log":315,"./matchers/is-callback":324,"./store/calls":332,"./store/stubbings":334,"./wrap/lodash":340}],340:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _assign = require('lodash/assign'); - -var _assign2 = _interopRequireDefault(_assign); - -var _capitalize = require('lodash/capitalize'); - -var _capitalize2 = _interopRequireDefault(_capitalize); - -var _clone = require('lodash/clone'); - -var _clone2 = _interopRequireDefault(_clone); - -var _compact = require('lodash/compact'); - -var _compact2 = _interopRequireDefault(_compact); - -var _defer = require('lodash/defer'); - -var _defer2 = _interopRequireDefault(_defer); - -var _delay = require('lodash/delay'); - -var _delay2 = _interopRequireDefault(_delay); - -var _each = require('lodash/each'); - -var _each2 = _interopRequireDefault(_each); - -var _every = require('lodash/every'); - -var _every2 = _interopRequireDefault(_every); - -var _extend = require('lodash/extend'); - -var _extend2 = _interopRequireDefault(_extend); - -var _filter = require('lodash/filter'); - -var _filter2 = _interopRequireDefault(_filter); - -var _find = require('lodash/find'); - -var _find2 = _interopRequireDefault(_find); - -var _findLast = require('lodash/findLast'); - -var _findLast2 = _interopRequireDefault(_findLast); - -var _get = require('lodash/get'); - -var _get2 = _interopRequireDefault(_get); - -var _groupBy = require('lodash/groupBy'); - -var _groupBy2 = _interopRequireDefault(_groupBy); - -var _includes = require('lodash/includes'); - -var _includes2 = _interopRequireDefault(_includes); - -var _invoke = require('lodash/invoke'); - -var _invoke2 = _interopRequireDefault(_invoke); - -var _isArguments = require('lodash/isArguments'); - -var _isArguments2 = _interopRequireDefault(_isArguments); - -var _isArray = require('lodash/isArray'); - -var _isArray2 = _interopRequireDefault(_isArray); - -var _isBoolean = require('lodash/isBoolean'); - -var _isBoolean2 = _interopRequireDefault(_isBoolean); - -var _isEmpty = require('lodash/isEmpty'); - -var _isEmpty2 = _interopRequireDefault(_isEmpty); - -var _isEqual = require('lodash/isEqual'); - -var _isEqual2 = _interopRequireDefault(_isEqual); - -var _isEqualWith = require('lodash/isEqualWith'); - -var _isEqualWith2 = _interopRequireDefault(_isEqualWith); - -var _isFunction = require('lodash/isFunction'); - -var _isFunction2 = _interopRequireDefault(_isFunction); - -var _isNumber = require('lodash/isNumber'); - -var _isNumber2 = _interopRequireDefault(_isNumber); - -var _isObject = require('lodash/isObject'); - -var _isObject2 = _interopRequireDefault(_isObject); - -var _isObjectLike = require('lodash/isObjectLike'); - -var _isObjectLike2 = _interopRequireDefault(_isObjectLike); - -var _isRegExp = require('lodash/isRegExp'); - -var _isRegExp2 = _interopRequireDefault(_isRegExp); - -var _isString = require('lodash/isString'); - -var _isString2 = _interopRequireDefault(_isString); - -var _keys = require('lodash/keys'); - -var _keys2 = _interopRequireDefault(_keys); - -var _last = require('lodash/last'); - -var _last2 = _interopRequireDefault(_last); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _reduce = require('lodash/reduce'); - -var _reduce2 = _interopRequireDefault(_reduce); - -var _reject = require('lodash/reject'); - -var _reject2 = _interopRequireDefault(_reject); - -var _some = require('lodash/some'); - -var _some2 = _interopRequireDefault(_some); - -var _tap = require('lodash/tap'); - -var _tap2 = _interopRequireDefault(_tap); - -var _toArray = require('lodash/toArray'); - -var _toArray2 = _interopRequireDefault(_toArray); - -var _transform = require('lodash/transform'); - -var _transform2 = _interopRequireDefault(_transform); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - assign: _assign2.default, - capitalize: _capitalize2.default, - clone: _clone2.default, - compact: _compact2.default, - defer: _defer2.default, - delay: _delay2.default, - each: _each2.default, - every: _every2.default, - extend: _extend2.default, - filter: _filter2.default, - find: _find2.default, - findLast: _findLast2.default, - get: _get2.default, - groupBy: _groupBy2.default, - includes: _includes2.default, - invoke: _invoke2.default, - isArguments: _isArguments2.default, - isArray: _isArray2.default, - isBoolean: _isBoolean2.default, - isEmpty: _isEmpty2.default, - isEqual: _isEqual2.default, - isEqualWith: _isEqualWith2.default, - isFunction: _isFunction2.default, - isNumber: _isNumber2.default, - isObject: _isObject2.default, - isObjectLike: _isObjectLike2.default, - isRegExp: _isRegExp2.default, - isString: _isString2.default, - keys: _keys2.default, - last: _last2.default, - map: _map2.default, - reduce: _reduce2.default, - reject: _reject2.default, - some: _some2.default, - tap: _tap2.default, - toArray: _toArray2.default, - transform: _transform2.default -}; - -},{"lodash/assign":233,"lodash/capitalize":235,"lodash/clone":236,"lodash/compact":237,"lodash/defer":239,"lodash/delay":240,"lodash/each":241,"lodash/every":243,"lodash/extend":244,"lodash/filter":245,"lodash/find":246,"lodash/findLast":248,"lodash/get":251,"lodash/groupBy":252,"lodash/includes":255,"lodash/invoke":256,"lodash/isArguments":257,"lodash/isArray":258,"lodash/isBoolean":260,"lodash/isEmpty":262,"lodash/isEqual":263,"lodash/isEqualWith":264,"lodash/isFunction":265,"lodash/isNumber":267,"lodash/isObject":268,"lodash/isObjectLike":269,"lodash/isRegExp":270,"lodash/isString":271,"lodash/keys":274,"lodash/last":276,"lodash/map":277,"lodash/reduce":281,"lodash/reject":282,"lodash/some":283,"lodash/tap":286,"lodash/toArray":287,"lodash/transform":292}]},{},[314])(314) -}); \ No newline at end of file diff --git a/package.json b/package.json index 30d4a256..6d85ded4 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "mocha_reporter": "dot" }, "scripts": { - "clean": "rm -rf generated dist lib coverage && yarn clean:dist", - "clean:dist": "git checkout -- dist", + "clean": "rm -rf generated dist lib coverage", + "postclean": "mkdir -p generated dist", "compile:browser": "browserify src/index.js --standalone td --outfile $npm_package_config_build_file -p headerify -t babelify", "compile:browser:test": "mkdir -p generated && browserify regression/browser-helper.js --outfile $npm_package_config_test_bundle -t babelify -t coffeeify --extension=\".coffee\" -t require-globify --ignore-missing", "compile:node": "babel src -d lib", @@ -29,7 +29,7 @@ "test:all": "yarn test:unit && yarn test && yarn test:browser && yarn test:example && yarn test:typescript", "test:browser": "testem ci", "test:unit": "teenytest", - "test:ci": "yarn clean && yarn compile && yarn style && yarn test:all && yarn clean:dist && echo \"All done!\"", + "test:ci": "yarn clean && yarn compile && yarn style && yarn test:all && echo \"All done!\"", "test:typescript": "tsc --outDir generated/typescript -p regression/typescript && node generated/typescript/test.js", "test:example:webpack": "cd examples/webpack && npm install && npm test", "test:example:node": "cd examples/node && npm install && npm test", @@ -39,7 +39,7 @@ "version:write": "echo \"export default '$npm_package_version'\" > src/version.js", "version:changelog": "if command -v github_changelog_generator &>/dev/null; then github_changelog_generator; git commit -m \"Changelog for $npm_package_version\" CHANGELOG.md; else echo Versioning requires you first run 'gem install github_changelog_generator' >&2; fi", "preversion": "git pull --rebase && yarn test:ci", - "version": "yarn version:write && yarn compile && git add dist src/version.js", + "version": "yarn version:write && yarn compile && git add src/version.js", "postversion": "git push --tags && yarn version:changelog && git push && npm publish", "prepare": "yarn compile" }, From 421f5f4a2835da8bf2baf5222a5694706dc4de8b Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sat, 11 Nov 2017 10:54:29 -0500 Subject: [PATCH 05/11] Remove npmignore Whitelist files rather than dealing with npmignore override of gitignore. Package now includes src, lib, dist, and TS typings. (package.json, readme, changelog, license are included automatically by npm) Things no longer included in package: regression, test, examples, docs --- .npmignore | 3 --- package.json | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 .npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index d77f33fc..00000000 --- a/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -# this file is necessary so that npm doesn't use .gitignore; -# gitignore ignores lib/ which *must* be included in the package. - diff --git a/package.json b/package.json index 6d85ded4..9c407c12 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,12 @@ "url": "http://testdouble.com" }, "main": "lib/index.js", + "files": [ + "src", + "lib", + "dist", + "index.d.ts" + ], "config": { "build_file": "dist/testdouble.js", "test_bundle": "generated/tests.js", @@ -18,7 +24,7 @@ "clean": "rm -rf generated dist lib coverage", "postclean": "mkdir -p generated dist", "compile:browser": "browserify src/index.js --standalone td --outfile $npm_package_config_build_file -p headerify -t babelify", - "compile:browser:test": "mkdir -p generated && browserify regression/browser-helper.js --outfile $npm_package_config_test_bundle -t babelify -t coffeeify --extension=\".coffee\" -t require-globify --ignore-missing", + "compile:browser:test": "browserify regression/browser-helper.js --outfile $npm_package_config_test_bundle -t babelify -t coffeeify --extension=\".coffee\" -t require-globify --ignore-missing", "compile:node": "babel src -d lib", "compile": "yarn compile:node && yarn compile:browser && yarn compile:browser:test", "cover": "nyc --reporter=lcov --reporter=text-summary --require babel-core/register _mocha --ui mocha-given --reporter $npm_package_config_mocha_reporter --compilers coffee:coffee-script --recursive regression/node-helper.coffee regression/src", From d5eae2735347cc0f4f6c4d72610d725da7e24662 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sat, 11 Nov 2017 10:59:25 -0500 Subject: [PATCH 06/11] Standard automatically ignores .gitignore patterns --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 9c407c12..4f4896c9 100644 --- a/package.json +++ b/package.json @@ -80,10 +80,7 @@ "ES_SUPPORT" ], "ignore": [ - "dist", - "examples", - "generated", - "lib" + "examples" ] }, "nyc": { From fe5d236b27931affa5f7d163a1215c303c65b0f8 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sun, 19 Nov 2017 10:05:12 -0500 Subject: [PATCH 07/11] Add mkdirp and rimraf devDeps Browserify won't create necessary directories. So they need to be created prior to running the builds. Which also means we need to use a cross-platform `mkdir` command. And we need to run the clean command as part of build/preparation so we need cross-platform rm-rf. --- package.json | 2 ++ yarn.lock | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f4896c9..645132b1 100644 --- a/package.json +++ b/package.json @@ -110,12 +110,14 @@ "core-assert": "^0.2.1", "headerify": "^1.0.1", "is-number": "^3.0.0", + "mkdirp": "^0.5.1", "mocha": "^3.2.0", "mocha-given": "^0.1.3", "nyc": "^10.1.2", "power-assert": "^1.4.4", "pryjs": "^1.0.3", "require-globify": "^1.4.1", + "rimraf": "^2.6.2", "standard": "^10.0.2", "teenytest": "^5.1.1", "testdouble": "3.2.6", diff --git a/yarn.lock b/yarn.lock index a30558c5..0cad8653 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4163,7 +4163,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -5044,6 +5044,10 @@ yargs@~3.10.0: decamelize "^1.0.0" window-size "0.1.0" +yarn@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.3.2.tgz#5939762581b5b4ddcd3418c0f6be42df3aee195f" + yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" From 9d89e72517df5aa4a0295b69beaa02d403888c1a Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sun, 19 Nov 2017 10:08:04 -0500 Subject: [PATCH 08/11] Run clean before compile --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 645132b1..ee501c99 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,11 @@ }, "scripts": { "clean": "rm -rf generated dist lib coverage", - "postclean": "mkdir -p generated dist", + "postclean": "mkdirp generated dist", "compile:browser": "browserify src/index.js --standalone td --outfile $npm_package_config_build_file -p headerify -t babelify", "compile:browser:test": "browserify regression/browser-helper.js --outfile $npm_package_config_test_bundle -t babelify -t coffeeify --extension=\".coffee\" -t require-globify --ignore-missing", "compile:node": "babel src -d lib", + "precompile": "yarn clean", "compile": "yarn compile:node && yarn compile:browser && yarn compile:browser:test", "cover": "nyc --reporter=lcov --reporter=text-summary --require babel-core/register _mocha --ui mocha-given --reporter $npm_package_config_mocha_reporter --compilers coffee:coffee-script --recursive regression/node-helper.coffee regression/src", "cover:unit": "nyc --reporter=html yarn test:unit", @@ -35,7 +36,7 @@ "test:all": "yarn test:unit && yarn test && yarn test:browser && yarn test:example && yarn test:typescript", "test:browser": "testem ci", "test:unit": "teenytest", - "test:ci": "yarn clean && yarn compile && yarn style && yarn test:all && echo \"All done!\"", + "test:ci": "yarn compile && yarn style && yarn test:all && echo \"All done!\"", "test:typescript": "tsc --outDir generated/typescript -p regression/typescript && node generated/typescript/test.js", "test:example:webpack": "cd examples/webpack && npm install && npm test", "test:example:node": "cd examples/node && npm install && npm test", From 86761624a09dd1136d23bef1048a0587b1b5ed93 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 1 Feb 2018 22:44:20 -0500 Subject: [PATCH 09/11] Add unpkg badge to readme Unsure how best to "advertise" the dist download. Custom badge for now. Link points to dist/ dir at latest published version. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 51cf4cc2..4aeeac56 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.org/testdouble/testdouble.js.svg?branch=master)](https://travis-ci.org/testdouble/testdouble.js) [![npmjs](https://img.shields.io/badge/npm-testdouble-red.svg)](https://www.npmjs.com/package/testdouble) +[![unpkg](https://img.shields.io/badge/unpkg-download-blue.svg)](https://unpkg.com/testdouble/dist/) [![Test Coverage](https://codeclimate.com/github/testdouble/testdouble.js/badges/coverage.svg)](https://codeclimate.com/github/testdouble/testdouble.js/coverage) Welcome! Are you writing JavaScript tests and in the market for a mocking library to From 6deb2a36a7a5de86839a750afedf0cb7d2313676 Mon Sep 17 00:00:00 2001 From: Justin Searls Date: Fri, 9 Feb 2018 12:36:44 -0500 Subject: [PATCH 10/11] Drop Bower support --- bower.json | 27 --------------------------- docs/1-installation.md | 4 ---- 2 files changed, 31 deletions(-) delete mode 100644 bower.json diff --git a/bower.json b/bower.json deleted file mode 100644 index e8b955f6..00000000 --- a/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "testdouble", - "main": "dist/testdouble.js", - "homepage": "https://github.com/testdouble/testdouble.js", - "authors": [ - "Justin Searls " - ], - "description": "A minimal test double library for TDD with JavaScript", - "keywords": [ - "tdd", - "bdd", - "mock", - "stub", - "spy", - "test", - "double", - "double" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/docs/1-installation.md b/docs/1-installation.md index 5fd351fd..77023da0 100644 --- a/docs/1-installation.md +++ b/docs/1-installation.md @@ -49,15 +49,11 @@ $ npm install --save-dev testdouble And then find the browser distribution of the library in `node_modules/testdouble/dist/testdouble.js`. -#### bower -To install testdouble.js with bower: ``` -$ bower install --save-dev testdouble/testdouble.js ``` -Once installed, the browser library can be found in `bower_components/testdouble/dist/testdouble.js` ## Configuring testdouble.js Setting up in your test suite From a68b0e0ec80a84e5c5cab89d8e8cc06160f5c1b6 Mon Sep 17 00:00:00 2001 From: Justin Searls Date: Fri, 9 Feb 2018 12:36:51 -0500 Subject: [PATCH 11/11] Add unpkg documentation --- docs/1-installation.md | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/docs/1-installation.md b/docs/1-installation.md index 77023da0..0c2680d7 100644 --- a/docs/1-installation.md +++ b/docs/1-installation.md @@ -22,25 +22,17 @@ All examples in these documents will assume `testdouble` is available as `td`. ### For use in Browsers -The most recent release (not master itself) is always available on the master -branch of the git repo, to make it easier to fetch the browser distribution of -testdouble.js +When we publish new versions of testdouble.js, we also generate a browser build +of the library that's ready to be used in browsers, which you'll find in +"dist/testdouble.js" of the installed package. This distribution will also +define a `td` global variable, so you can use the library without necessitating +any kind of module system in your test build. -#### curl +#### via npm -The easiest way to fetch testdouble is to curl it: - -``` -$ curl https://raw.githubusercontent.com/testdouble/testdouble.js/master/dist/testdouble.js -o test/helpers/testdouble.js -``` - -And then just check it into source control. It may be old-fashioned, but it -still works. - -#### npm - -You can also install testdouble from npm and then copy, move, symlink, or point -your front-end build tool at it: +Most people manage their front-end dependencies these days with `npm`, so most +commonly we'd expect people to pull down testdouble.js by installing it with npm +and pointing whatever front-end build tool they use to it. ``` $ npm install --save-dev testdouble @@ -49,11 +41,17 @@ $ npm install --save-dev testdouble And then find the browser distribution of the library in `node_modules/testdouble/dist/testdouble.js`. +#### via unpkg +You can also just fetch the latest (or any) version of the library from +the unpkg CDN. You can even curl it: ``` +$ curl -L https://unpkg.com/testdouble/dist/testdouble.js ``` +And then just check it into source control. It may be old-fashioned, but it +still works. ## Configuring testdouble.js Setting up in your test suite