object-no-new-keys 4.0.6 → 4.0.7
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.
|
@@ -1,13 +1,13 @@
|
|
|
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 4.0.
|
|
4
|
+
* @version 4.0.7
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-no-new-keys/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var version$1 = "4.0.
|
|
10
|
+
var version$1 = "4.0.7";
|
|
11
11
|
|
|
12
12
|
const version = version$1;
|
|
13
13
|
function isObj(something) {
|
|
@@ -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 4.0.
|
|
4
|
+
* @version 4.0.7
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-no-new-keys/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).objectNoNewKeys={})}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&!Array.isArray(e)}e.noNewKeys=function(e,r,o){if(o&&!t(o))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] opts should be a plain object. It was given as ${JSON.stringify(o,null,4)} (type ${typeof o})`);const s={mode:2,...o};if("string"==typeof s.mode&&["1","2"].includes(s.mode))s.mode=+s.mode;else if(![1,2].includes(s.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] opts.mode should be "1" or "2" (string or number).');return function e(r,o,s,n){let a;if(t(r))t(o)?Object.keys(r).forEach((p=>{Object.prototype.hasOwnProperty.call(o,p)?(t(r[p])||Array.isArray(r[p]))&&(a={path:n.path.length>0?`${n.path}.${p}`:p,res:n.res},n.res=e(r[p],o[p],s,a).res):(a=n.path.length>0?`${n.path}.${p}`:p,n.res.push(a))})):n.res=n.res.concat(Object.keys(r).map((e=>n.path.length>0?`${n.path}.${e}`:e)));else if(Array.isArray(r))if(Array.isArray(o))for(let t=0,p=r.length;t<p;t++)a={path:`${n.path.length>0?n.path:""}[${t}]`,res:n.res},n.res=2===s.mode?e(r[t],o[0],s,a).res:e(r[t],o[t],s,a).res;else n.res=n.res.concat(r.map(((e,t)=>`${n.path.length>0?n.path:""}[${t}]`)));return n}(e,r,s,{path:"",res:[]}).res},e.version="4.0.
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).objectNoNewKeys={})}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&!Array.isArray(e)}e.noNewKeys=function(e,r,o){if(o&&!t(o))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] opts should be a plain object. It was given as ${JSON.stringify(o,null,4)} (type ${typeof o})`);const s={mode:2,...o};if("string"==typeof s.mode&&["1","2"].includes(s.mode))s.mode=+s.mode;else if(![1,2].includes(s.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] opts.mode should be "1" or "2" (string or number).');return function e(r,o,s,n){let a;if(t(r))t(o)?Object.keys(r).forEach((p=>{Object.prototype.hasOwnProperty.call(o,p)?(t(r[p])||Array.isArray(r[p]))&&(a={path:n.path.length>0?`${n.path}.${p}`:p,res:n.res},n.res=e(r[p],o[p],s,a).res):(a=n.path.length>0?`${n.path}.${p}`:p,n.res.push(a))})):n.res=n.res.concat(Object.keys(r).map((e=>n.path.length>0?`${n.path}.${e}`:e)));else if(Array.isArray(r))if(Array.isArray(o))for(let t=0,p=r.length;t<p;t++)a={path:`${n.path.length>0?n.path:""}[${t}]`,res:n.res},n.res=2===s.mode?e(r[t],o[0],s,a).res:e(r[t],o[t],s,a).res;else n.res=n.res.concat(r.map(((e,t)=>`${n.path.length>0?n.path:""}[${t}]`)));return n}(e,r,s,{path:"",res:[]}).res},e.version="4.0.7",Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "object-no-new-keys",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.7",
|
|
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",
|
|
@@ -101,23 +101,23 @@
|
|
|
101
101
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
102
102
|
"@rollup/plugin-strip": "^2.1.0",
|
|
103
103
|
"@rollup/plugin-typescript": "^8.3.0",
|
|
104
|
-
"@types/node": "^16.11.
|
|
104
|
+
"@types/node": "^16.11.10",
|
|
105
105
|
"@types/tap": "^15.0.5",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
107
|
-
"@typescript-eslint/parser": "^5.
|
|
108
|
-
"core-js": "^3.19.
|
|
106
|
+
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
|
107
|
+
"@typescript-eslint/parser": "^5.5.0",
|
|
108
|
+
"core-js": "^3.19.2",
|
|
109
109
|
"cross-env": "^7.0.3",
|
|
110
110
|
"eslint": "^8.3.0",
|
|
111
|
-
"lect": "^0.18.
|
|
112
|
-
"rollup": "^2.60.
|
|
111
|
+
"lect": "^0.18.7",
|
|
112
|
+
"rollup": "^2.60.1",
|
|
113
113
|
"rollup-plugin-ascii": "^0.0.3",
|
|
114
114
|
"rollup-plugin-banner": "^0.2.1",
|
|
115
115
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
116
116
|
"rollup-plugin-dts": "^4.0.1",
|
|
117
117
|
"rollup-plugin-terser": "^7.0.2",
|
|
118
|
-
"tap": "^15.1.
|
|
118
|
+
"tap": "^15.1.5",
|
|
119
119
|
"tslib": "^2.3.1",
|
|
120
|
-
"type-fest": "^2.
|
|
120
|
+
"type-fest": "^2.6.0",
|
|
121
121
|
"typescript": "^4.5.2"
|
|
122
122
|
},
|
|
123
123
|
"engines": {
|