Comparing version 1.5.0 to 1.6.0
@@ -0,1 +1,5 @@ | ||
## 1.6.0 (2018-8-8) | ||
* Replace functions when merging (`merge()` and `mergeDeep()`) [#25, @hipstersmoothie] | ||
## 1.5.0 (2018-7-23) | ||
@@ -2,0 +6,0 @@ |
@@ -104,3 +104,3 @@ 'use strict'; | ||
var type = typeof o === 'undefined' ? 'undefined' : _typeof(o); | ||
return o != null && (type === 'object' || type === 'function'); | ||
return o != null && type === 'object'; | ||
} | ||
@@ -107,0 +107,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";function throwStr(e){throw new Error(e)}function getKeysAndSymbols(e){var r=Object.keys(e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r}function clone(e){if(Array.isArray(e))return e.slice();for(var r=getKeysAndSymbols(e),t={},n=0;n<r.length;n++){var o=r[n];t[o]=e[o]}return t}function doMerge(e,r,t){var n=t;!(null!=n)&&throwStr(INVALID_ARGS);for(var o=!1,a=arguments.length,s=Array(a>3?a-3:0),u=3;a>u;u++)s[u-3]=arguments[u];for(var l=0;l<s.length;l++){var i=s[l];if(null!=i){var c=getKeysAndSymbols(i);if(c.length)for(var d=0;d<=c.length;d++){var g=c[d];if(!e||void 0===n[g]){var f=i[g];r&&isObject(n[g])&&isObject(f)&&(f=doMerge(e,r,n[g],f)),void 0!==f&&f!==n[g]&&(o||(o=!0,n=clone(n)),n[g]=f)}}}}return n}function isObject(e){var r="undefined"==typeof e?"undefined":_typeof(e);return null!=e&&("object"===r||"function"===r)}function addLast(e,r){return e.concat(Array.isArray(r)?r:[r])}function addFirst(e,r){return Array.isArray(r)?r.concat(e):[r].concat(e)}function removeLast(e){return e.length?e.slice(0,e.length-1):e}function removeFirst(e){return e.length?e.slice(1):e}function insert(e,r,t){return e.slice(0,r).concat(Array.isArray(t)?t:[t]).concat(e.slice(r))}function removeAt(e,r){return r>=e.length||0>r?e:e.slice(0,r).concat(e.slice(r+1))}function replaceAt(e,r,t){if(e[r]===t)return e;for(var n=e.length,o=Array(n),a=0;n>a;a++)o[a]=e[a];return o[r]=t,o}function getIn(e,r){if(!Array.isArray(r)&&throwStr(INVALID_ARGS),null==e)return void 0;for(var t=e,n=0;n<r.length;n++){var o=r[n];if(t=null!=t?t[o]:void 0,void 0===t)return t}return t}function set(e,r,t){var n="number"==typeof r?[]:{},o=null==e?n:e;if(o[r]===t)return o;var a=clone(o);return a[r]=t,a}function doSetIn(e,r,t,n){var o=void 0,a=r[n];if(n===r.length-1)o=t;else{var s=isObject(e)&&isObject(e[a])?e[a]:"number"==typeof r[n+1]?[]:{};o=doSetIn(s,r,t,n+1)}return set(e,a,o)}function setIn(e,r,t){return r.length?doSetIn(e,r,t,0):t}function update(e,r,t){var n=null==e?void 0:e[r],o=t(n);return set(e,r,o)}function updateIn(e,r,t){var n=getIn(e,r),o=t(n);return setIn(e,r,o)}function merge(e,r,t,n,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;s>l;l++)u[l-6]=arguments[l];return u.length?doMerge.call.apply(doMerge,[null,!1,!1,e,r,t,n,o,a].concat(u)):doMerge(!1,!1,e,r,t,n,o,a)}function mergeDeep(e,r,t,n,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;s>l;l++)u[l-6]=arguments[l];return u.length?doMerge.call.apply(doMerge,[null,!1,!0,e,r,t,n,o,a].concat(u)):doMerge(!1,!0,e,r,t,n,o,a)}function mergeIn(e,r,t,n,o,a,s){var u=getIn(e,r);null==u&&(u={});for(var l=void 0,i=arguments.length,c=Array(i>7?i-7:0),d=7;i>d;d++)c[d-7]=arguments[d];return l=c.length?doMerge.call.apply(doMerge,[null,!1,!1,u,t,n,o,a,s].concat(c)):doMerge(!1,!1,u,t,n,o,a,s),setIn(e,r,l)}function omit(e,r){for(var t=Array.isArray(r)?r:[r],n=!1,o=0;o<t.length;o++)if(hasOwnProperty.call(e,t[o])){n=!0;break}if(!n)return e;for(var a={},s=getKeysAndSymbols(e),u=0;u<s.length;u++){var l=s[u];t.indexOf(l)>=0||(a[l]=e[l])}return a}function addDefaults(e,r,t,n,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;s>l;l++)u[l-6]=arguments[l];return u.length?doMerge.call.apply(doMerge,[null,!0,!1,e,r,t,n,o,a].concat(u)):doMerge(!0,!1,e,r,t,n,o,a)}Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};exports.clone=clone,exports.addLast=addLast,exports.addFirst=addFirst,exports.removeLast=removeLast,exports.removeFirst=removeFirst,exports.insert=insert,exports.removeAt=removeAt,exports.replaceAt=replaceAt,exports.getIn=getIn,exports.set=set,exports.setIn=setIn,exports.update=update,exports.updateIn=updateIn,exports.merge=merge,exports.mergeDeep=mergeDeep,exports.mergeIn=mergeIn,exports.omit=omit,exports.addDefaults=addDefaults;/*! | ||
"use strict";function throwStr(e){throw new Error(e)}function getKeysAndSymbols(e){var r=Object.keys(e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r}function clone(e){if(Array.isArray(e))return e.slice();for(var r=getKeysAndSymbols(e),t={},n=0;n<r.length;n++){var o=r[n];t[o]=e[o]}return t}function doMerge(e,r,t){var n=t;!(null!=n)&&throwStr(INVALID_ARGS);for(var o=!1,a=arguments.length,s=Array(a>3?a-3:0),u=3;a>u;u++)s[u-3]=arguments[u];for(var l=0;l<s.length;l++){var i=s[l];if(null!=i){var c=getKeysAndSymbols(i);if(c.length)for(var d=0;d<=c.length;d++){var g=c[d];if(!e||void 0===n[g]){var f=i[g];r&&isObject(n[g])&&isObject(f)&&(f=doMerge(e,r,n[g],f)),void 0!==f&&f!==n[g]&&(o||(o=!0,n=clone(n)),n[g]=f)}}}}return n}function isObject(e){var r="undefined"==typeof e?"undefined":_typeof(e);return null!=e&&"object"===r}function addLast(e,r){return e.concat(Array.isArray(r)?r:[r])}function addFirst(e,r){return Array.isArray(r)?r.concat(e):[r].concat(e)}function removeLast(e){return e.length?e.slice(0,e.length-1):e}function removeFirst(e){return e.length?e.slice(1):e}function insert(e,r,t){return e.slice(0,r).concat(Array.isArray(t)?t:[t]).concat(e.slice(r))}function removeAt(e,r){return r>=e.length||0>r?e:e.slice(0,r).concat(e.slice(r+1))}function replaceAt(e,r,t){if(e[r]===t)return e;for(var n=e.length,o=Array(n),a=0;n>a;a++)o[a]=e[a];return o[r]=t,o}function getIn(e,r){if(!Array.isArray(r)&&throwStr(INVALID_ARGS),null==e)return void 0;for(var t=e,n=0;n<r.length;n++){var o=r[n];if(t=null!=t?t[o]:void 0,void 0===t)return t}return t}function set(e,r,t){var n="number"==typeof r?[]:{},o=null==e?n:e;if(o[r]===t)return o;var a=clone(o);return a[r]=t,a}function doSetIn(e,r,t,n){var o=void 0,a=r[n];if(n===r.length-1)o=t;else{var s=isObject(e)&&isObject(e[a])?e[a]:"number"==typeof r[n+1]?[]:{};o=doSetIn(s,r,t,n+1)}return set(e,a,o)}function setIn(e,r,t){return r.length?doSetIn(e,r,t,0):t}function update(e,r,t){var n=null==e?void 0:e[r],o=t(n);return set(e,r,o)}function updateIn(e,r,t){var n=getIn(e,r),o=t(n);return setIn(e,r,o)}function merge(e,r,t,n,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;s>l;l++)u[l-6]=arguments[l];return u.length?doMerge.call.apply(doMerge,[null,!1,!1,e,r,t,n,o,a].concat(u)):doMerge(!1,!1,e,r,t,n,o,a)}function mergeDeep(e,r,t,n,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;s>l;l++)u[l-6]=arguments[l];return u.length?doMerge.call.apply(doMerge,[null,!1,!0,e,r,t,n,o,a].concat(u)):doMerge(!1,!0,e,r,t,n,o,a)}function mergeIn(e,r,t,n,o,a,s){var u=getIn(e,r);null==u&&(u={});for(var l=void 0,i=arguments.length,c=Array(i>7?i-7:0),d=7;i>d;d++)c[d-7]=arguments[d];return l=c.length?doMerge.call.apply(doMerge,[null,!1,!1,u,t,n,o,a,s].concat(c)):doMerge(!1,!1,u,t,n,o,a,s),setIn(e,r,l)}function omit(e,r){for(var t=Array.isArray(r)?r:[r],n=!1,o=0;o<t.length;o++)if(hasOwnProperty.call(e,t[o])){n=!0;break}if(!n)return e;for(var a={},s=getKeysAndSymbols(e),u=0;u<s.length;u++){var l=s[u];t.indexOf(l)>=0||(a[l]=e[l])}return a}function addDefaults(e,r,t,n,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;s>l;l++)u[l-6]=arguments[l];return u.length?doMerge.call.apply(doMerge,[null,!0,!1,e,r,t,n,o,a].concat(u)):doMerge(!0,!1,e,r,t,n,o,a)}Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};exports.clone=clone,exports.addLast=addLast,exports.addFirst=addFirst,exports.removeLast=removeLast,exports.removeFirst=removeFirst,exports.insert=insert,exports.removeAt=removeAt,exports.replaceAt=replaceAt,exports.getIn=getIn,exports.set=set,exports.setIn=setIn,exports.update=update,exports.updateIn=updateIn,exports.merge=merge,exports.mergeDeep=mergeDeep,exports.mergeIn=mergeIn,exports.omit=omit,exports.addDefaults=addDefaults;/*! | ||
* Timm | ||
@@ -3,0 +3,0 @@ * |
{ | ||
"name": "timm", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "Immutability helpers with fast reads and acceptable writes", | ||
@@ -5,0 +5,0 @@ "main": "lib/timm.js", |
@@ -84,3 +84,3 @@ // @flow | ||
const type = typeof o; | ||
return o != null && (type === 'object' || type === 'function'); | ||
return o != null && type === 'object'; | ||
} | ||
@@ -87,0 +87,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231373