defaults
Advanced tools
Comparing version 2.0.2 to 3.0.0
@@ -50,3 +50,3 @@ // From: https://github.com/sindresorhus/is-plain-obj | ||
export default function defaults(options = {}, defaultOptions = {}) { | ||
return merge({...defaultOptions}, {...options}); | ||
return merge(structuredClone(defaultOptions), structuredClone(options)); | ||
} |
{ | ||
"name": "defaults", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "Easily handle defaults for your options", | ||
@@ -14,3 +14,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=16" | ||
"node": ">=18" | ||
}, | ||
@@ -35,6 +35,6 @@ "scripts": { | ||
"devDependencies": { | ||
"ava": "^5.2.0", | ||
"tsd": "^0.28.1", | ||
"xo": "^0.54.0" | ||
"ava": "^5.3.1", | ||
"tsd": "^0.29.0", | ||
"xo": "^0.56.0" | ||
} | ||
} |
@@ -39,4 +39,6 @@ # defaults | ||
Deeply merges the given options with the specified defaults. | ||
Deeply merges the given options with the specified defaults and returns a new object. | ||
The given parameters are deep-cloned and never mutated. | ||
#### options | ||
@@ -43,0 +45,0 @@ |
5654
64