object-no-new-keys 5.2.0 → 5.3.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 +15 -2
- package/LICENSE +1 -1
- package/README.md +4 -3
- package/dist/object-no-new-keys.esm.js +2 -2
- package/dist/object-no-new-keys.umd.js +3 -3
- package/package.json +21 -22
- package/.eslintcache +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,24 @@
|
|
|
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
|
-
## 5.
|
|
6
|
+
## 5.3.0 (2026-08-19)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
|
|
11
|
+
- reorder and standardise validation errors ([5301797](https://github.com/codsen/codsen/commit/5301797af616daf1b632ea5619c898628104d78b))
|
|
12
|
+
- resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
13
|
+
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
7
14
|
|
|
8
15
|
### Features
|
|
9
16
|
|
|
10
|
-
-
|
|
17
|
+
- add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
|
|
18
|
+
- refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
|
|
19
|
+
|
|
20
|
+
### Reverts
|
|
21
|
+
|
|
22
|
+
- 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)
|
|
23
|
+
- 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
24
|
|
|
12
25
|
## 5.1.0 (2023-05-13)
|
|
13
26
|
|
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-no-new-keys
|
|
|
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 { noNewKeys } from "object-no-new-keys";
|
|
38
38
|
|
|
@@ -55,9 +55,10 @@ assert.deepEqual(
|
|
|
55
55
|
);
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
|
|
58
59
|
## Documentation
|
|
59
60
|
|
|
60
|
-
Please [visit codsen.com](https://codsen.com/os/object-no-new-keys/) for a full description of the API.
|
|
61
|
+
Please [visit codsen.com](https://codsen.com/os/object-no-new-keys/) 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-no-new-keys/CHANGELOG.md).
|
|
61
62
|
|
|
62
63
|
## Contributing
|
|
63
64
|
|
|
@@ -67,6 +68,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
67
68
|
|
|
68
69
|
MIT License
|
|
69
70
|
|
|
70
|
-
Copyright © 2010-
|
|
71
|
+
Copyright © 2010-2026 Roy Revelt and other contributors
|
|
71
72
|
|
|
72
73
|
<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-no-new-keys
|
|
3
3
|
* @fileoverview Check, does a plain object (AST/JSON) has any unique keys, not present in a reference object (another AST/JSON)
|
|
4
|
-
* @version 5.
|
|
4
|
+
* @version 5.3.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-no-new-keys/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{
|
|
10
|
+
import{formatDiagnosticValue as y,hasOwnProp as f,isPlainObject as a}from"codsen-utils";var m="5.3.0";var O=m,b={mode:2};function k(h,d,r){if(r&&!a(r))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_01] resolvedOpts should be a plain object. It was given as ${y(r,4)} (type ${typeof r})`);let c={...b,...r};if(typeof c.mode=="string"&&["1","2"].includes(c.mode))c.mode=+c.mode;else if(![1,2].includes(c.mode))throw new TypeError('object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts.mode should be "1" or "2" (string or number).');function i(s,n,p,e){let o;if(a(s))a(n)?Object.keys(s).forEach(t=>{f(n,t)?(a(s[t])||Array.isArray(s[t]))&&(o={path:e.path.length?`${e.path}.${t}`:t,res:e.res},e.res=i(s[t],n[t],p,o).res):(o=e.path.length?`${e.path}.${t}`:t,e.res.push(o))}):e.res=e.res.concat(Object.keys(s).map(t=>e.path.length?`${e.path}.${t}`:t));else if(Array.isArray(s))if(Array.isArray(n))for(let t=0,l=s.length;t<l;t++)o={path:`${e.path.length?e.path:""}[${t}]`,res:e.res},p.mode===2?e.res=i(s[t],n[0],p,o).res:e.res=i(s[t],n[t],p,o).res;else e.res=e.res.concat(s.map((t,l)=>`${e.path.length?e.path:""}[${l}]`));return e}return i(h,d,c,{path:"",res:[]}).res}export{b as defaults,k as noNewKeys,O as version};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-no-new-keys
|
|
3
3
|
* @fileoverview Check, does a plain object (AST/JSON) has any unique keys, not present in a reference object (another AST/JSON)
|
|
4
|
-
* @version 5.
|
|
4
|
+
* @version 5.3.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-no-new-keys/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var objectNoNewKeys=(()=>{var
|
|
10
|
+
"use strict";var objectNoNewKeys=(()=>{var A=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames,C=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var S=(t,r,e)=>r in t?A(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,O=(t,r)=>{for(var e in r||(r={}))k.call(r,e)&&S(t,e,r[e]);if(C)for(var e of C(r))P.call(r,e)&&S(t,e,r[e]);return t};var T=(t,r)=>{for(var e in r)A(t,e,{get:r[e],enumerable:!0})},I=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of L(r))!k.call(t,a)&&a!==e&&A(t,a,{get:()=>r[a],enumerable:!(i=R(r,a))||i.enumerable});return t};var E=t=>I(A({},"__esModule",{value:!0}),t);var z={};T(z,{defaults:()=>N,noNewKeys:()=>q,version:()=>Q});function U(){let t=[],r=0,e=!1;return{append(i){return e?!1:r+i.length>1999?(t.push("\u2026"),r+=1,e=!0,!1):(t.push(i),r+=i.length,!0)},result(){return t.join("")},stopped(){return e}}}function F(t){return"\\u".concat(t.toString(16).padStart(4,"0"))}function v(t,r){if(t.append('"')){for(let e=0;e<r.length&&!t.stopped();e+=1){let i=r.charCodeAt(e);i===34?t.append('\\"'):i===92?t.append("\\\\"):i===8?t.append("\\b"):i===9?t.append("\\t"):i===10?t.append("\\n"):i===12?t.append("\\f"):i===13?t.append("\\r"):i<32||i===8232||i===8233||i>=55296&&i<=57343?t.append(F(i)):t.append(r[e])}t.append('"')}}function _(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function $(t,r){t.append("Symbol(");let e=String(r);e.length>8&&v(t,e.slice(7,-1)),t.append(")")}function x(t,r){typeof r=="symbol"?$(t,r):v(t,String(r))}function D(t,r=0){let e=U(),i=r===4?4:0,a=new WeakSet,u=0;function d(n){i&&e.append(" ".repeat(n*i))}function g(n,o){n&&e.append(","),i&&(e.append("\n"),d(o+1))}function s(n,o,f){i&&o&&(e.append("\n"),d(f)),e.append(n)}function p(n,o){Object.prototype.hasOwnProperty.call(n,"value")?j(n.value,o):e.append(_(n))}function l(n,o){let f;try{f=Reflect.getOwnPropertyDescriptor(n,"length")}catch(h){e.append("[Uninspectable]");return}let c=f==null?void 0:f.value;if(!Number.isSafeInteger(c)||c<0){e.append("[Uninspectable]");return}e.append("[");let m=!1;for(let h=0;h<c&&!e.stopped();h+=1){if(g(m,o),m=!0,u>=50){e.append("[MaxEntries]");break}u+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(n,String(h))}catch(G){e.append("[Uninspectable]");continue}y!=null&&y.enumerable?p(y,o+1):e.append("[Empty]")}s("]",m,o)}function w(n,o){let f;try{f=Reflect.ownKeys(n)}catch(m){e.append("[Uninspectable]");return}e.append("{");let c=!1;for(let m of f){if(e.stopped())break;if(u>=50){g(c,o),c=!0,v(e,"\u2026"),e.append(i?": ":":"),e.append("[MaxEntries]");break}u+=1;let h;try{h=Reflect.getOwnPropertyDescriptor(n,m)}catch(y){g(c,o),c=!0,x(e,m),e.append(i?": ":":"),e.append("[Uninspectable]");continue}h!=null&&h.enumerable&&(g(c,o),c=!0,x(e,m),e.append(i?": ":":"),p(h,o+1))}s("}",c,o)}function B(n,o){if(a.has(n)){e.append("[Circular]");return}if(o>=5){e.append("[MaxDepth]");return}let f;try{f=Array.isArray(n)}catch(c){e.append("[Uninspectable]");return}a.add(n);try{f?l(n,o):w(n,o)}finally{a.delete(n)}}function j(n,o){n===null?e.append("null"):typeof n=="string"?v(e,n):typeof n=="number"?e.append(Object.is(n,-0)?"-0":String(n)):typeof n=="boolean"?e.append(n?"true":"false"):typeof n>"u"?e.append("undefined"):typeof n=="bigint"?e.append("".concat(n,"n")):typeof n=="symbol"?$(e,n):typeof n=="function"?e.append("[Function]"):B(n,o)}try{return j(t,0),e.result()}catch(n){return"[Uninspectable]"}}var X=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"]),H=Object.prototype.hasOwnProperty;function b(t){if(t==null||typeof t!="object")return!1;let r=Object.getPrototypeOf(t);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}function K(t){return typeof t=="string"}function W(t,r){return b(t)&&K(r)&&H.call(t,r)}var M="5.3.0";var Q=M,N={mode:2};function q(t,r,e){if(e&&!b(e))throw new TypeError("object-no-new-keys/noNewKeys(): [THROW_ID_01] resolvedOpts should be a plain object. It was given as ".concat(D(e,4)," (type ").concat(typeof e,")"));let i=O(O({},N),e);if(typeof i.mode=="string"&&["1","2"].includes(i.mode))i.mode=+i.mode;else if(![1,2].includes(i.mode))throw new TypeError('object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts.mode should be "1" or "2" (string or number).');function a(u,d,g,s){let p;if(b(u))b(d)?Object.keys(u).forEach(l=>{W(d,l)?(b(u[l])||Array.isArray(u[l]))&&(p={path:s.path.length?"".concat(s.path,".").concat(l):l,res:s.res},s.res=a(u[l],d[l],g,p).res):(p=s.path.length?"".concat(s.path,".").concat(l):l,s.res.push(p))}):s.res=s.res.concat(Object.keys(u).map(l=>s.path.length?"".concat(s.path,".").concat(l):l));else if(Array.isArray(u))if(Array.isArray(d))for(let l=0,w=u.length;l<w;l++)p={path:"".concat(s.path.length?s.path:"","[").concat(l,"]"),res:s.res},g.mode===2?s.res=a(u[l],d[0],g,p).res:s.res=a(u[l],d[l],g,p).res;else s.res=s.res.concat(u.map((l,w)=>"".concat(s.path.length?s.path:"","[").concat(w,"]")));return s}return a(t,r,i,{path:"",res:[]}).res}return E(z);})();
|
|
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-no-new-keys",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Check, does a plain object (AST/JSON) has any unique keys, not present in a reference object (another AST/JSON)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compare",
|
|
@@ -36,43 +36,42 @@
|
|
|
36
36
|
},
|
|
37
37
|
"types": "types/index.d.ts",
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "node
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
39
|
+
"build": "node ../../ops/scripts/esbuild.js && npm run dts",
|
|
40
|
+
"coverage": "c8 uvu test",
|
|
41
|
+
"dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
|
|
43
42
|
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
44
|
-
"dts": "rollup -c &&
|
|
43
|
+
"dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
|
|
45
44
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
46
|
-
"lect": "node '../../ops/lect/lect.js'
|
|
47
|
-
"
|
|
48
|
-
"lint": "
|
|
45
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
46
|
+
"lect:check": "node '../../ops/lect/lect.js' --check",
|
|
47
|
+
"lint": "biome lint --error-on-warnings . && npm run typecheck",
|
|
48
|
+
"lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
|
|
49
49
|
"perf": "node perf/check.js",
|
|
50
50
|
"prep": "echo 'ready'",
|
|
51
|
-
"prettier": "
|
|
52
|
-
"prettier:format": "
|
|
53
|
-
"pretest": "npm run lect && npm run build",
|
|
51
|
+
"prettier": "biome format",
|
|
52
|
+
"prettier:format": "biome format --write .",
|
|
53
|
+
"pretest": "npm run lect:check && npm run build",
|
|
54
54
|
"test": "npm run devtest",
|
|
55
|
+
"typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
|
|
55
56
|
"unit": "uvu test"
|
|
56
57
|
},
|
|
57
|
-
"engines": {
|
|
58
|
-
"node": ">=14.18.0"
|
|
59
|
-
},
|
|
60
58
|
"c8": {
|
|
59
|
+
"all": true,
|
|
61
60
|
"check-coverage": true,
|
|
62
|
-
"exclude": [
|
|
63
|
-
|
|
64
|
-
],
|
|
61
|
+
"exclude": ["**/test/**/*.*"],
|
|
62
|
+
"include": ["dist/*.esm.js"],
|
|
65
63
|
"lines": 100
|
|
66
64
|
},
|
|
67
65
|
"lect": {
|
|
68
66
|
"licence": {
|
|
69
|
-
"extras": [
|
|
70
|
-
""
|
|
71
|
-
]
|
|
67
|
+
"extras": [""]
|
|
72
68
|
}
|
|
73
69
|
},
|
|
74
70
|
"dependencies": {
|
|
75
|
-
"codsen-utils": "^1.
|
|
71
|
+
"codsen-utils": "^1.8.0"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=18.20.8"
|
|
76
75
|
},
|
|
77
76
|
"publishConfig": {
|
|
78
77
|
"registry": "https://registry.npmjs.org/"
|
package/.eslintcache
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"/home/runner/work/codsen/codsen/packages/object-no-new-keys/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/object-no-new-keys/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/object-no-new-keys/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/object-no-new-keys/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/object-no-new-keys/test/test.js":"5"},{"size":306,"mtime":1760566739124,"results":"6","hashOfConfig":"7"},{"size":570,"mtime":1760566739124,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760566739124,"results":"10","hashOfConfig":"7"},{"size":3765,"mtime":1760566739124,"results":"11","hashOfConfig":"9"},{"size":6445,"mtime":1760566739124,"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-no-new-keys/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/object-no-new-keys/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/object-no-new-keys/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/object-no-new-keys/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/object-no-new-keys/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":21,"nodeType":null,"messageId":"36","endLine":3,"endColumn":23,"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"],"'ok' 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",""]
|