@homer0/deep-assign
Advanced tools
Comparing version 1.0.3 to 2.0.0
@@ -0,8 +1,12 @@ | ||
var __defProp = Object.defineProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
// src/deepAssign.ts | ||
var DeepAssign = class { | ||
static fn(options = {}) { | ||
return new DeepAssign(options).assign; | ||
} | ||
options; | ||
constructor(options = {}) { | ||
__publicField(this, "options"); | ||
if (options.arrayMode && !["merge", "concat", "overwrite", "shallowMerge"].includes(options.arrayMode)) { | ||
@@ -17,2 +21,5 @@ throw new Error(`Invalid array mode received: \`${options.arrayMode}\``); | ||
} | ||
static fn(options = {}) { | ||
return new DeepAssign(options).assign; | ||
} | ||
assign(...targets) { | ||
@@ -19,0 +26,0 @@ if (!targets.length) { |
@@ -6,2 +6,3 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __export = (target, all) => { | ||
@@ -20,2 +21,6 @@ for (var name in all) | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
@@ -34,7 +39,4 @@ // src/index.ts | ||
var DeepAssign = class { | ||
static fn(options = {}) { | ||
return new DeepAssign(options).assign; | ||
} | ||
options; | ||
constructor(options = {}) { | ||
__publicField(this, "options"); | ||
if (options.arrayMode && !["merge", "concat", "overwrite", "shallowMerge"].includes(options.arrayMode)) { | ||
@@ -49,2 +51,5 @@ throw new Error(`Invalid array mode received: \`${options.arrayMode}\``); | ||
} | ||
static fn(options = {}) { | ||
return new DeepAssign(options).assign; | ||
} | ||
assign(...targets) { | ||
@@ -51,0 +56,0 @@ if (!targets.length) { |
{ | ||
"name": "@homer0/deep-assign", | ||
"description": "Deep merge (and copy) of objects and Arrays using native spread syntax", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"repository": { | ||
@@ -26,10 +26,10 @@ "type": "git", | ||
"devDependencies": { | ||
"jest": "^29.2.1", | ||
"jest": "^29.3.1", | ||
"ts-jest": "^29.0.3", | ||
"tsup": "^6.3.0", | ||
"typescript": "^4.8.4" | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.9.4" | ||
}, | ||
"engine-strict": true, | ||
"engines": { | ||
"node": ">=14" | ||
"node": ">=16" | ||
}, | ||
@@ -46,3 +46,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "e584e4ef93ede1065a91a1d3e88e070662acb66e" | ||
"gitHead": "86d8723fd11c969e334d58c4e6bc4d290311fe26" | ||
} |
@@ -191,5 +191,5 @@ # 🧬 Deep assign | ||
As this project is part of the `packages` monorepo, it requires Yarn, and some of the tooling, like ESLint and Husky, are installed on the root's `package.json`. | ||
As this project is part of the `packages` monorepo, some of the tooling, like ESLint and Husky, are installed on the root's `package.json`. | ||
#### Yarn tasks | ||
#### NPM tasks | ||
@@ -196,0 +196,0 @@ | Task | Description | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
41347
290