merge-anything
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -22,10 +22,9 @@ 'use strict'; | ||
function __spreadArrays() { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
function __spreadArray(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
} | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
function concatArrays(originVal, newVal) { | ||
@@ -63,3 +62,3 @@ if (isWhat.isArray(originVal) && isWhat.isArray(newVal)) { | ||
var symbols_1 = Object.getOwnPropertySymbols(origin); | ||
newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) { | ||
newObject = __spreadArray(__spreadArray([], props_1), symbols_1).reduce(function (carry, key) { | ||
var targetVal = origin[key]; | ||
@@ -76,3 +75,3 @@ if ((!isWhat.isSymbol(key) && !Object.getOwnPropertyNames(newComer).includes(key)) || | ||
var symbols = Object.getOwnPropertySymbols(newComer); | ||
var result = __spreadArrays(props, symbols).reduce(function (carry, key) { | ||
var result = __spreadArray(__spreadArray([], props), symbols).reduce(function (carry, key) { | ||
// re-define the origin and newComer as targetVal and newVal | ||
@@ -79,0 +78,0 @@ var newVal = newComer[key]; |
@@ -18,10 +18,9 @@ import { isArray, isPlainObject, isSymbol } from 'is-what'; | ||
function __spreadArrays() { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
function __spreadArray(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | ||
to[j] = from[i]; | ||
return to; | ||
} | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
function concatArrays(originVal, newVal) { | ||
@@ -59,3 +58,3 @@ if (isArray(originVal) && isArray(newVal)) { | ||
var symbols_1 = Object.getOwnPropertySymbols(origin); | ||
newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) { | ||
newObject = __spreadArray(__spreadArray([], props_1), symbols_1).reduce(function (carry, key) { | ||
var targetVal = origin[key]; | ||
@@ -72,3 +71,3 @@ if ((!isSymbol(key) && !Object.getOwnPropertyNames(newComer).includes(key)) || | ||
var symbols = Object.getOwnPropertySymbols(newComer); | ||
var result = __spreadArrays(props, symbols).reduce(function (carry, key) { | ||
var result = __spreadArray(__spreadArray([], props), symbols).reduce(function (carry, key) { | ||
// re-define the origin and newComer as targetVal and newVal | ||
@@ -75,0 +74,0 @@ var newVal = newComer[key]; |
{ | ||
"name": "merge-anything", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"sideEffects": false, | ||
@@ -13,3 +13,4 @@ "description": "Merge objects & other types recursively. A simple & small integration.", | ||
"rollup": "rollup -c build/rollup.js", | ||
"build": "npm run lint && npm run test && npm run rollup" | ||
"build": "npm run lint && npm run test && npm run rollup", | ||
"release": "npm run build && np" | ||
}, | ||
@@ -49,17 +50,19 @@ "repository": { | ||
"dependencies": { | ||
"is-what": "^3.11.3", | ||
"ts-toolbelt": "^8.0.7" | ||
"is-what": "^3.14.1", | ||
"ts-toolbelt": "^9.3.12" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^4.6.1", | ||
"@typescript-eslint/parser": "^4.6.1", | ||
"ava": "^3.13.0", | ||
"eslint": "^7.12.1", | ||
"eslint-config-prettier": "^6.15.0", | ||
"@typescript-eslint/eslint-plugin": "^4.15.2", | ||
"@typescript-eslint/parser": "^4.15.2", | ||
"ava": "^3.15.0", | ||
"eslint": "^7.20.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-tree-shaking": "^1.8.0", | ||
"rollup": "^2.33.1", | ||
"rollup-plugin-typescript2": "^0.29.0", | ||
"np": "^7.4.0", | ||
"prettier": "^2.2.1", | ||
"rollup": "^2.39.1", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"ts-node": "^9.1.1", | ||
"tsconfig-paths": "^3.9.0", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.5" | ||
"typescript": "^4.2.2" | ||
}, | ||
@@ -74,3 +77,27 @@ "ava": { | ||
] | ||
}, | ||
"np": { | ||
"yarn": false, | ||
"branch": "production" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"tree-shaking" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/ban-ts-ignore": "off", | ||
"tree-shaking/no-side-effects-in-initialization": "error", | ||
"@typescript-eslint/ban-ts-comment": "off" | ||
} | ||
} | ||
} |
@@ -38,3 +38,5 @@ # Merge anything 🥡 | ||
Pass the base param first and then an unlimited amount of params to merge onto it. | ||
- Unlimited — Merge will merge an unlimited amount of plain objects you pass as the arguments | ||
- Nested — Nested objects are merged deeply (see example below) | ||
- No modification — Merge always returns a new object without modifying the original, but does keep object/array references for nested props (see [#A note on JavaScript object references](#a-note-on-javascript-object-references)) | ||
@@ -96,3 +98,3 @@ ```js | ||
However, it's **very important** you understand how to work around JavaScript object references. Please be sure to read [a note on JavaScript object references](#a-note-on-javascript-object-references) down below. | ||
However, it's **very important** you understand how to work around JavaScript object references. Please be sure to read [#a note on JavaScript object references](#a-note-on-javascript-object-references) down below. | ||
@@ -99,0 +101,0 @@ ## Concat arrays |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { isArray } from 'is-what' | ||
@@ -2,0 +3,0 @@ |
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"lib": ["ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020"], | ||
"strict": true, | ||
"isolatedModules": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"declaration": true, | ||
"declarationDir": "./types/", | ||
"strict": true, | ||
"lib": ["ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020"], | ||
"declarationDir": "./types/" | ||
}, | ||
@@ -9,0 +12,0 @@ "include": [ |
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
167447
223
13
20
784
+ Addedts-toolbelt@9.6.0(transitive)
- Removedts-toolbelt@8.4.0(transitive)
Updatedis-what@^3.14.1
Updatedts-toolbelt@^9.3.12