object-no-new-keys 5.1.2 → 5.1.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2023 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2024 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
@@ -67,6 +67,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
67
67
 
68
68
  MIT License.
69
69
 
70
- Copyright © 2010-2023 Roy Revelt and other contributors.
70
+ Copyright © 2010-2024 Roy Revelt and other contributors.
71
71
 
72
72
  <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.1.2
4
+ * @version 5.1.4
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
- import{hasOwnProp as y,isPlainObject as l}from"codsen-utils";var m="5.1.2";var O=m,b={mode:2};function x(u,d,p){if(p&&!l(p))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(p,null,4)} (type ${typeof p})`);let n={...b,...p};if(typeof n.mode=="string"&&["1","2"].includes(n.mode))n.mode=+n.mode;else if(![1,2].includes(n.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] resolvedOpts.mode should be "1" or "2" (string or number).');function c(s,r,i,e){let o;if(l(s))l(r)?Object.keys(s).forEach(t=>{y(r,t)?(l(s[t])||Array.isArray(s[t]))&&(o={path:e.path.length?`${e.path}.${t}`:t,res:e.res},e.res=c(s[t],r[t],i,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(r))for(let t=0,a=s.length;t<a;t++)o={path:`${e.path.length?e.path:""}[${t}]`,res:e.res},i.mode===2?e.res=c(s[t],r[0],i,o).res:e.res=c(s[t],r[t],i,o).res;else e.res=e.res.concat(s.map((t,a)=>`${e.path.length?e.path:""}[${a}]`));return e}return c(u,d,n,{path:"",res:[]}).res}export{b as defaults,x as noNewKeys,O as version};
10
+ import{hasOwnProp as y,isPlainObject as l}from"codsen-utils";var m="5.1.4";var O=m,b={mode:2};function x(u,d,p){if(p&&!l(p))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(p,null,4)} (type ${typeof p})`);let n={...b,...p};if(typeof n.mode=="string"&&["1","2"].includes(n.mode))n.mode=+n.mode;else if(![1,2].includes(n.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] resolvedOpts.mode should be "1" or "2" (string or number).');function c(s,r,i,e){let o;if(l(s))l(r)?Object.keys(s).forEach(t=>{y(r,t)?(l(s[t])||Array.isArray(s[t]))&&(o={path:e.path.length?`${e.path}.${t}`:t,res:e.res},e.res=c(s[t],r[t],i,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(r))for(let t=0,a=s.length;t<a;t++)o={path:`${e.path.length?e.path:""}[${t}]`,res:e.res},i.mode===2?e.res=c(s[t],r[0],i,o).res:e.res=c(s[t],r[t],i,o).res;else e.res=e.res.concat(s.map((t,a)=>`${e.path.length?e.path:""}[${a}]`));return e}return c(u,d,n,{path:"",res:[]}).res}export{b as defaults,x 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.1.2
4
+ * @version 5.1.4
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
- "use strict";var objectNoNewKeys=(()=>{var $=Object.create;var h=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames,w=Object.getOwnPropertySymbols,N=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var A=(n,r,o)=>r in n?h(n,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[r]=o,b=(n,r)=>{for(var o in r||(r={}))g.call(r,o)&&A(n,o,r[o]);if(w)for(var o of w(r))E.call(r,o)&&A(n,o,r[o]);return n};var T=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports),P=(n,r)=>{for(var o in r)h(n,o,{get:r[o],enumerable:!0})},j=(n,r,o,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of M(r))!g.call(n,s)&&s!==o&&h(n,s,{get:()=>r[s],enumerable:!(u=B(r,s))||u.enumerable});return n};var L=(n,r,o)=>(o=n!=null?$(N(n)):{},j(r||!n||!n.__esModule?h(o,"default",{value:n,enumerable:!0}):o,n)),F=n=>j(h({},"__esModule",{value:!0}),n);var v=T((H,S)=>{"use strict";S.exports=J;function y(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function J(n){if(n=n||{},n.circles)return R(n);return n.proto?u:o;function r(s,l){for(var e=Object.keys(s),t=new Array(e.length),i=0;i<e.length;i++){var a=e[i],f=s[a];typeof f!="object"||f===null?t[a]=f:f instanceof Date?t[a]=new Date(f):ArrayBuffer.isView(f)?t[a]=y(f):t[a]=l(f)}return t}function o(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return r(s,o);if(s instanceof Map)return new Map(r(Array.from(s),o));if(s instanceof Set)return new Set(r(Array.from(s),o));var l={};for(var e in s)if(Object.hasOwnProperty.call(s,e)!==!1){var t=s[e];typeof t!="object"||t===null?l[e]=t:t instanceof Date?l[e]=new Date(t):t instanceof Map?l[e]=new Map(r(Array.from(t),o)):t instanceof Set?l[e]=new Set(r(Array.from(t),o)):ArrayBuffer.isView(t)?l[e]=y(t):l[e]=o(t)}return l}function u(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return r(s,u);if(s instanceof Map)return new Map(r(Array.from(s),u));if(s instanceof Set)return new Set(r(Array.from(s),u));var l={};for(var e in s){var t=s[e];typeof t!="object"||t===null?l[e]=t:t instanceof Date?l[e]=new Date(t):t instanceof Map?l[e]=new Map(r(Array.from(t),u)):t instanceof Set?l[e]=new Set(r(Array.from(t),u)):ArrayBuffer.isView(t)?l[e]=y(t):l[e]=u(t)}return l}}function R(n){var r=[],o=[];return n.proto?l:s;function u(e,t){for(var i=Object.keys(e),a=new Array(i.length),f=0;f<i.length;f++){var p=i[f],c=e[p];if(typeof c!="object"||c===null)a[p]=c;else if(c instanceof Date)a[p]=new Date(c);else if(ArrayBuffer.isView(c))a[p]=y(c);else{var d=r.indexOf(c);d!==-1?a[p]=o[d]:a[p]=t(c)}}return a}function s(e){if(typeof e!="object"||e===null)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return u(e,s);if(e instanceof Map)return new Map(u(Array.from(e),s));if(e instanceof Set)return new Set(u(Array.from(e),s));var t={};r.push(e),o.push(t);for(var i in e)if(Object.hasOwnProperty.call(e,i)!==!1){var a=e[i];if(typeof a!="object"||a===null)t[i]=a;else if(a instanceof Date)t[i]=new Date(a);else if(a instanceof Map)t[i]=new Map(u(Array.from(a),s));else if(a instanceof Set)t[i]=new Set(u(Array.from(a),s));else if(ArrayBuffer.isView(a))t[i]=y(a);else{var f=r.indexOf(a);f!==-1?t[i]=o[f]:t[i]=s(a)}}return r.pop(),o.pop(),t}function l(e){if(typeof e!="object"||e===null)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return u(e,l);if(e instanceof Map)return new Map(u(Array.from(e),l));if(e instanceof Set)return new Set(u(Array.from(e),l));var t={};r.push(e),o.push(t);for(var i in e){var a=e[i];if(typeof a!="object"||a===null)t[i]=a;else if(a instanceof Date)t[i]=new Date(a);else if(a instanceof Map)t[i]=new Map(u(Array.from(a),l));else if(a instanceof Set)t[i]=new Set(u(Array.from(a),l));else if(ArrayBuffer.isView(a))t[i]=y(a);else{var f=r.indexOf(a);f!==-1?t[i]=o[f]:t[i]=l(a)}}return r.pop(),o.pop(),t}}});var W={};P(W,{defaults:()=>C,noNewKeys:()=>U,version:()=>Q});var D=L(v(),1);var I=(0,D.default)();function m(n){if(n==null||typeof n!="object")return!1;let r=Object.getPrototypeOf(n);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in n)&&!(Symbol.toStringTag in n)}function _(n){return typeof n=="string"}function O(n,r){return m(n)&&_(r)&&r in n}var x="5.1.2";var Q=x,C={mode:2};function U(n,r,o){if(o&&!m(o))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(o,null,4)} (type ${typeof o})`);let u=b(b({},C),o);if(typeof u.mode=="string"&&["1","2"].includes(u.mode))u.mode=+u.mode;else if(![1,2].includes(u.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] resolvedOpts.mode should be "1" or "2" (string or number).');function s(l,e,t,i){let a;if(m(l))m(e)?Object.keys(l).forEach(f=>{O(e,f)?(m(l[f])||Array.isArray(l[f]))&&(a={path:i.path.length?`${i.path}.${f}`:f,res:i.res},i.res=s(l[f],e[f],t,a).res):(a=i.path.length?`${i.path}.${f}`:f,i.res.push(a))}):i.res=i.res.concat(Object.keys(l).map(f=>i.path.length?`${i.path}.${f}`:f));else if(Array.isArray(l))if(Array.isArray(e))for(let f=0,p=l.length;f<p;f++)a={path:`${i.path.length?i.path:""}[${f}]`,res:i.res},t.mode===2?i.res=s(l[f],e[0],t,a).res:i.res=s(l[f],e[f],t,a).res;else i.res=i.res.concat(l.map((f,p)=>`${i.path.length?i.path:""}[${p}]`));return i}return s(n,r,u,{path:"",res:[]}).res}return F(W);})();
10
+ "use strict";var objectNoNewKeys=(()=>{var $=Object.create;var h=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames,w=Object.getOwnPropertySymbols,N=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var A=(n,r,o)=>r in n?h(n,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[r]=o,b=(n,r)=>{for(var o in r||(r={}))g.call(r,o)&&A(n,o,r[o]);if(w)for(var o of w(r))E.call(r,o)&&A(n,o,r[o]);return n};var T=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports),P=(n,r)=>{for(var o in r)h(n,o,{get:r[o],enumerable:!0})},j=(n,r,o,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of M(r))!g.call(n,s)&&s!==o&&h(n,s,{get:()=>r[s],enumerable:!(u=B(r,s))||u.enumerable});return n};var L=(n,r,o)=>(o=n!=null?$(N(n)):{},j(r||!n||!n.__esModule?h(o,"default",{value:n,enumerable:!0}):o,n)),F=n=>j(h({},"__esModule",{value:!0}),n);var v=T((H,S)=>{"use strict";S.exports=J;function y(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function J(n){if(n=n||{},n.circles)return R(n);return n.proto?u:o;function r(s,l){for(var e=Object.keys(s),t=new Array(e.length),i=0;i<e.length;i++){var a=e[i],f=s[a];typeof f!="object"||f===null?t[a]=f:f instanceof Date?t[a]=new Date(f):ArrayBuffer.isView(f)?t[a]=y(f):t[a]=l(f)}return t}function o(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return r(s,o);if(s instanceof Map)return new Map(r(Array.from(s),o));if(s instanceof Set)return new Set(r(Array.from(s),o));var l={};for(var e in s)if(Object.hasOwnProperty.call(s,e)!==!1){var t=s[e];typeof t!="object"||t===null?l[e]=t:t instanceof Date?l[e]=new Date(t):t instanceof Map?l[e]=new Map(r(Array.from(t),o)):t instanceof Set?l[e]=new Set(r(Array.from(t),o)):ArrayBuffer.isView(t)?l[e]=y(t):l[e]=o(t)}return l}function u(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return r(s,u);if(s instanceof Map)return new Map(r(Array.from(s),u));if(s instanceof Set)return new Set(r(Array.from(s),u));var l={};for(var e in s){var t=s[e];typeof t!="object"||t===null?l[e]=t:t instanceof Date?l[e]=new Date(t):t instanceof Map?l[e]=new Map(r(Array.from(t),u)):t instanceof Set?l[e]=new Set(r(Array.from(t),u)):ArrayBuffer.isView(t)?l[e]=y(t):l[e]=u(t)}return l}}function R(n){var r=[],o=[];return n.proto?l:s;function u(e,t){for(var i=Object.keys(e),a=new Array(i.length),f=0;f<i.length;f++){var p=i[f],c=e[p];if(typeof c!="object"||c===null)a[p]=c;else if(c instanceof Date)a[p]=new Date(c);else if(ArrayBuffer.isView(c))a[p]=y(c);else{var d=r.indexOf(c);d!==-1?a[p]=o[d]:a[p]=t(c)}}return a}function s(e){if(typeof e!="object"||e===null)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return u(e,s);if(e instanceof Map)return new Map(u(Array.from(e),s));if(e instanceof Set)return new Set(u(Array.from(e),s));var t={};r.push(e),o.push(t);for(var i in e)if(Object.hasOwnProperty.call(e,i)!==!1){var a=e[i];if(typeof a!="object"||a===null)t[i]=a;else if(a instanceof Date)t[i]=new Date(a);else if(a instanceof Map)t[i]=new Map(u(Array.from(a),s));else if(a instanceof Set)t[i]=new Set(u(Array.from(a),s));else if(ArrayBuffer.isView(a))t[i]=y(a);else{var f=r.indexOf(a);f!==-1?t[i]=o[f]:t[i]=s(a)}}return r.pop(),o.pop(),t}function l(e){if(typeof e!="object"||e===null)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return u(e,l);if(e instanceof Map)return new Map(u(Array.from(e),l));if(e instanceof Set)return new Set(u(Array.from(e),l));var t={};r.push(e),o.push(t);for(var i in e){var a=e[i];if(typeof a!="object"||a===null)t[i]=a;else if(a instanceof Date)t[i]=new Date(a);else if(a instanceof Map)t[i]=new Map(u(Array.from(a),l));else if(a instanceof Set)t[i]=new Set(u(Array.from(a),l));else if(ArrayBuffer.isView(a))t[i]=y(a);else{var f=r.indexOf(a);f!==-1?t[i]=o[f]:t[i]=l(a)}}return r.pop(),o.pop(),t}}});var W={};P(W,{defaults:()=>C,noNewKeys:()=>U,version:()=>Q});var D=L(v(),1);var I=(0,D.default)();function m(n){if(n==null||typeof n!="object")return!1;let r=Object.getPrototypeOf(n);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in n)&&!(Symbol.toStringTag in n)}function _(n){return typeof n=="string"}function O(n,r){return m(n)&&_(r)&&r in n}var x="5.1.4";var Q=x,C={mode:2};function U(n,r,o){if(o&&!m(o))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(o,null,4)} (type ${typeof o})`);let u=b(b({},C),o);if(typeof u.mode=="string"&&["1","2"].includes(u.mode))u.mode=+u.mode;else if(![1,2].includes(u.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] resolvedOpts.mode should be "1" or "2" (string or number).');function s(l,e,t,i){let a;if(m(l))m(e)?Object.keys(l).forEach(f=>{O(e,f)?(m(l[f])||Array.isArray(l[f]))&&(a={path:i.path.length?`${i.path}.${f}`:f,res:i.res},i.res=s(l[f],e[f],t,a).res):(a=i.path.length?`${i.path}.${f}`:f,i.res.push(a))}):i.res=i.res.concat(Object.keys(l).map(f=>i.path.length?`${i.path}.${f}`:f));else if(Array.isArray(l))if(Array.isArray(e))for(let f=0,p=l.length;f<p;f++)a={path:`${i.path.length?i.path:""}[${f}]`,res:i.res},t.mode===2?i.res=s(l[f],e[0],t,a).res:i.res=s(l[f],e[f],t,a).res;else i.res=i.res.concat(l.map((f,p)=>`${i.path.length?i.path:""}[${p}]`));return i}return s(n,r,u,{path:"",res:[]}).res}return F(W);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.6.1
14
+ * @version 1.6.3
15
15
  * @author Roy Revelt, Codsen Ltd
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.1.2",
3
+ "version": "5.1.4",
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",
@@ -72,6 +72,6 @@
72
72
  }
73
73
  },
74
74
  "dependencies": {
75
- "codsen-utils": "^1.6.1"
75
+ "codsen-utils": "^1.6.3"
76
76
  }
77
77
  }
package/types/index.d.ts CHANGED
@@ -11,4 +11,4 @@ declare function noNewKeys(
11
11
  opts?: Partial<Opts>,
12
12
  ): string[];
13
13
 
14
- export { Opts, defaults, noNewKeys, version };
14
+ export { type Opts, defaults, noNewKeys, version };