object-no-new-keys 4.1.5 → 4.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,6 +3,13 @@
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
+ # 4.2.0 (2022-08-12)
7
+
8
+ ### Features
9
+
10
+ - export types ([1dc433f](https://github.com/codsen/codsen/commit/1dc433f2989232a8a5887a9d10dfacc0787dcd93))
11
+ - export types ([11b5fb9](https://github.com/codsen/codsen/commit/11b5fb936ce20e0a77c3a09806773e1cd7695c50))
12
+
6
13
  ## 4.1.3 (2022-04-25)
7
14
 
8
15
  ### Bug Fixes
@@ -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.1.5
4
+ * @version 4.2.0
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 u="4.1.5";var f=u;function l(c){return!!c&&typeof c=="object"&&!Array.isArray(c)}var b={mode:2};function g(c,d,a){if(a&&!l(a))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(a,null,4)} (type ${typeof a})`);let n={...b,...a};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 i(s,o,p,e){let r;if(l(s))l(o)?Object.keys(s).forEach(t=>{Object.prototype.hasOwnProperty.call(o,t)?(l(s[t])||Array.isArray(s[t]))&&(r={path:e.path.length?`${e.path}.${t}`:t,res:e.res},e.res=i(s[t],o[t],p,r).res):(r=e.path.length?`${e.path}.${t}`:t,e.res.push(r))}):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(o))for(let t=0,y=s.length;t<y;t++)r={path:`${e.path.length?e.path:""}[${t}]`,res:e.res},p.mode===2?e.res=i(s[t],o[0],p,r).res:e.res=i(s[t],o[t],p,r).res;else e.res=e.res.concat(s.map((t,y)=>`${e.path.length?e.path:""}[${y}]`));return e}return i(c,d,n,{path:"",res:[]}).res}export{b as defaults,g as noNewKeys,f as version};
10
+ var u="4.2.0";var f=u;function l(c){return!!c&&typeof c=="object"&&!Array.isArray(c)}var b={mode:2};function g(c,d,a){if(a&&!l(a))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(a,null,4)} (type ${typeof a})`);let o={...b,...a};if(typeof o.mode=="string"&&["1","2"].includes(o.mode))o.mode=+o.mode;else if(![1,2].includes(o.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] resolvedOpts.mode should be "1" or "2" (string or number).');function p(s,n,i,e){let r;if(l(s))l(n)?Object.keys(s).forEach(t=>{Object.prototype.hasOwnProperty.call(n,t)?(l(s[t])||Array.isArray(s[t]))&&(r={path:e.path.length?`${e.path}.${t}`:t,res:e.res},e.res=p(s[t],n[t],i,r).res):(r=e.path.length?`${e.path}.${t}`:t,e.res.push(r))}):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,y=s.length;t<y;t++)r={path:`${e.path.length?e.path:""}[${t}]`,res:e.res},i.mode===2?e.res=p(s[t],n[0],i,r).res:e.res=p(s[t],n[t],i,r).res;else e.res=e.res.concat(s.map((t,y)=>`${e.path.length?e.path:""}[${y}]`));return e}return p(c,d,o,{path:"",res:[]}).res}export{b as defaults,g as noNewKeys,f as version};
@@ -1,10 +1,10 @@
1
1
  "use strict";/**
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.1.5
4
+ * @version 4.2.0
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 objectNoNewKeys=(()=>{var y=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var m=(t,e,s)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,h=(t,e)=>{for(var s in e||(e={}))j.call(e,s)&&m(t,s,e[s]);if(b)for(var s of b(e))A.call(e,s)&&m(t,s,e[s]);return t};var x=(t,e)=>{for(var s in e)y(t,s,{get:e[s],enumerable:!0})},J=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of O(e))!j.call(t,c)&&c!==s&&y(t,c,{get:()=>e[c],enumerable:!(a=w(e,c))||a.enumerable});return t};var $=t=>J(y({},"__esModule",{value:!0}),t);var E={};x(E,{defaults:()=>g,noNewKeys:()=>T,version:()=>N});var f="4.1.5";var N=f;function u(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}var g={mode:2};function T(t,e,s){if(s&&!u(s))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(s,null,4)} (type ${typeof s})`);let a=h(h({},g),s);if(typeof a.mode=="string"&&["1","2"].includes(a.mode))a.mode=+a.mode;else if(![1,2].includes(a.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] resolvedOpts.mode should be "1" or "2" (string or number).');function c(o,p,l,r){let i;if(u(o))u(p)?Object.keys(o).forEach(n=>{Object.prototype.hasOwnProperty.call(p,n)?(u(o[n])||Array.isArray(o[n]))&&(i={path:r.path.length?`${r.path}.${n}`:n,res:r.res},r.res=c(o[n],p[n],l,i).res):(i=r.path.length?`${r.path}.${n}`:n,r.res.push(i))}):r.res=r.res.concat(Object.keys(o).map(n=>r.path.length?`${r.path}.${n}`:n));else if(Array.isArray(o))if(Array.isArray(p))for(let n=0,d=o.length;n<d;n++)i={path:`${r.path.length?r.path:""}[${n}]`,res:r.res},l.mode===2?r.res=c(o[n],p[0],l,i).res:r.res=c(o[n],p[n],l,i).res;else r.res=r.res.concat(o.map((n,d)=>`${r.path.length?r.path:""}[${d}]`));return r}return c(t,e,a,{path:"",res:[]}).res}return $(E);})();
10
+ var objectNoNewKeys=(()=>{var y=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var m=(t,e,s)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,h=(t,e)=>{for(var s in e||(e={}))j.call(e,s)&&m(t,s,e[s]);if(b)for(var s of b(e))x.call(e,s)&&m(t,s,e[s]);return t};var A=(t,e)=>{for(var s in e)y(t,s,{get:e[s],enumerable:!0})},J=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of O(e))!j.call(t,c)&&c!==s&&y(t,c,{get:()=>e[c],enumerable:!(a=w(e,c))||a.enumerable});return t};var $=t=>J(y({},"__esModule",{value:!0}),t);var E={};A(E,{defaults:()=>g,noNewKeys:()=>T,version:()=>N});var f="4.2.0";var N=f;function u(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}var g={mode:2};function T(t,e,s){if(s&&!u(s))throw new TypeError(`object-no-new-keys/noNewKeys(): [THROW_ID_02] resolvedOpts should be a plain object. It was given as ${JSON.stringify(s,null,4)} (type ${typeof s})`);let a=h(h({},g),s);if(typeof a.mode=="string"&&["1","2"].includes(a.mode))a.mode=+a.mode;else if(![1,2].includes(a.mode))throw new TypeError('object-no-new-keys/objectNoNewKeys(): [THROW_ID_01] resolvedOpts.mode should be "1" or "2" (string or number).');function c(n,i,l,r){let p;if(u(n))u(i)?Object.keys(n).forEach(o=>{Object.prototype.hasOwnProperty.call(i,o)?(u(n[o])||Array.isArray(n[o]))&&(p={path:r.path.length?`${r.path}.${o}`:o,res:r.res},r.res=c(n[o],i[o],l,p).res):(p=r.path.length?`${r.path}.${o}`:o,r.res.push(p))}):r.res=r.res.concat(Object.keys(n).map(o=>r.path.length?`${r.path}.${o}`:o));else if(Array.isArray(n))if(Array.isArray(i))for(let o=0,d=n.length;o<d;o++)p={path:`${r.path.length?r.path:""}[${o}]`,res:r.res},l.mode===2?r.res=c(n[o],i[0],l,p).res:r.res=c(n[o],i[o],l,p).res;else r.res=r.res.concat(n.map((o,d)=>`${r.path.length?r.path:""}[${d}]`));return r}return c(t,e,a,{path:"",res:[]}).res}return $(E);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "object-no-new-keys",
3
- "version": "4.1.5",
3
+ "version": "4.2.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",
package/types/index.d.ts CHANGED
@@ -20,4 +20,4 @@ declare function noNewKeys(
20
20
  opts?: Partial<Opts>
21
21
  ): string[];
22
22
 
23
- export { defaults, noNewKeys, version };
23
+ export { JsonArray, JsonObject, JsonValue, Opts, defaults, noNewKeys, version };