object-set-all-values-to 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -2
- package/LICENSE +1 -1
- package/README.md +3 -21
- package/dist/object-set-all-values-to.esm.js +2 -2
- package/dist/object-set-all-values-to.umd.js +3 -3
- package/package.json +21 -23
- package/.eslintcache +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## 6.
|
|
6
|
+
## 6.2.0 (2026-08-19)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
11
|
+
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
7
12
|
|
|
8
13
|
### Features
|
|
9
14
|
|
|
10
|
-
-
|
|
15
|
+
- add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
|
|
16
|
+
- refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
|
|
17
|
+
|
|
18
|
+
### Performance Improvements
|
|
19
|
+
|
|
20
|
+
- clone nested replacement values only when needed ([c58c8a3](https://github.com/codsen/codsen/commit/c58c8a3c74007ffec4d7efc610e87030a0192c78))
|
|
21
|
+
|
|
22
|
+
### Reverts
|
|
23
|
+
|
|
24
|
+
- Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
|
|
25
|
+
- Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
|
|
11
26
|
|
|
12
27
|
## 6.0.16 (2024-03-30)
|
|
13
28
|
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2010-
|
|
3
|
+
Copyright © 2010-2026 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ npm i object-set-all-values-to
|
|
|
32
32
|
## Quick Take
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
import { strict as assert } from "assert";
|
|
35
|
+
import { strict as assert } from "node:assert";
|
|
36
36
|
|
|
37
37
|
import { setAllValuesTo } from "object-set-all-values-to";
|
|
38
38
|
|
|
@@ -50,27 +50,9 @@ assert.deepEqual(
|
|
|
50
50
|
d: false,
|
|
51
51
|
},
|
|
52
52
|
);
|
|
53
|
-
|
|
54
|
-
// you can change the default "false" to something else:
|
|
55
|
-
assert.deepEqual(
|
|
56
|
-
setAllValuesTo(
|
|
57
|
-
{
|
|
58
|
-
a: "a",
|
|
59
|
-
b: "b",
|
|
60
|
-
c: "c",
|
|
61
|
-
d: "d",
|
|
62
|
-
},
|
|
63
|
-
"x",
|
|
64
|
-
),
|
|
65
|
-
{
|
|
66
|
-
a: "x",
|
|
67
|
-
b: "x",
|
|
68
|
-
c: "x",
|
|
69
|
-
d: "x",
|
|
70
|
-
},
|
|
71
|
-
);
|
|
72
53
|
```
|
|
73
54
|
|
|
55
|
+
|
|
74
56
|
## Documentation
|
|
75
57
|
|
|
76
58
|
Please [visit codsen.com](https://codsen.com/os/object-set-all-values-to/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/object-set-all-values-to/CHANGELOG.md).
|
|
@@ -83,6 +65,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
83
65
|
|
|
84
66
|
MIT License
|
|
85
67
|
|
|
86
|
-
Copyright © 2010-
|
|
68
|
+
Copyright © 2010-2026 Roy Revelt and other contributors
|
|
87
69
|
|
|
88
70
|
<p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-set-all-values-to
|
|
3
3
|
* @fileoverview Recursively walk the input and set all found values in plain objects to something
|
|
4
|
-
* @version 6.
|
|
4
|
+
* @version 6.2.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-set-all-values-to/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import{deepClone as n,isPlainObject as r}from"codsen-utils";var c="6.2.0";var f=c;function b(a,i){let o,p=n(a);arguments.length<2?o=!1:r(i)||Array.isArray(i)?o=n(i):o=i;function l(e,s){if(Array.isArray(e))for(let t=0;t<e.length;t++)(r(e[t])||Array.isArray(e[t]))&&(e[t]=l(e[t],r(s)||Array.isArray(s)?n(s):s));else if(r(e))for(let t of Object.keys(e))Array.isArray(e[t])||r(e[t])?e[t]=l(e[t],r(s)||Array.isArray(s)?n(s):s):e[t]=s;return e}return l(p,o)}export{b as setAllValuesTo,f as version};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-set-all-values-to
|
|
3
3
|
* @fileoverview Recursively walk the input and set all found values in plain objects to something
|
|
4
|
-
* @version 6.
|
|
4
|
+
* @version 6.2.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-set-all-values-to/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var objectSetAllValuesTo=(()=>{var
|
|
10
|
+
"use strict";var objectSetAllValuesTo=(()=>{var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var j=(e,t,n)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var k=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of A(t))!w.call(e,i)&&i!==n&&d(e,i,{get:()=>t[i],enumerable:!(o=v(t,i))||o.enumerable});return e};var x=e=>C(d({},"__esModule",{value:!0}),e);var f=(e,t,n)=>j(e,typeof t!="symbol"?t+"":t,n);var M={};k(M,{setAllValuesTo:()=>$,version:()=>D});var B=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var O=class{constructor(){f(this,"hasRepeatedReferences",!1);f(this,"clones",[]);f(this,"index");f(this,"sources",[])}get(e){if(this.index){let n=this.index.get(e);return n!==void 0&&(this.hasRepeatedReferences=!0),n}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let n=0;n<this.sources.length;n++)this.index.set(this.sources[n],this.clones[n]);this.sources=[],this.clones=[]}}};function b(e,t){let n=t.get(e);if(n!==void 0)return n;let o=e.slice(0);return t.set(e,o),o}function S(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let r=Buffer.from(e);return t.set(e,r),r}let n=b(e.buffer,t);if(e instanceof DataView){let r=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,r),r}let o=e.constructor,i=new o(n,e.byteOffset,e.length);return t.set(e,i),i}function y(e,t,n,o){for(let i of n){let r=t[i];e[i]=typeof r!="object"||r===null?r:a(r,o)}}function a(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let r=e.length,s=new Array(r);t.set(e,s);let l=e,g=Object.keys(e);if(g.length===r&&(r===0||g[r-1]==="".concat(r-1)))for(let p=0;p<r;p++){let h=l[p];s[p]=typeof h!="object"||h===null?h:a(h,t)}else y(s,l,g,t);return s}let o=Object.getPrototypeOf(e);if(o===Object.prototype||o===null){let r={};return t.set(e,r),y(r,e,Object.keys(e),t),r}if(e instanceof Date){let r=new Date(e.getTime());return t.set(e,r),r}if(ArrayBuffer.isView(e))return S(e,t);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return b(e,t);if(e instanceof Map){let r=new Map;t.set(e,r);for(let[s,l]of e)r.set(a(s,t),a(l,t));return r}if(e instanceof Set){let r=new Set;t.set(e,r);for(let s of e)r.add(a(s,t));return r}let i={};return t.set(e,i),y(i,e,Object.keys(e),t),i}function c(e){return a(e,new O)}function u(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}var m="6.2.0";var D=m;function $(e,t){let n,o=c(e);arguments.length<2?n=!1:u(t)||Array.isArray(t)?n=c(t):n=t;function i(r,s){if(Array.isArray(r))for(let l=0;l<r.length;l++)(u(r[l])||Array.isArray(r[l]))&&(r[l]=i(r[l],u(s)||Array.isArray(s)?c(s):s));else if(u(r))for(let l of Object.keys(r))Array.isArray(r[l])||u(r[l])?r[l]=i(r[l],u(s)||Array.isArray(s)?c(s):s):r[l]=s;return r}return i(o,n)}return x(M);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.8.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "object-set-all-values-to",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Recursively walk the input and set all found values in plain objects to something",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"all",
|
|
@@ -35,44 +35,42 @@
|
|
|
35
35
|
},
|
|
36
36
|
"types": "types/index.d.ts",
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "node
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
38
|
+
"build": "node ../../ops/scripts/esbuild.js && npm run dts",
|
|
39
|
+
"coverage": "c8 uvu test",
|
|
40
|
+
"dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
|
|
42
41
|
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
43
|
-
"dts": "rollup -c &&
|
|
42
|
+
"dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
|
|
44
43
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
45
|
-
"lect": "node '../../ops/lect/lect.js'
|
|
46
|
-
"
|
|
47
|
-
"lint": "
|
|
44
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
45
|
+
"lect:check": "node '../../ops/lect/lect.js' --check",
|
|
46
|
+
"lint": "biome lint --error-on-warnings . && npm run typecheck",
|
|
47
|
+
"lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
|
|
48
48
|
"perf": "node perf/check.js",
|
|
49
49
|
"prep": "echo 'ready'",
|
|
50
|
-
"prettier": "
|
|
51
|
-
"prettier:format": "
|
|
52
|
-
"pretest": "npm run lect && npm run build",
|
|
50
|
+
"prettier": "biome format",
|
|
51
|
+
"prettier:format": "biome format --write .",
|
|
52
|
+
"pretest": "npm run lect:check && npm run build",
|
|
53
53
|
"test": "npm run devtest",
|
|
54
|
+
"typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
|
|
54
55
|
"unit": "uvu test"
|
|
55
56
|
},
|
|
56
|
-
"engines": {
|
|
57
|
-
"node": ">=14.18.0"
|
|
58
|
-
},
|
|
59
57
|
"c8": {
|
|
58
|
+
"all": true,
|
|
60
59
|
"check-coverage": true,
|
|
61
|
-
"exclude": [
|
|
62
|
-
|
|
63
|
-
],
|
|
60
|
+
"exclude": ["**/test/**/*.*"],
|
|
61
|
+
"include": ["dist/*.esm.js"],
|
|
64
62
|
"lines": 100
|
|
65
63
|
},
|
|
66
64
|
"lect": {
|
|
67
65
|
"licence": {
|
|
68
|
-
"extras": [
|
|
69
|
-
""
|
|
70
|
-
]
|
|
66
|
+
"extras": [""]
|
|
71
67
|
}
|
|
72
68
|
},
|
|
73
69
|
"dependencies": {
|
|
74
|
-
"codsen-utils": "^1.
|
|
75
|
-
|
|
70
|
+
"codsen-utils": "^1.8.0"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=18.20.8"
|
|
76
74
|
},
|
|
77
75
|
"publishConfig": {
|
|
78
76
|
"registry": "https://registry.npmjs.org/"
|
package/.eslintcache
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"/home/runner/work/codsen/codsen/packages/object-set-all-values-to/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/object-set-all-values-to/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/object-set-all-values-to/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/object-set-all-values-to/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/object-set-all-values-to/test/test.js":"5"},{"size":530,"mtime":1760566739125,"results":"6","hashOfConfig":"7"},{"size":417,"mtime":1760566739125,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760566739125,"results":"10","hashOfConfig":"7"},{"size":1075,"mtime":1760566739125,"results":"11","hashOfConfig":"9"},{"size":10232,"mtime":1760566739125,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"nrihsz","/home/runner/work/codsen/codsen/packages/object-set-all-values-to/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/object-set-all-values-to/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/object-set-all-values-to/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/object-set-all-values-to/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/object-set-all-values-to/test/test.js",[],["29","30","31","32","33"],{"ruleId":"34","severity":2,"message":"35","line":3,"column":17,"nodeType":null,"messageId":"36","endLine":3,"endColumn":19,"suppressions":"37"},{"ruleId":"34","severity":2,"message":"38","line":3,"column":25,"nodeType":null,"messageId":"36","endLine":3,"endColumn":31,"suppressions":"39"},{"ruleId":"34","severity":2,"message":"40","line":3,"column":33,"nodeType":null,"messageId":"36","endLine":3,"endColumn":37,"suppressions":"41"},{"ruleId":"34","severity":2,"message":"42","line":3,"column":39,"nodeType":null,"messageId":"36","endLine":3,"endColumn":42,"suppressions":"43"},{"ruleId":"34","severity":2,"message":"44","line":3,"column":44,"nodeType":null,"messageId":"36","endLine":3,"endColumn":49,"suppressions":"45"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["46"],"'throws' is defined but never used.",["47"],"'type' is defined but never used.",["48"],"'not' is defined but never used.",["49"],"'match' is defined but never used.",["50"],{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},"directive",""]
|