Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unchanged

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unchanged - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # unchanged CHANGELOG

## 1.0.5
* Fix issue with using array keys when using `add` with nested arrays
## 1.0.4

@@ -7,0 +11,0 @@

24

dist/unchanged.js

@@ -265,3 +265,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var nestedValue = get(path, object);
var fullPath = Object(__WEBPACK_IMPORTED_MODULE_1__utils__["f" /* isArray */])(nestedValue) ? (Object(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isEmptyKey */])(path) ? '' : path) + '[' + nestedValue.length + ']' : path;
var fullPath = Object(__WEBPACK_IMPORTED_MODULE_1__utils__["f" /* isArray */])(nestedValue) ? Object(__WEBPACK_IMPORTED_MODULE_1__utils__["f" /* isArray */])(path) ? path.concat([nestedValue.length]) : (Object(__WEBPACK_IMPORTED_MODULE_1__utils__["h" /* isEmptyKey */])(path) ? '' : path) + '[' + nestedValue.length + ']' : path;

@@ -277,2 +277,3 @@ return set(fullPath, value, object);

/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __; });
/* unused harmony export slice */
/* unused harmony export getPassedArgs */

@@ -287,2 +288,7 @@ /* unused harmony export isAnyPlaceholder */

/**
* @constant {function} slice
*/
var slice = [].slice;
/**
* @function getPassedArgs

@@ -338,12 +344,10 @@ *

var curried = function curried() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
if (arguments.length >= arity && !isAnyPlaceholder(arguments, arity)) {
return fn.apply(this, arguments);
}
return args.length >= arity && !isAnyPlaceholder(args, arity) ? fn.apply(undefined, args) : function () {
for (var _len2 = arguments.length, nextArgs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
nextArgs[_key2] = arguments[_key2];
}
var originalArgs = slice.call(arguments);
return curried.apply(undefined, getPassedArgs(args, nextArgs));
return function () {
return curried.apply(this, slice.call(getPassedArgs(originalArgs, slice.call(arguments))));
};

@@ -377,4 +381,2 @@ };

/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pathington__ = __webpack_require__(5);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
// external dependencies

@@ -442,3 +444,3 @@

if (object.constructor === Object) {
return _extends({}, object);
return Object.assign({}, object);
}

@@ -445,0 +447,0 @@

@@ -1,1 +0,1 @@

!(function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("unchanged",[],n):"object"==typeof exports?exports.unchanged=n():t.unchanged=n()})("undefined"!=typeof self?self:this,(function(){return (function(t){function n(r){if(e[r])return e[r].exports;var u=e[r]={i:r,l:!1,exports:{}};return t[r].call(u.exports,u,u.exports,n),u.l=!0,u.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=0)})([(function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol?Symbol("placeholder"):60881,u=function(t,n){var e=t.map((function(t){return t===r&&n.length?n.shift():t}));return n.length?e.concat(n):e},o=function(t,n){for(var e=0;e<n;e++)if(t[e]===r)return!0;return!1},c=function(t){var n=t.length;return function e(){for(var r=arguments.length,c=Array(r),i=0;i<r;i++)c[i]=arguments[i];return c.length>=n&&!o(c,n)?t.apply(void 0,c):function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(void 0,u(c,n))}}},i=e(1);e.d(n,"get",(function(){return f})),e.d(n,"has",(function(){return a})),e.d(n,"merge",(function(){return s})),e.d(n,"remove",(function(){return l})),e.d(n,"set",(function(){return d})),e.d(n,"add",(function(){return b})),e.d(n,"__",(function(){return r}));var f=c((function(t,n){return Object(i.h)(t)?n:Object(i.c)(t,n)})),a=c((function(t,n){return Object(i.h)(t)?!!n:Object(i.e)(t,n)})),s=c((function(t,n,e){return Object(i.g)(e)?Object(i.h)(t)?Object(i.b)(e,n):Object(i.a)(t,e,(function(t,e){t[e]=Object(i.b)(t[e],n)})):n})),l=c((function(t,n){return Object(i.h)(t)?Object(i.d)(n):Object(i.e)(t,n)?Object(i.a)(t,n,(function(t,n){Object(i.f)(t)?Object(i.i)(t,n):delete t[n]})):n})),d=c((function(t,n,e){return Object(i.h)(t)?n:Object(i.a)(t,e,(function(t,e){t[e]=n}))})),b=c((function(t,n,e){var r=f(t,e),u=Object(i.f)(r)?(Object(i.h)(t)?"":t)+"["+r.length+"]":t;return d(u,n,e)}))}),(function(t,n,e){"use strict";(function(t){e.d(n,"f",(function(){return i})),e.d(n,"g",(function(){return f})),e.d(n,"d",(function(){return d})),e.d(n,"b",(function(){return h})),e.d(n,"c",(function(){return O})),e.d(n,"a",(function(){return v})),e.d(n,"e",(function(){return g})),e.d(n,"h",(function(){return m})),e.d(n,"i",(function(){return x}));var r=e(3),u=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,c=/^\s*function\s*([^\(]*)/i,i=Array.isArray,f=function(t){return!!t&&"object"==typeof t&&!(t instanceof Date||t instanceof RegExp)&&t.$$typeof!==o},a=function(n){return"function"==typeof n&&("undefined"!=typeof window?window:t)[n.name||Function.prototype.toString.call(n).split(c)[1]]===n},s=function(t){return i(t)?t.map((function(t){return t})):t.constructor===Object?u({},t):a(t.constructor)?{}:Object.keys(t).reduce((function(n,e){return n[e]=t[e],n}),Object.create(Object.getPrototypeOf(t)))},l=function(t){return"number"==typeof t?[]:{}},d=function(t){return i(t)?[]:{}},b=function(t){return f(t)?s(t):t},p=function(t,n){return f(t)?s(t):l(n)},y=function t(n,e,r,u,o){var c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=n[c],f=c+1;if(f===n.length){var a=e||u?r(e,i):o;return u?e:a}return u?(e[i]=t(n,p(e[i],n[f]),r,u,o,f),e):e&&e[i]?t(n,e[i],r,u,o,f):o},h=function t(n,e){var r=i(n);if(r!==i(e)||!f(n))return b(e);if(r)return n.concat(e.map(b));var u=Object.keys(n).reduce((function(t,e){return t[e]=b(n[e]),t}),n.constructor===Object?{}:Object.create(Object.getPrototypeOf(n)));return Object.keys(e).reduce((function(r,u){return r[u]=f(e[u])?t(n[u],e[u]):e[u],r}),u)},j=function(t){return i(t)?t:Object(r.a)(t)},O=function(t,n){var e=j(t);return 1===e.length?n?n[e[0]]:void 0:y(e,n,(function(t,n){return t[n]}))},v=function(t,n,e){var r=j(t),u=f(n)?s(n):l(r[0]);return 1===r.length?(e(u,r[0]),u):y(r,u,e,!0)},g=function(t,n){var e=j(t);return 1===e.length?!!n&&void 0!==n[e[0]]:y(e,n,(function(t,n){return!!t&&void 0!==t[n]}),!1,!1)},m=function(t){return void 0===t||null===t||i(t)&&!t.length},x=function(t,n){if(t.length){for(var e=t.length,r=n;r<e;)t[r]=t[r+1],r++;t.length--}}}).call(n,e(2))}),(function(t,n){var e;e=(function(){return this})();try{e=e||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(e=window)}t.exports=e}),(function(t,n,e){"use strict";var r={clear:function(){r.results={},r.size=0},results:{},size:0},u=/"[^"]+"|`[^`]+`|'[^']+'|[^.[\]]+/g,o=/^\d+$/i,c=/^"[^"]+"|`[^`]+`|'[^']+'$/,i=function(t){return!!t.length&&o.test(t)},f=function(t){return c.test(t)},a=function(t){var n=f(t)?t.substring(1,t.length-1):t;return i(n)?+n:n},s=function(t){return r.results[t]?r.results[t]:(r.size>500&&r.clear(),r.results[t]=t?t.match(u).map(a):[t],r.size++,r.results[t])};e.d(n,"a",(function(){return l}));var l=function(t){return"string"==typeof t?s(t):Array.isArray(t)?t.map(a):["number"==typeof t?t:""+t]}})])}));
!(function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("unchanged",[],n):"object"==typeof exports?exports.unchanged=n():t.unchanged=n()})("undefined"!=typeof self?self:this,(function(){return (function(t){function n(r){if(e[r])return e[r].exports;var u=e[r]={i:r,l:!1,exports:{}};return t[r].call(u.exports,u,u.exports,n),u.l=!0,u.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=0)})([(function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol?Symbol("placeholder"):60881,u=[].slice,c=function(t,n){var e=t.map((function(t){return t===r&&n.length?n.shift():t}));return n.length?e.concat(n):e},o=function(t,n){for(var e=0;e<n;e++)if(t[e]===r)return!0;return!1},i=function(t){var n=t.length;return function e(){if(arguments.length>=n&&!o(arguments,n))return t.apply(this,arguments);var r=u.call(arguments);return function(){return e.apply(this,u.call(c(r,u.call(arguments))))}}},f=e(1);e.d(n,"get",(function(){return a})),e.d(n,"has",(function(){return s})),e.d(n,"merge",(function(){return l})),e.d(n,"remove",(function(){return d})),e.d(n,"set",(function(){return b})),e.d(n,"add",(function(){return p})),e.d(n,"__",(function(){return r}));var a=i((function(t,n){return Object(f.h)(t)?n:Object(f.c)(t,n)})),s=i((function(t,n){return Object(f.h)(t)?!!n:Object(f.e)(t,n)})),l=i((function(t,n,e){return Object(f.g)(e)?Object(f.h)(t)?Object(f.b)(e,n):Object(f.a)(t,e,(function(t,e){t[e]=Object(f.b)(t[e],n)})):n})),d=i((function(t,n){return Object(f.h)(t)?Object(f.d)(n):Object(f.e)(t,n)?Object(f.a)(t,n,(function(t,n){Object(f.f)(t)?Object(f.i)(t,n):delete t[n]})):n})),b=i((function(t,n,e){return Object(f.h)(t)?n:Object(f.a)(t,e,(function(t,e){t[e]=n}))})),p=i((function(t,n,e){var r=a(t,e),u=Object(f.f)(r)?Object(f.f)(t)?t.concat([r.length]):(Object(f.h)(t)?"":t)+"["+r.length+"]":t;return b(u,n,e)}))}),(function(t,n,e){"use strict";(function(t){e.d(n,"f",(function(){return o})),e.d(n,"g",(function(){return i})),e.d(n,"d",(function(){return l})),e.d(n,"b",(function(){return h})),e.d(n,"c",(function(){return y})),e.d(n,"a",(function(){return O})),e.d(n,"e",(function(){return g})),e.d(n,"h",(function(){return v})),e.d(n,"i",(function(){return m}));var r=e(3),u="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,c=/^\s*function\s*([^\(]*)/i,o=Array.isArray,i=function(t){return!!t&&"object"==typeof t&&!(t instanceof Date||t instanceof RegExp)&&t.$$typeof!==u},f=function(n){return"function"==typeof n&&("undefined"!=typeof window?window:t)[n.name||Function.prototype.toString.call(n).split(c)[1]]===n},a=function(t){return o(t)?t.map((function(t){return t})):t.constructor===Object?Object.assign({},t):f(t.constructor)?{}:Object.keys(t).reduce((function(n,e){return n[e]=t[e],n}),Object.create(Object.getPrototypeOf(t)))},s=function(t){return"number"==typeof t?[]:{}},l=function(t){return o(t)?[]:{}},d=function(t){return i(t)?a(t):t},b=function(t,n){return i(t)?a(t):s(n)},p=function t(n,e,r,u,c){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,i=n[o],f=o+1;if(f===n.length){var a=e||u?r(e,i):c;return u?e:a}return u?(e[i]=t(n,b(e[i],n[f]),r,u,c,f),e):e&&e[i]?t(n,e[i],r,u,c,f):c},h=function t(n,e){var r=o(n);if(r!==o(e)||!i(n))return d(e);if(r)return n.concat(e.map(d));var u=Object.keys(n).reduce((function(t,e){return t[e]=d(n[e]),t}),n.constructor===Object?{}:Object.create(Object.getPrototypeOf(n)));return Object.keys(e).reduce((function(r,u){return r[u]=i(e[u])?t(n[u],e[u]):e[u],r}),u)},j=function(t){return o(t)?t:Object(r.a)(t)},y=function(t,n){var e=j(t);return 1===e.length?n?n[e[0]]:void 0:p(e,n,(function(t,n){return t[n]}))},O=function(t,n,e){var r=j(t),u=i(n)?a(n):s(r[0]);return 1===r.length?(e(u,r[0]),u):p(r,u,e,!0)},g=function(t,n){var e=j(t);return 1===e.length?!!n&&void 0!==n[e[0]]:p(e,n,(function(t,n){return!!t&&void 0!==t[n]}),!1,!1)},v=function(t){return void 0===t||null===t||o(t)&&!t.length},m=function(t,n){if(t.length){for(var e=t.length,r=n;r<e;)t[r]=t[r+1],r++;t.length--}}}).call(n,e(2))}),(function(t,n){var e;e=(function(){return this})();try{e=e||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(e=window)}t.exports=e}),(function(t,n,e){"use strict";var r={clear:function(){r.results={},r.size=0},results:{},size:0},u=/"[^"]+"|`[^`]+`|'[^']+'|[^.[\]]+/g,c=/^\d+$/i,o=/^"[^"]+"|`[^`]+`|'[^']+'$/,i=function(t){return!!t.length&&c.test(t)},f=function(t){return o.test(t)},a=function(t){var n=f(t)?t.substring(1,t.length-1):t;return i(n)?+n:n},s=function(t){return r.results[t]?r.results[t]:(r.size>500&&r.clear(),r.results[t]=t?t.match(u).map(a):[t],r.size++,r.results[t])};e.d(n,"a",(function(){return l}));var l=function(t){return"string"==typeof t?s(t):Array.isArray(t)?t.map(a):["number"==typeof t?t:""+t]}})])}));

@@ -7,2 +7,7 @@ /**

/**
* @constant {function} slice
*/
export var slice = [].slice;
/**
* @function getPassedArgs

@@ -58,12 +63,10 @@ *

var curried = function curried() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
if (arguments.length >= arity && !isAnyPlaceholder(arguments, arity)) {
return fn.apply(this, arguments);
}
return args.length >= arity && !isAnyPlaceholder(args, arity) ? fn.apply(undefined, args) : function () {
for (var _len2 = arguments.length, nextArgs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
nextArgs[_key2] = arguments[_key2];
}
var originalArgs = slice.call(arguments);
return curried.apply(undefined, getPassedArgs(args, nextArgs));
return function () {
return curried.apply(this, slice.call(getPassedArgs(originalArgs, slice.call(arguments))));
};

@@ -70,0 +73,0 @@ };

@@ -110,5 +110,5 @@ // utils

var nestedValue = get(path, object);
var fullPath = isArray(nestedValue) ? (isEmptyKey(path) ? '' : path) + '[' + nestedValue.length + ']' : path;
var fullPath = isArray(nestedValue) ? isArray(path) ? path.concat([nestedValue.length]) : (isEmptyKey(path) ? '' : path) + '[' + nestedValue.length + ']' : path;
return set(fullPath, value, object);
});

@@ -1,3 +0,1 @@

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
// external dependencies

@@ -65,3 +63,3 @@ import { parse } from 'pathington';

if (object.constructor === Object) {
return _extends({}, object);
return Object.assign({}, object);
}

@@ -68,0 +66,0 @@

@@ -10,2 +10,7 @@ 'use strict';

/**
* @constant {function} slice
*/
var slice = exports.slice = [].slice;
/**
* @function getPassedArgs

@@ -61,12 +66,10 @@ *

var curried = function curried() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
if (arguments.length >= arity && !isAnyPlaceholder(arguments, arity)) {
return fn.apply(this, arguments);
}
return args.length >= arity && !isAnyPlaceholder(args, arity) ? fn.apply(undefined, args) : function () {
for (var _len2 = arguments.length, nextArgs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
nextArgs[_key2] = arguments[_key2];
}
var originalArgs = slice.call(arguments);
return curried.apply(undefined, getPassedArgs(args, nextArgs));
return function () {
return curried.apply(this, slice.call(getPassedArgs(originalArgs, slice.call(arguments))));
};

@@ -73,0 +76,0 @@ };

@@ -117,5 +117,5 @@ 'use strict';

var nestedValue = get(path, object);
var fullPath = (0, _utils.isArray)(nestedValue) ? ((0, _utils.isEmptyKey)(path) ? '' : path) + '[' + nestedValue.length + ']' : path;
var fullPath = (0, _utils.isArray)(nestedValue) ? (0, _utils.isArray)(path) ? path.concat([nestedValue.length]) : ((0, _utils.isEmptyKey)(path) ? '' : path) + '[' + nestedValue.length + ']' : path;
return set(fullPath, value, object);
});

@@ -6,5 +6,2 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // external dependencies
var _pathington = require('pathington');

@@ -20,2 +17,3 @@

*/
// external dependencies
var FUNCTION_NAME = /^\s*function\s*([^\(]*)/i;

@@ -72,3 +70,3 @@

if (object.constructor === Object) {
return _extends({}, object);
return Object.assign({}, object);
}

@@ -75,0 +73,0 @@

@@ -33,5 +33,5 @@ {

"devDependencies": {
"ava": "^0.24.0",
"ava": "^0.25.0",
"babel-cli": "^6.26.0",
"babel-eslint": "^8.1.1",
"babel-eslint": "^8.2.1",
"babel-loader": "^7.1.2",

@@ -43,3 +43,3 @@ "babel-preset-env": "^1.6.1",

"cli-table": "^0.3.1",
"eslint": "^4.14.0",
"eslint": "^4.16.0",
"eslint-config-rapid7": "^2.11.1",

@@ -57,5 +57,5 @@ "eslint-friendly-formatter": "^3.0.0",

"react-dom": "^16.2.0",
"sinon": "^4.1.3",
"sinon": "^4.2.2",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.9.7"
"webpack-dev-server": "^2.11.1"
},

@@ -96,3 +96,3 @@ "keywords": [

},
"version": "1.0.4"
"version": "1.0.5"
}

@@ -18,3 +18,3 @@ # unchanged

* [\_\_](#__)
* [Differences with other libraries](#differences-with-other-libraries)
* [Differences from other libraries](#differences-from-other-libraries)
* [lodash](#lodash)

@@ -152,3 +152,3 @@ * [ramda](#ramda)

`add(path: (Array<number|string>|number|string), value: any, object: (Array<any>|object)): (Array<any>|Object)`
`merge(path: (Array<number|string>|number|string), value: any, object: (Array<any>|object)): (Array<any>|Object)`

@@ -277,5 +277,5 @@ Returns a new object that is a deep merge of the two `object`s passed at the `path` specified.

* `dev` => run webpack dev server to run example app / playground
* `dist` => runs `build` and `build-minified`
* `dist` => runs `build` and `build:minified`
* `lint` => run ESLint against all files in the `src` folder
* `prepublish` => runs `compile-for-publish`
* `prepublish` => runs `prepublish:compile` when publishing
* `prepublish:compile` => run `lint`, `test:coverage`, `transpile:es`, `transpile:lib`, `dist`

@@ -282,0 +282,0 @@ * `test` => run AVA test functions with `NODE_ENV=test`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc