From 58bee9d4f6d07e00ab9a6b043200606019efae94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Javier=20Cravero?= Date: Tue, 16 Jun 2015 23:23:35 +0100 Subject: [PATCH 1/2] Remove unnecessary `browserify` config in `package.json` and `envify` dependency (#88). --- package.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/package.json b/package.json index 4a65d918b8..916a3eda1c 100644 --- a/package.json +++ b/package.json @@ -54,13 +54,7 @@ }, "dependencies": { "babel-runtime": "^5.5.8", - "envify": "^3.4.0", "invariant": "^2.0.0", "lodash": "^3.9.3" - }, - "browserify": { - "transform": [ - "envify" - ] } } From 0a434a77db72d69120718b8972639d183a362070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Javier=20Cravero?= Date: Wed, 17 Jun 2015 00:38:41 +0100 Subject: [PATCH 2/2] Removed `babel-runtime` from the dependencies and brought in a dist script (reusing flummox's one) so that we can output a dist-ready version of it. Fixes #115. Fixes #88. --- .babelrc | 4 +- dist/redux.js | 2101 +++++++++++++++++++++++++++++++++++++++++++++ dist/redux.min.js | 1 + package.json | 2 +- scripts/browser | 7 + webpack.config.js | 40 + 6 files changed, 2152 insertions(+), 3 deletions(-) create mode 100644 dist/redux.js create mode 100644 dist/redux.min.js create mode 100755 scripts/browser create mode 100644 webpack.config.js diff --git a/.babelrc b/.babelrc index 8b9392314b..15d27ad9b4 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,4 @@ { "stage": 0, - "optional": ["runtime"] -} \ No newline at end of file + "loose": "all" +} diff --git a/dist/redux.js b/dist/redux.js new file mode 100644 index 0000000000..759ce2bf7e --- /dev/null +++ b/dist/redux.js @@ -0,0 +1,2101 @@ +var Redux = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + // Core + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _createRedux2 = __webpack_require__(1); + + var _createRedux3 = _interopRequireDefault(_createRedux2); + + exports.createRedux = _createRedux3['default']; + + var _createDispatcher2 = __webpack_require__(3); + + var _createDispatcher3 = _interopRequireDefault(_createDispatcher2); + + exports.createDispatcher = _createDispatcher3['default']; + + // Utilities + + var _utilsComposeMiddleware = __webpack_require__(4); + + var _utilsComposeMiddleware2 = _interopRequireDefault(_utilsComposeMiddleware); + + exports.composeMiddleware = _utilsComposeMiddleware2['default']; + + var _utilsComposeStores = __webpack_require__(5); + + var _utilsComposeStores2 = _interopRequireDefault(_utilsComposeStores); + + exports.composeStores = _utilsComposeStores2['default']; + + var _utilsBindActionCreators = __webpack_require__(52); + + var _utilsBindActionCreators2 = _interopRequireDefault(_utilsBindActionCreators); + + exports.bindActionCreators = _utilsBindActionCreators2['default']; + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + var _bind = Function.prototype.bind; + exports['default'] = createRedux; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _Redux = __webpack_require__(2); + + var _Redux2 = _interopRequireDefault(_Redux); + + function createRedux() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var redux = new (_bind.apply(_Redux2['default'], [null].concat(args)))(); + + return { + subscribe: redux.subscribe.bind(redux), + dispatch: redux.dispatch.bind(redux), + getState: redux.getState.bind(redux), + getDispatcher: redux.getDispatcher.bind(redux), + replaceDispatcher: redux.replaceDispatcher.bind(redux) + }; + } + + module.exports = exports['default']; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _createDispatcher = __webpack_require__(3); + + var _createDispatcher2 = _interopRequireDefault(_createDispatcher); + + var _utilsComposeStores = __webpack_require__(5); + + var _utilsComposeStores2 = _interopRequireDefault(_utilsComposeStores); + + var _middlewareThunk = __webpack_require__(51); + + var _middlewareThunk2 = _interopRequireDefault(_middlewareThunk); + + var Redux = (function () { + function Redux(dispatcher, initialState) { + _classCallCheck(this, Redux); + + if (typeof dispatcher === 'object') { + // A shortcut notation to use the default dispatcher + dispatcher = (0, _createDispatcher2['default'])((0, _utilsComposeStores2['default'])(dispatcher), function (getState) { + return [(0, _middlewareThunk2['default'])(getState)]; + }); + } + + this.state = initialState; + this.listeners = []; + this.replaceDispatcher(dispatcher); + } + + Redux.prototype.getDispatcher = function getDispatcher() { + return this.dispatcher; + }; + + Redux.prototype.replaceDispatcher = function replaceDispatcher(nextDispatcher) { + this.dispatcher = nextDispatcher; + this.dispatchFn = nextDispatcher(this.state, this.setState.bind(this)); + }; + + Redux.prototype.dispatch = function dispatch(action) { + return this.dispatchFn(action); + }; + + Redux.prototype.getState = function getState() { + return this.state; + }; + + Redux.prototype.setState = function setState(nextState) { + this.state = nextState; + this.listeners.forEach(function (listener) { + return listener(); + }); + return nextState; + }; + + Redux.prototype.subscribe = function subscribe(listener) { + var listeners = this.listeners; + + listeners.push(listener); + + return function unsubscribe() { + var index = listeners.indexOf(listener); + listeners.splice(index, 1); + }; + }; + + return Redux; + })(); + + exports['default'] = Redux; + module.exports = exports['default']; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = createDispatcher; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _utilsComposeMiddleware = __webpack_require__(4); + + var _utilsComposeMiddleware2 = _interopRequireDefault(_utilsComposeMiddleware); + + function createDispatcher(store) { + var middlewares = arguments[1] === undefined ? [] : arguments[1]; + + return function dispatcher(initialState, setState) { + var state = setState(store(initialState, {})); + + function dispatch(action) { + state = setState(store(state, action)); + return action; + } + + function getState() { + return state; + } + + var finalMiddlewares = typeof middlewares === 'function' ? middlewares(getState) : middlewares; + + return _utilsComposeMiddleware2['default'].apply(undefined, finalMiddlewares.concat([dispatch])); + }; + } + + module.exports = exports['default']; + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + "use strict"; + + exports.__esModule = true; + exports["default"] = composeMiddleware; + + function composeMiddleware() { + for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { + middlewares[_key] = arguments[_key]; + } + + return middlewares.reduceRight(function (composed, m) { + return m(composed); + }); + } + + module.exports = exports["default"]; + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = composeStores; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _lodashObjectMapValues = __webpack_require__(6); + + var _lodashObjectMapValues2 = _interopRequireDefault(_lodashObjectMapValues); + + function composeStores(stores) { + return function Composition(atom, action) { + if (atom === undefined) atom = {}; + + return (0, _lodashObjectMapValues2['default'])(stores, function (store, key) { + return store(atom[key], action); + }); + }; + } + + module.exports = exports['default']; + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + var createObjectMapper = __webpack_require__(7); + + /** + * Creates an object with the same keys as `object` and values generated by + * running each own enumerable property of `object` through `iteratee`. The + * iteratee function is bound to `thisArg` and invoked with three arguments: + * (value, key, object). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the new mapped object. + * @example + * + * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { + * return n * 3; + * }); + * // => { 'a': 3, 'b': 6 } + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * // using the `_.property` callback shorthand + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + var mapValues = createObjectMapper(); + + module.exports = mapValues; + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + var baseCallback = __webpack_require__(8), + baseForOwn = __webpack_require__(48); + + /** + * Creates a function for `_.mapKeys` or `_.mapValues`. + * + * @private + * @param {boolean} [isMapKeys] Specify mapping keys instead of values. + * @returns {Function} Returns the new map function. + */ + function createObjectMapper(isMapKeys) { + return function(object, iteratee, thisArg) { + var result = {}; + iteratee = baseCallback(iteratee, thisArg, 3); + + baseForOwn(object, function(value, key, object) { + var mapped = iteratee(value, key, object); + key = isMapKeys ? mapped : key; + value = isMapKeys ? value : mapped; + result[key] = value; + }); + return result; + }; + } + + module.exports = createObjectMapper; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + var baseMatches = __webpack_require__(9), + baseMatchesProperty = __webpack_require__(38), + bindCallback = __webpack_require__(44), + identity = __webpack_require__(45), + property = __webpack_require__(46); + + /** + * The base implementation of `_.callback` which supports specifying the + * number of arguments to provide to `func`. + * + * @private + * @param {*} [func=_.identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ + function baseCallback(func, thisArg, argCount) { + var type = typeof func; + if (type == 'function') { + return thisArg === undefined + ? func + : bindCallback(func, thisArg, argCount); + } + if (func == null) { + return identity; + } + if (type == 'object') { + return baseMatches(func); + } + return thisArg === undefined + ? property(func) + : baseMatchesProperty(func, thisArg); + } + + module.exports = baseCallback; + + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + var baseIsMatch = __webpack_require__(10), + getMatchData = __webpack_require__(35), + toObject = __webpack_require__(34); + + /** + * The base implementation of `_.matches` which does not clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + var key = matchData[0][0], + value = matchData[0][1]; + + return function(object) { + if (object == null) { + return false; + } + return object[key] === value && (value !== undefined || (key in toObject(object))); + }; + } + return function(object) { + return baseIsMatch(object, matchData); + }; + } + + module.exports = baseMatches; + + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + var baseIsEqual = __webpack_require__(11), + toObject = __webpack_require__(34); + + /** + * The base implementation of `_.isMatch` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} matchData The propery names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparing objects. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = toObject(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 result = customizer ? customizer(objValue, srcValue, key) : undefined; + if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { + return false; + } + } + } + return true; + } + + module.exports = baseIsMatch; + + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + var baseIsEqualDeep = __webpack_require__(12), + isObject = __webpack_require__(27), + isObjectLike = __webpack_require__(22); + + /** + * The base implementation of `_.isEqual` without support for `this` binding + * `customizer` functions. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); + } + + module.exports = baseIsEqual; + + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + var equalArrays = __webpack_require__(13), + equalByTag = __webpack_require__(15), + equalObjects = __webpack_require__(16), + isArray = __webpack_require__(30), + isTypedArray = __webpack_require__(33); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing objects. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `value` objects. + * @param {Array} [stackB=[]] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = objToString.call(object); + if (objTag == argsTag) { + objTag = objectTag; + } else if (objTag != objectTag) { + objIsArr = isTypedArray(object); + } + } + if (!othIsArr) { + othTag = objToString.call(other); + if (othTag == argsTag) { + othTag = objectTag; + } else if (othTag != objectTag) { + othIsArr = isTypedArray(other); + } + } + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && !(objIsArr || objIsObj)) { + return equalByTag(object, other, objTag); + } + if (!isLoose) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); + } + } + if (!isSameTag) { + return false; + } + // Assume cyclic values are equal. + // For more information on detecting circular references see https://es5.github.io/#JO. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == object) { + return stackB[length] == other; + } + } + // Add `object` and `other` to the stack of traversed objects. + stackA.push(object); + stackB.push(other); + + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); + + stackA.pop(); + stackB.pop(); + + return result; + } + + module.exports = baseIsEqualDeep; + + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + var arraySome = __webpack_require__(14); + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing arrays. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { + var index = -1, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isLoose && othLength > arrLength)) { + return false; + } + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index], + result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; + + if (result !== undefined) { + if (result) { + continue; + } + return false; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isLoose) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); + })) { + return false; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { + return false; + } + } + return true; + } + + module.exports = equalArrays; + + +/***/ }, +/* 14 */ +/***/ function(module, exports) { + + /** + * A specialized version of `_.some` for arrays without support for callback + * shorthands and `this` binding. + * + * @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.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + module.exports = arraySome; + + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + /** `Object#toString` result references. */ + var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + + /** + * 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} value The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag) { + switch (tag) { + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) + ? other != +other + : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings primitives and string + // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. + return object == (other + ''); + } + return false; + } + + module.exports = equalByTag; + + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + var keys = __webpack_require__(17); + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isLoose) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var skipCtor = isLoose; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key], + result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; + + // Recursively compare objects (susceptible to call stack limits). + if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { + return false; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (!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)) { + return false; + } + } + return true; + } + + module.exports = equalObjects; + + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(18), + isArrayLike = __webpack_require__(23), + isObject = __webpack_require__(27), + shimKeys = __webpack_require__(28); + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeKeys = getNative(Object, 'keys'); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys) + * for more details. + * + * @static + * @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'] + */ + var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? null : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; + }; + + module.exports = keys; + + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + var isNative = __webpack_require__(19); + + /** + * 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 = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; + } + + module.exports = getNative; + + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + var escapeRegExp = __webpack_require__(20), + isObjectLike = __webpack_require__(22); + + /** `Object#toString` result references. */ + var funcTag = '[object Function]'; + + /** Used to detect host constructors (Safari > 5). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var fnToString = Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + escapeRegExp(fnToString.call(hasOwnProperty)) + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (value == null) { + return false; + } + if (objToString.call(value) == funcTag) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); + } + + module.exports = isNative; + + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + var baseToString = __webpack_require__(21); + + /** + * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special). + * In addition to special characters the forward slash is escaped to allow for + * easier `eval` use and `Function` compilation. + */ + var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, + reHasRegExpChars = RegExp(reRegExpChars.source); + + /** + * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?", + * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https:\/\/lodash\.com\/\)' + */ + function escapeRegExp(string) { + string = baseToString(string); + return (string && reHasRegExpChars.test(string)) + ? string.replace(reRegExpChars, '\\$&') + : string; + } + + module.exports = escapeRegExp; + + +/***/ }, +/* 21 */ +/***/ function(module, exports) { + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + if (typeof value == 'string') { + return value; + } + return value == null ? '' : (value + ''); + } + + module.exports = baseToString; + + +/***/ }, +/* 22 */ +/***/ function(module, exports) { + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + module.exports = isObjectLike; + + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + var getLength = __webpack_require__(24), + isLength = __webpack_require__(26); + + /** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)); + } + + module.exports = isArrayLike; + + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + var baseProperty = __webpack_require__(25); + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + module.exports = getLength; + + +/***/ }, +/* 25 */ +/***/ function(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 function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + module.exports = baseProperty; + + +/***/ }, +/* 26 */ +/***/ function(module, exports) { + + /** + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + module.exports = isLength; + + +/***/ }, +/* 27 */ +/***/ function(module, exports) { + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @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(1); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + module.exports = isObject; + + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + var isArguments = __webpack_require__(29), + isArray = __webpack_require__(30), + isIndex = __webpack_require__(31), + isLength = __webpack_require__(26), + keysIn = __webpack_require__(32); + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; + } + + module.exports = shimKeys; + + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + var isArrayLike = __webpack_require__(23), + isObjectLike = __webpack_require__(22); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]'; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag; + } + + module.exports = isArguments; + + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + var getNative = __webpack_require__(18), + isLength = __webpack_require__(26), + isObjectLike = __webpack_require__(22); + + /** `Object#toString` result references. */ + var arrayTag = '[object Array]'; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeIsArray = getNative(Array, 'isArray'); + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; + }; + + module.exports = isArray; + + +/***/ }, +/* 31 */ +/***/ function(module, exports) { + + /** Used to detect unsigned integer values. */ + var reIsUint = /^\d+$/; + + /** + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * 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) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + module.exports = isIndex; + + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + var isArguments = __webpack_require__(29), + isArray = __webpack_require__(30), + isIndex = __webpack_require__(31), + isLength = __webpack_require__(26), + isObject = __webpack_require__(27); + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @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; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || isArguments(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype === object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + module.exports = keysIn; + + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + var isLength = __webpack_require__(26), + isObjectLike = __webpack_require__(22); + + /** `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]', + 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[dateTag] = typedArrayTags[errorTag] = + typedArrayTags[funcTag] = typedArrayTags[mapTag] = + typedArrayTags[numberTag] = typedArrayTags[objectTag] = + typedArrayTags[regexpTag] = typedArrayTags[setTag] = + typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * of values. + */ + var objToString = objectProto.toString; + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + function isTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; + } + + module.exports = isTypedArray; + + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(27); + + /** + * Converts `value` to an object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ + function toObject(value) { + return isObject(value) ? value : Object(value); + } + + module.exports = toObject; + + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + var isStrictComparable = __webpack_require__(36), + pairs = __webpack_require__(37); + + /** + * Gets the propery 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 = pairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; + } + + module.exports = getMatchData; + + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(27); + + /** + * 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; + + +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { + + var keys = __webpack_require__(17), + toObject = __webpack_require__(34); + + /** + * Creates a two dimensional array of the key-value pairs for `object`, + * e.g. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) + */ + function pairs(object) { + object = toObject(object); + + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + module.exports = pairs; + + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + var baseGet = __webpack_require__(39), + baseIsEqual = __webpack_require__(11), + baseSlice = __webpack_require__(40), + isArray = __webpack_require__(30), + isKey = __webpack_require__(41), + isStrictComparable = __webpack_require__(36), + last = __webpack_require__(42), + toObject = __webpack_require__(34), + toPath = __webpack_require__(43); + + /** + * The base implementation of `_.matchesProperty` which does not clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to compare. + * @returns {Function} Returns the new function. + */ + function baseMatchesProperty(path, srcValue) { + var isArr = isArray(path), + isCommon = isKey(path) && isStrictComparable(srcValue), + pathKey = (path + ''); + + path = toPath(path); + return function(object) { + if (object == null) { + return false; + } + var key = pathKey; + object = toObject(object); + if ((isArr || !isCommon) && !(key in object)) { + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + if (object == null) { + return false; + } + key = last(path); + object = toObject(object); + } + return object[key] === srcValue + ? (srcValue !== undefined || (key in object)) + : baseIsEqual(srcValue, object[key], undefined, true); + }; + } + + module.exports = baseMatchesProperty; + + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + var toObject = __webpack_require__(34); + + /** + * The base implementation of `get` without support for string paths + * and default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path of the property to get. + * @param {string} [pathKey] The key representation of path. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path, pathKey) { + if (object == null) { + return; + } + if (pathKey !== undefined && pathKey in toObject(object)) { + path = [pathKey]; + } + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; + } + + module.exports = baseGet; + + +/***/ }, +/* 40 */ +/***/ function(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; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : (+end || 0); + 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; + + +/***/ }, +/* 41 */ +/***/ function(module, exports, __webpack_require__) { + + var isArray = __webpack_require__(30), + toObject = __webpack_require__(34); + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\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) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); + } + + module.exports = isKey; + + +/***/ }, +/* 42 */ +/***/ function(module, exports) { + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @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 ? array.length : 0; + return length ? array[length - 1] : undefined; + } + + module.exports = last; + + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + var baseToString = __webpack_require__(21), + isArray = __webpack_require__(30); + + /** Used to match property names within property paths. */ + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Converts `value` to property path array if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Array} Returns the property path array. + */ + function toPath(value) { + if (isArray(value)) { + return value; + } + var result = []; + baseToString(value).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + } + + module.exports = toPath; + + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + var identity = __webpack_require__(45); + + /** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ + function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + + module.exports = bindCallback; + + +/***/ }, +/* 45 */ +/***/ function(module, exports) { + + /** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + module.exports = identity; + + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + var baseProperty = __webpack_require__(25), + basePropertyDeep = __webpack_require__(47), + isKey = __webpack_require__(41); + + /** + * Creates a function that returns the property value at `path` on a + * given object. + * + * @static + * @memberOf _ + * @category Utility + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + * @example + * + * var objects = [ + * { 'a': { 'b': { 'c': 2 } } }, + * { 'a': { 'b': { 'c': 1 } } } + * ]; + * + * _.map(objects, _.property('a.b.c')); + * // => [2, 1] + * + * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * // => [1, 2] + */ + function property(path) { + return isKey(path) ? baseProperty(path) : basePropertyDeep(path); + } + + module.exports = property; + + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + var baseGet = __webpack_require__(39), + toPath = __webpack_require__(43); + + /** + * 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 function. + */ + function basePropertyDeep(path) { + var pathKey = (path + ''); + path = toPath(path); + return function(object) { + return baseGet(object, path, pathKey); + }; + } + + module.exports = basePropertyDeep; + + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + var baseFor = __webpack_require__(49), + keys = __webpack_require__(17); + + /** + * The base implementation of `_.forOwn` without support for callback + * shorthands and `this` binding. + * + * @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 baseFor(object, iteratee, keys); + } + + module.exports = baseForOwn; + + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + var createBaseFor = __webpack_require__(50); + + /** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `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; + + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + var toObject = __webpack_require__(34); + + /** + * Creates a base function for `_.forIn` or `_.forInRight`. + * + * @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 iterable = toObject(object), + props = keysFunc(object), + length = props.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + var key = props[index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + module.exports = createBaseFor; + + +/***/ }, +/* 51 */ +/***/ function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = thunkMiddleware; + + function thunkMiddleware(getState) { + return function (next) { + var recurse = function recurse(action) { + return typeof action === 'function' ? action(recurse, getState) : next(action); + }; + + return recurse; + }; + } + + module.exports = exports['default']; + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = bindActionCreators; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _lodashObjectMapValues = __webpack_require__(6); + + var _lodashObjectMapValues2 = _interopRequireDefault(_lodashObjectMapValues); + + function bindActionCreators(actionCreators, dispatch) { + return (0, _lodashObjectMapValues2['default'])(actionCreators, function (actionCreator) { + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return dispatch(actionCreator.apply(undefined, args)); + }; + }); + } + + module.exports = exports['default']; + +/***/ } +/******/ ]); \ No newline at end of file diff --git a/dist/redux.min.js b/dist/redux.min.js new file mode 100644 index 0000000000..5e03a26c4f --- /dev/null +++ b/dist/redux.min.js @@ -0,0 +1 @@ +var Redux=function(t){function r(e){if(n[e])return n[e].exports;var o=n[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var n={};return r.m=t,r.c=n,r.p="",r(0)}([function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}r.__esModule=!0;var o=n(1),u=e(o);r.createRedux=u["default"];var c=n(3),i=e(c);r.createDispatcher=i["default"];var a=n(4),f=e(a);r.composeMiddleware=f["default"];var s=n(5),l=e(s);r.composeStores=l["default"];var p=n(52),v=e(p);r.bindActionCreators=v["default"]},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];var e=new(u.apply(i["default"],[null].concat(r)));return{subscribe:e.subscribe.bind(e),dispatch:e.dispatch.bind(e),getState:e.getState.bind(e),getDispatcher:e.getDispatcher.bind(e),replaceDispatcher:e.replaceDispatcher.bind(e)}}r.__esModule=!0;var u=Function.prototype.bind;r["default"]=o;var c=n(2),i=e(c);t.exports=r["default"]},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var u=n(3),c=e(u),i=n(5),a=e(i),f=n(51),s=e(f),l=function(){function t(r,n){o(this,t),"object"==typeof r&&(r=c["default"](a["default"](r),function(t){return[s["default"](t)]})),this.state=n,this.listeners=[],this.replaceDispatcher(r)}return t.prototype.getDispatcher=function(){return this.dispatcher},t.prototype.replaceDispatcher=function(t){this.dispatcher=t,this.dispatchFn=t(this.state,this.setState.bind(this))},t.prototype.dispatch=function(t){return this.dispatchFn(t)},t.prototype.getState=function(){return this.state},t.prototype.setState=function(t){return this.state=t,this.listeners.forEach(function(t){return t()}),t},t.prototype.subscribe=function(t){var r=this.listeners;return r.push(t),function(){var n=r.indexOf(t);r.splice(n,1)}},t}();r["default"]=l,t.exports=r["default"]},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t){var r=void 0===arguments[1]?[]:arguments[1];return function(n,e){function o(r){return i=e(t(i,r)),r}function u(){return i}var i=e(t(n,{})),a="function"==typeof r?r(u):r;return c["default"].apply(void 0,a.concat([o]))}}r.__esModule=!0,r["default"]=o;var u=n(4),c=e(u);t.exports=r["default"]},function(t,r){"use strict";function n(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];return r.reduceRight(function(t,r){return r(t)})}r.__esModule=!0,r["default"]=n,t.exports=r["default"]},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t){return function(r,n){return void 0===r&&(r={}),c["default"](t,function(t,e){return t(r[e],n)})}}r.__esModule=!0,r["default"]=o;var u=n(6),c=e(u);t.exports=r["default"]},function(t,r,n){var e=n(7),o=e();t.exports=o},function(t,r,n){function e(t){return function(r,n,e){var c={};return n=o(n,e,3),u(r,function(r,e,o){var u=n(r,e,o);e=t?u:e,r=t?r:u,c[e]=r}),c}}var o=n(8),u=n(48);t.exports=e},function(t,r,n){function e(t,r,n){var e=typeof t;return"function"==e?void 0===r?t:c(t,r,n):null==t?i:"object"==e?o(t):void 0===r?a(t):u(t,r)}var o=n(9),u=n(38),c=n(44),i=n(45),a=n(46);t.exports=e},function(t,r,n){function e(t){var r=u(t);if(1==r.length&&r[0][2]){var n=r[0][0],e=r[0][1];return function(t){return null==t?!1:t[n]===e&&(void 0!==e||n in c(t))}}return function(t){return o(t,r)}}var o=n(10),u=n(35),c=n(34);t.exports=e},function(t,r,n){function e(t,r,n){var e=r.length,c=e,i=!n;if(null==t)return!c;for(t=u(t);e--;){var a=r[e];if(i&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++ef))return!1;for(;++a-1&&t%1==0&&e>=t}var e=9007199254740991;t.exports=n},function(t,r){function n(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}t.exports=n},function(t,r,n){function e(t){for(var r=a(t),n=r.length,e=n&&t.length,f=!!e&&i(e)&&(u(t)||o(t)),l=-1,p=[];++l-1&&t%1==0&&r>t}var e=/^\d+$/,o=9007199254740991;t.exports=n},function(t,r,n){function e(t){if(null==t)return[];a(t)||(t=Object(t));var r=t.length;r=r&&i(r)&&(u(t)||o(t))&&r||0;for(var n=t.constructor,e=-1,f="function"==typeof n&&n.prototype===t,l=Array(r),p=r>0;++ee;)t=t[r[e++]];return e&&e==u?t:void 0}}var o=n(34);t.exports=e},function(t,r){function n(t,r,n){var e=-1,o=t.length;r=null==r?0:+r||0,0>r&&(r=-r>o?0:o+r),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var u=Array(o);++eo;o++)e[o]=arguments[o];return r(t.apply(void 0,e))}})}r.__esModule=!0,r["default"]=o;var u=n(6),c=e(u);t.exports=r["default"]}]); \ No newline at end of file diff --git a/package.json b/package.json index 916a3eda1c..b2e279d995 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Atomic Flux with hot reloading", "main": "lib/index.js", "scripts": { + "browser": "scripts/browser", "build": "scripts/build", "clean": "scripts/clean", "lint": "scripts/lint", @@ -53,7 +54,6 @@ "webpack-dev-server": "^1.8.2" }, "dependencies": { - "babel-runtime": "^5.5.8", "invariant": "^2.0.0", "lodash": "^3.9.3" } diff --git a/scripts/browser b/scripts/browser new file mode 100755 index 0000000000..bbd124f5c6 --- /dev/null +++ b/scripts/browser @@ -0,0 +1,7 @@ +#!/bin/sh -e + +WEBPACK_CMD=node_modules/.bin/webpack + +mkdir -p dist +$WEBPACK_CMD src/index.js dist/redux.js +NODE_ENV=production $WEBPACK_CMD src/index.js dist/redux.min.js diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000000..bd9850c2db --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,40 @@ +'use strict'; + +var webpack = require('webpack'); + +var plugins = [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) + }), + +]; + +if (process.env.NODE_ENV === 'production') { + plugins.push( + new webpack.optimize.UglifyJsPlugin({ + compressor: { + warnings: false + } + }) + ); +} + +module.exports = { + + output: { + library: 'Redux', + libraryTarget: 'var' + }, + + plugins: plugins, + + resolve: { + extensions: ['', '.js'] + }, + + module: { + loaders: [ + { test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ } + ] + } +};