object-no-new-keys 4.2.1 → 4.2.3
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 +19 -19
- package/dist/object-no-new-keys.esm.js +2 -2
- package/dist/object-no-new-keys.umd.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,13 +12,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
12
12
|
|
|
13
13
|
## 4.1.3 (2022-04-25)
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### Fixed
|
|
16
16
|
|
|
17
17
|
- improve types ([f2b1ea1](https://github.com/codsen/codsen/commit/f2b1ea1dee7b912cf1e9d5f30e7483f49b3f8d07))
|
|
18
18
|
|
|
19
19
|
## 4.1.2 (2022-04-18)
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### Fixed
|
|
22
22
|
|
|
23
23
|
- tweak types ([fe67aa5](https://github.com/codsen/codsen/commit/fe67aa510c5523969e83d905c7420106081d4a8b))
|
|
24
24
|
|
|
@@ -52,7 +52,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
52
52
|
|
|
53
53
|
## 3.0.1 (2021-01-28)
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Fixed
|
|
56
56
|
|
|
57
57
|
- add testStats to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29))
|
|
58
58
|
|
|
@@ -78,42 +78,42 @@ Accidental version bump during migration to sourcehut. Sorry about that.
|
|
|
78
78
|
|
|
79
79
|
## 2.8.0 (2019-10-02)
|
|
80
80
|
|
|
81
|
-
-
|
|
81
|
+
- Remove option type checking to make program run around 54 times faster ([5acc5f6](https://gitlab.com/codsen/codsen/commit/5acc5f6))
|
|
82
82
|
|
|
83
83
|
## 2.7.0 (2019-01-20)
|
|
84
84
|
|
|
85
|
-
-
|
|
86
|
-
-
|
|
85
|
+
- Various documentation and setup tweaks after we migrated to monorepo
|
|
86
|
+
- Setup refresh: updated dependencies and all config files using automated tools
|
|
87
87
|
|
|
88
88
|
## 2.3.0 (2018-10-24)
|
|
89
89
|
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
90
|
+
- Updated all dependencies
|
|
91
|
+
- Restored coveralls.io reporting
|
|
92
|
+
- Restored unit test linting
|
|
93
93
|
|
|
94
94
|
## 2.2.0 (2018-06-16)
|
|
95
95
|
|
|
96
96
|
GitHub sold us out. In the meantime, we:
|
|
97
97
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
98
|
+
- Migrated to Bitbucket (to host repo + perform CI) and Codacy (for code quality audit)
|
|
99
|
+
- Dropped BitHound (RIP) and Travis
|
|
100
100
|
|
|
101
101
|
## 2.1.0 (2018-05-26)
|
|
102
102
|
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
103
|
+
- Set up [Prettier](https://prettier.io) on a custom ESLint rule set.
|
|
104
|
+
- Removed `package.lock` and `.editorconfig`
|
|
105
|
+
- Wired Rollup to remove comments from non-dev builds. This means we can now leave the `console.log`s in the source code — there's no need to comment-out `console.log` statements or care about them not spilling into production. Now it's done automatically.
|
|
106
|
+
- Unit tests are pointing at ES modules build, which means that code coverage is correct now, without Babel functions being missed. This is important because now code coverage is real again and now there are no excuses not to perfect it.
|
|
107
107
|
|
|
108
108
|
## 2.0.0 (2017-12-12)
|
|
109
109
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
110
|
+
- Rebased in ES Modules
|
|
111
|
+
- Set up Rollup. Now we generate and serve three builds: CommonJS, UMD and ES Modules.
|
|
112
|
+
- Whole setup overhaul to match my latest understanding how things should be set.
|
|
113
113
|
|
|
114
114
|
## 1.1.0 (2017-07-25)
|
|
115
115
|
|
|
116
|
-
-
|
|
116
|
+
- Since mode is integer, some people might pass integer as a third argument (instead of if passing plain object, `{mode: 1||2}`. I added a human-friendly error message which explains it's wrong if it's happens.
|
|
117
117
|
|
|
118
118
|
- `object-assign` from dependencies, switched to native ES6 `Object.assign`
|
|
119
119
|
- `type-detect` replacing it with 10 times lighter `lodash.isplainobject`
|
|
@@ -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.2.
|
|
4
|
+
* @version 4.2.3
|
|
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.2.
|
|
10
|
+
var u="4.2.3";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
|
/**
|
|
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.2.
|
|
4
|
+
* @version 4.2.3
|
|
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 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.
|
|
10
|
+
"use strict";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.3";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);})();
|