object-set-all-values-to 6.1.3 → 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 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.1.0 (2025-10-15)
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
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
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-2025 Roy Revelt and other contributors
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-2025 Roy Revelt and other contributors
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.1.3
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 u from"rfdc";import{isPlainObject as o}from"codsen-utils";var i="6.1.3";var l=u(),j=i;function p(c,r){let t,e=l(c);return arguments.length<2?t=!1:o(r)||Array.isArray(r)?t=l(r):t=r,Array.isArray(e)?e.forEach((s,n)=>{(o(e[n])||Array.isArray(e[n]))&&(e[n]=p(e[n],t))}):o(e)&&Object.keys(e).forEach(s=>{Array.isArray(e[s])||o(e[s])?e[s]=p(e[s],t):e[s]=t}),e}export{p as setAllValuesTo,j as version};
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.1.3
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 B=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var R=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),L=(t,n)=>{for(var o in n)g(t,o,{get:n[o],enumerable:!0})},w=(t,n,o,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of E(n))!M.call(t,c)&&c!==o&&g(t,c,{get:()=>n[c],enumerable:!(u=D(n,c))||u.enumerable});return t};var O=(t,n,o)=>(o=t!=null?B($(t)):{},w(n||!t||!t.__esModule?g(o,"default",{value:t,enumerable:!0}):o,t)),P=t=>w(g({},"__esModule",{value:!0}),t);var h=R((Q,v)=>{"use strict";v.exports=F;function b(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function F(t){if(t=t||{},t.circles)return N(t);let n=new Map;if(n.set(Date,s=>new Date(s)),n.set(Map,(s,a)=>new Map(u(Array.from(s),a))),n.set(Set,(s,a)=>new Set(u(Array.from(s),a))),t.constructorHandlers)for(let s of t.constructorHandlers)n.set(s[0],s[1]);let o=null;return t.proto?p:c;function u(s,a){let e=Object.keys(s),r=new Array(e.length);for(let l=0;l<e.length;l++){let i=e[l],f=s[i];typeof f!="object"||f===null?r[i]=f:f.constructor!==Object&&(o=n.get(f.constructor))?r[i]=o(f,a):ArrayBuffer.isView(f)?r[i]=b(f):r[i]=a(f)}return r}function c(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return u(s,c);if(s.constructor!==Object&&(o=n.get(s.constructor)))return o(s,c);let a={};for(let e in s){if(Object.hasOwnProperty.call(s,e)===!1)continue;let r=s[e];typeof r!="object"||r===null?a[e]=r:r.constructor!==Object&&(o=n.get(r.constructor))?a[e]=o(r,c):ArrayBuffer.isView(r)?a[e]=b(r):a[e]=c(r)}return a}function p(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return u(s,p);if(s.constructor!==Object&&(o=n.get(s.constructor)))return o(s,p);let a={};for(let e in s){let r=s[e];typeof r!="object"||r===null?a[e]=r:r.constructor!==Object&&(o=n.get(r.constructor))?a[e]=o(r,p):ArrayBuffer.isView(r)?a[e]=b(r):a[e]=p(r)}return a}}function N(t){let n=[],o=[],u=new Map;if(u.set(Date,e=>new Date(e)),u.set(Map,(e,r)=>new Map(p(Array.from(e),r))),u.set(Set,(e,r)=>new Set(p(Array.from(e),r))),t.constructorHandlers)for(let e of t.constructorHandlers)u.set(e[0],e[1]);let c=null;return t.proto?a:s;function p(e,r){let l=Object.keys(e),i=new Array(l.length);for(let f=0;f<l.length;f++){let y=l[f],d=e[y];if(typeof d!="object"||d===null)i[y]=d;else if(d.constructor!==Object&&(c=u.get(d.constructor)))i[y]=c(d,r);else if(ArrayBuffer.isView(d))i[y]=b(d);else{let j=n.indexOf(d);j!==-1?i[y]=o[j]:i[y]=r(d)}}return i}function s(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,s);if(e.constructor!==Object&&(c=u.get(e.constructor)))return c(e,s);let r={};n.push(e),o.push(r);for(let l in e){if(Object.hasOwnProperty.call(e,l)===!1)continue;let i=e[l];if(typeof i!="object"||i===null)r[l]=i;else if(i.constructor!==Object&&(c=u.get(i.constructor)))r[l]=c(i,s);else if(ArrayBuffer.isView(i))r[l]=b(i);else{let f=n.indexOf(i);f!==-1?r[l]=o[f]:r[l]=s(i)}}return n.pop(),o.pop(),r}function a(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,a);if(e.constructor!==Object&&(c=u.get(e.constructor)))return c(e,a);let r={};n.push(e),o.push(r);for(let l in e){let i=e[l];if(typeof i!="object"||i===null)r[l]=i;else if(i.constructor!==Object&&(c=u.get(i.constructor)))r[l]=c(i,a);else if(ArrayBuffer.isView(i))r[l]=b(i);else{let f=n.indexOf(i);f!==-1?r[l]=o[f]:r[l]=a(i)}}return n.pop(),o.pop(),r}}});var V={};L(V,{setAllValuesTo:()=>A,version:()=>H});var k=O(h(),1);var x=O(h(),1);var U=(0,x.default)();function m(t){if(t==null||typeof t!="object")return!1;let n=Object.getPrototypeOf(t);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}var C="6.1.3";var S=(0,k.default)(),H=C;function A(t,n){let o,u=S(t);return arguments.length<2?o=!1:m(n)||Array.isArray(n)?o=S(n):o=n,Array.isArray(u)?u.forEach((c,p)=>{(m(u[p])||Array.isArray(u[p]))&&(u[p]=A(u[p],o))}):m(u)&&Object.keys(u).forEach(c=>{Array.isArray(u[c])||m(u[c])?u[c]=A(u[c],o):u[c]=o}),u}return P(V);})();
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.7.3
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.1.3",
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 '../../ops/scripts/esbuild.js' && npm run dts",
39
- "cjs-off": "exit 0",
40
- "cjs-on": "exit 0",
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 && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
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' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
46
- "letspublish": "npm publish --provenance || :",
47
- "lint": "eslint . --fix --concurrency=auto --cache",
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": "prettier",
51
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
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
- "**/test/**/*.*"
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.7.3",
75
- "rfdc": "^1.4.1"
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/"