object-all-values-equal-to 3.0.4 → 3.0.10

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,26 +3,6 @@
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
- ## 3.0.3 (2021-11-02)
7
-
8
- ### Bug Fixes
9
-
10
- - bump TS and separate ESLint plugins away from this monorepo ([b1ebce1](https://github.com/codsen/codsen/commit/b1ebce1637d8c41c2d848fc24b0ba4058865bd5d))
11
-
12
- ### Features
13
-
14
- - migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
15
-
16
- ### BREAKING CHANGES
17
-
18
- - programs now are in ES Modules and won't work with Common JS require()
19
-
20
- ## 3.0.1 (2021-09-13)
21
-
22
- ### Bug Fixes
23
-
24
- - bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
25
-
26
6
  ## 3.0.0 (2021-09-09)
27
7
 
28
8
  ### Features
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-%YEAR% Roy Revelt and other contributors
3
+ Copyright (c) 2010-2021 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
@@ -38,6 +38,7 @@ If you need a legacy version which works with `require`, use version 2.1.0
38
38
 
39
39
  ```js
40
40
  import { strict as assert } from "assert";
41
+
41
42
  import { allEq } from "object-all-values-equal-to";
42
43
 
43
44
  // are all values equal to null:
@@ -74,7 +75,7 @@ assert.equal(
74
75
 
75
76
  ## Documentation
76
77
 
77
- Please [visit codsen.com](https://codsen.com/os/object-all-values-equal-to/) for a full description of the API and examples.
78
+ Please [visit codsen.com](https://codsen.com/os/object-all-values-equal-to/) for a full description of the API.
78
79
 
79
80
  ## Contributing
80
81
 
@@ -86,4 +87,6 @@ MIT License
86
87
 
87
88
  Copyright (c) 2010-2021 Roy Revelt and other contributors
88
89
 
90
+
89
91
  <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">
92
+
@@ -1,64 +1,11 @@
1
1
  /**
2
2
  * @name object-all-values-equal-to
3
3
  * @fileoverview Does the AST/nested-plain-object/array/whatever contain only one kind of value?
4
- * @version 3.0.4
4
+ * @version 3.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/object-all-values-equal-to/}
8
8
  */
9
9
 
10
- import isObj from 'lodash.isplainobject';
11
- import isEq from 'lodash.isequal';
12
-
13
- var version$1 = "3.0.4";
14
-
15
- const version = version$1;
16
- function allValuesEqualTo(input, value, opts) {
17
- if (Array.isArray(input)) {
18
- if (input.length === 0) {
19
- return true;
20
- }
21
- if (opts.arraysMustNotContainPlaceholders && input.length > 0 && input.some(el => isEq(el, value))) {
22
- return false;
23
- }
24
- for (let i = input.length; i--;) {
25
- if (!allValuesEqualTo(input[i], value, opts)) {
26
- return false;
27
- }
28
- }
29
- return true;
30
- }
31
- if (isObj(input)) {
32
- const keys = Object.keys(input);
33
- if (keys.length === 0) {
34
- return true;
35
- }
36
- for (let i = keys.length; i--;) {
37
- if (!allValuesEqualTo(input[keys[i]], value, opts)) {
38
- return false;
39
- }
40
- }
41
- return true;
42
- }
43
- return isEq(input, value);
44
- }
45
- function allEq(inputOriginal, valueOriginal, originalOpts) {
46
- if (inputOriginal === undefined) {
47
- throw new Error("object-all-values-equal-to: [THROW_ID_01] The first input is undefined! Please provide the first argument.");
48
- }
49
- if (valueOriginal === undefined) {
50
- throw new Error("object-all-values-equal-to: [THROW_ID_02] The second input is undefined! Please provide the second argument.");
51
- }
52
- if (originalOpts && !isObj(originalOpts)) {
53
- throw new Error(`object-all-values-equal-to: [THROW_ID_03] The third argument, options object, was given not as a plain object but as a ${typeof originalOpts}, equal to:\n${JSON.stringify(originalOpts, null, 4)}`);
54
- }
55
- const defaults = {
56
- arraysMustNotContainPlaceholders: true
57
- };
58
- const opts = { ...defaults,
59
- ...originalOpts
60
- };
61
- return allValuesEqualTo(inputOriginal, valueOriginal, opts);
62
- }
63
-
64
- export { allEq, version };
10
+ import a from"lodash.isplainobject";import i from"lodash.isequal";var n="3.0.10";var h=n;function l(e,r,t){if(Array.isArray(e)){if(e.length===0)return!0;if(t.arraysMustNotContainPlaceholders&&e.length>0&&e.some(s=>i(s,r)))return!1;for(let s=e.length;s--;)if(!l(e[s],r,t))return!1;return!0}if(a(e)){let s=Object.keys(e);if(s.length===0)return!0;for(let o=s.length;o--;)if(!l(e[s[o]],r,t))return!1;return!0}return i(e,r)}function y(e,r,t){if(e===void 0)throw new Error("object-all-values-equal-to: [THROW_ID_01] The first input is undefined! Please provide the first argument.");if(r===void 0)throw new Error("object-all-values-equal-to: [THROW_ID_02] The second input is undefined! Please provide the second argument.");if(t&&!a(t))throw new Error(`object-all-values-equal-to: [THROW_ID_03] The third argument, options object, was given not as a plain object but as a ${typeof t}, equal to:
11
+ ${JSON.stringify(t,null,4)}`);let o={...{arraysMustNotContainPlaceholders:!0},...t};return l(e,r,o)}export{y as allEq,h as version};
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * @name object-all-values-equal-to
3
3
  * @fileoverview Does the AST/nested-plain-object/array/whatever contain only one kind of value?
4
- * @version 3.0.4
4
+ * @version 3.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/object-all-values-equal-to/}
8
8
  */
9
9
 
10
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).objectAllValuesEqualTo={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var r,n,o=Object.prototype,i=Function.prototype.toString,a=o.hasOwnProperty,u=i.call(Object),c=o.toString,s=(r=Object.getPrototypeOf,n=Object,function(t){return r(n(t))});var f=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=c.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=s(t);if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&i.call(r)==u},l={exports:{}};!function(t,r){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Array]",u="[object Boolean]",c="[object Date]",s="[object Error]",f="[object Function]",l="[object Map]",h="[object Number]",p="[object Object]",_="[object Promise]",y="[object RegExp]",v="[object Set]",d="[object String]",b="[object Symbol]",g="[object WeakMap]",j="[object ArrayBuffer]",w="[object DataView]",O=/^\[object .+?Constructor\]$/,m=/^(?:0|[1-9]\d*)$/,A={};A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A[i]=A[a]=A[j]=A[u]=A[w]=A[c]=A[s]=A[f]=A[l]=A[h]=A[p]=A[y]=A[v]=A[d]=A[g]=!1;var z="object"==typeof e&&e&&e.Object===Object&&e,T="object"==typeof self&&self&&self.Object===Object&&self,S=z||T||Function("return this")(),P=r&&!r.nodeType&&r,x=P&&t&&!t.nodeType&&t,E=x&&x.exports===P,k=E&&z.process,$=function(){try{return k&&k.binding&&k.binding("util")}catch(t){}}(),F=$&&$.isTypedArray;function I(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function M(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function q(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var D,R=Array.prototype,U=Object.prototype,B=S["__core-js_shared__"],L=Function.prototype.toString,N=U.hasOwnProperty,W=(D=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",C=U.toString,H=RegExp("^"+L.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=E?S.Buffer:void 0,G=S.Symbol,J=S.Uint8Array,K=U.propertyIsEnumerable,Q=R.splice,X=G?G.toStringTag:void 0,Y=Object.getOwnPropertySymbols,Z=V?V.isBuffer:void 0,tt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),et=xt(S,"DataView"),rt=xt(S,"Map"),nt=xt(S,"Promise"),ot=xt(S,"Set"),it=xt(S,"WeakMap"),at=xt(Object,"create"),ut=Ft(et),ct=Ft(rt),st=Ft(nt),ft=Ft(ot),lt=Ft(it),ht=G?G.prototype:void 0,pt=ht?ht.valueOf:void 0;function _t(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function yt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function dt(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new vt;++e<r;)this.add(t[e])}function bt(t){var e=this.__data__=new yt(t);this.size=e.size}function gt(t,e){var r=qt(t),n=!r&&Mt(t),o=!r&&!n&&Dt(t),i=!r&&!n&&!o&&Nt(t),a=r||n||o||i,u=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=u.length;for(var s in t)!e&&!N.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||$t(s,c))||u.push(s);return u}function jt(t,e){for(var r=t.length;r--;)if(It(t[r][0],e))return r;return-1}function wt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":X&&X in Object(t)?function(t){var e=N.call(t,X),r=t[X];try{t[X]=void 0;var n=!0}catch(t){}var o=C.call(t);n&&(e?t[X]=r:delete t[X]);return o}(t):function(t){return C.call(t)}(t)}function Ot(t){return Lt(t)&&wt(t)==i}function mt(t,e,r,n,o){return t===e||(null==t||null==e||!Lt(t)&&!Lt(e)?t!=t&&e!=e:function(t,e,r,n,o,f){var _=qt(t),g=qt(e),O=_?a:kt(t),m=g?a:kt(e),A=(O=O==i?p:O)==p,z=(m=m==i?p:m)==p,T=O==m;if(T&&Dt(t)){if(!Dt(e))return!1;_=!0,A=!1}if(T&&!A)return f||(f=new bt),_||Nt(t)?Tt(t,e,r,n,o,f):function(t,e,r,n,o,i,a){switch(r){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!i(new J(t),new J(e)));case u:case c:case h:return It(+t,+e);case s:return t.name==e.name&&t.message==e.message;case y:case d:return t==e+"";case l:var f=M;case v:if(f||(f=q),t.size!=e.size&&!(1&n))return!1;var p=a.get(t);if(p)return p==e;n|=2,a.set(t,e);var _=Tt(f(t),f(e),n,o,i,a);return a.delete(t),_;case b:if(pt)return pt.call(t)==pt.call(e)}return!1}(t,e,O,r,n,o,f);if(!(1&r)){var S=A&&N.call(t,"__wrapped__"),P=z&&N.call(e,"__wrapped__");if(S||P){var x=S?t.value():t,E=P?e.value():e;return f||(f=new bt),o(x,E,r,n,f)}}if(!T)return!1;return f||(f=new bt),function(t,e,r,n,o,i){var a=1&r,u=St(t),c=u.length,s=St(e);if(c!=s.length&&!a)return!1;var f=c;for(;f--;){var l=u[f];if(!(a?l in e:N.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var _=a;for(;++f<c;){var y=t[l=u[f]],v=e[l];if(n)var d=a?n(v,y,l,e,t,i):n(y,v,l,t,e,i);if(!(void 0===d?y===v||o(y,v,r,n,i):d)){p=!1;break}_||(_="constructor"==l)}if(p&&!_){var b=t.constructor,g=e.constructor;b==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,n,o,f)}(t,e,r,n,mt,o))}function At(t){return!(!Bt(t)||function(t){return!!W&&W in t}(t))&&(Rt(t)?H:O).test(Ft(t))}function zt(t){if((e=t)!==("function"==typeof(r=e&&e.constructor)&&r.prototype||U))return tt(t);var e,r,n=[];for(var o in Object(t))N.call(t,o)&&"constructor"!=o&&n.push(o);return n}function Tt(t,e,r,n,o,i){var a=1&r,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var f=-1,l=!0,h=2&r?new dt:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var p=t[f],_=e[f];if(n)var y=a?n(_,p,f,e,t,i):n(p,_,f,t,e,i);if(void 0!==y){if(y)continue;l=!1;break}if(h){if(!I(e,(function(t,e){if(!h.has(e)&&(p===t||o(p,t,r,n,i)))return h.push(e)}))){l=!1;break}}else if(p!==_&&!o(p,_,r,n,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function St(t){return function(t,e,r){var n=e(t);return qt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Wt,Et)}function Pt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function xt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return At(r)?r:void 0}_t.prototype.clear=function(){this.__data__=at?at(null):{},this.size=0},_t.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_t.prototype.get=function(t){var e=this.__data__;if(at){var r=e[t];return r===n?void 0:r}return N.call(e,t)?e[t]:void 0},_t.prototype.has=function(t){var e=this.__data__;return at?void 0!==e[t]:N.call(e,t)},_t.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=at&&void 0===e?n:e,this},yt.prototype.clear=function(){this.__data__=[],this.size=0},yt.prototype.delete=function(t){var e=this.__data__,r=jt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Q.call(e,r,1),--this.size,!0)},yt.prototype.get=function(t){var e=this.__data__,r=jt(e,t);return r<0?void 0:e[r][1]},yt.prototype.has=function(t){return jt(this.__data__,t)>-1},yt.prototype.set=function(t,e){var r=this.__data__,n=jt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},vt.prototype.clear=function(){this.size=0,this.__data__={hash:new _t,map:new(rt||yt),string:new _t}},vt.prototype.delete=function(t){var e=Pt(this,t).delete(t);return this.size-=e?1:0,e},vt.prototype.get=function(t){return Pt(this,t).get(t)},vt.prototype.has=function(t){return Pt(this,t).has(t)},vt.prototype.set=function(t,e){var r=Pt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},dt.prototype.add=dt.prototype.push=function(t){return this.__data__.set(t,n),this},dt.prototype.has=function(t){return this.__data__.has(t)},bt.prototype.clear=function(){this.__data__=new yt,this.size=0},bt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},bt.prototype.get=function(t){return this.__data__.get(t)},bt.prototype.has=function(t){return this.__data__.has(t)},bt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof yt){var n=r.__data__;if(!rt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new vt(n)}return r.set(t,e),this.size=r.size,this};var Et=Y?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}(Y(t),(function(e){return K.call(t,e)})))}:function(){return[]},kt=wt;function $t(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||m.test(t))&&t>-1&&t%1==0&&t<e}function Ft(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function It(t,e){return t===e||t!=t&&e!=e}(et&&kt(new et(new ArrayBuffer(1)))!=w||rt&&kt(new rt)!=l||nt&&kt(nt.resolve())!=_||ot&&kt(new ot)!=v||it&&kt(new it)!=g)&&(kt=function(t){var e=wt(t),r=e==p?t.constructor:void 0,n=r?Ft(r):"";if(n)switch(n){case ut:return w;case ct:return l;case st:return _;case ft:return v;case lt:return g}return e});var Mt=Ot(function(){return arguments}())?Ot:function(t){return Lt(t)&&N.call(t,"callee")&&!K.call(t,"callee")},qt=Array.isArray;var Dt=Z||function(){return!1};function Rt(t){if(!Bt(t))return!1;var e=wt(t);return e==f||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ut(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function Bt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Lt(t){return null!=t&&"object"==typeof t}var Nt=F?function(t){return function(e){return t(e)}}(F):function(t){return Lt(t)&&Ut(t.length)&&!!A[wt(t)]};function Wt(t){return null!=(e=t)&&Ut(e.length)&&!Rt(e)?gt(t):zt(t);var e}t.exports=function(t,e){return mt(t,e)}}(l,l.exports);var h=l.exports;function p(t,e,r){if(Array.isArray(t)){if(0===t.length)return!0;if(r.arraysMustNotContainPlaceholders&&t.length>0&&t.some((t=>h(t,e))))return!1;for(let n=t.length;n--;)if(!p(t[n],e,r))return!1;return!0}if(f(t)){const n=Object.keys(t);if(0===n.length)return!0;for(let o=n.length;o--;)if(!p(t[n[o]],e,r))return!1;return!0}return h(t,e)}t.allEq=function(t,e,r){if(void 0===t)throw new Error("object-all-values-equal-to: [THROW_ID_01] The first input is undefined! Please provide the first argument.");if(void 0===e)throw new Error("object-all-values-equal-to: [THROW_ID_02] The second input is undefined! Please provide the second argument.");if(r&&!f(r))throw new Error(`object-all-values-equal-to: [THROW_ID_03] The third argument, options object, was given not as a plain object but as a ${typeof r}, equal to:\n${JSON.stringify(r,null,4)}`);return p(t,e,{arraysMustNotContainPlaceholders:!0,...r})},t.version="3.0.4",Object.defineProperty(t,"__esModule",{value:!0})}));
10
+ var objectAllValuesEqualTo=(()=>{var it=Object.create;var I=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,ut=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable;var ge=(e,t,r)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Z=(e,t)=>{for(var r in t||(t={}))pe.call(t,r)&&ge(e,r,t[r]);if(de)for(var r of de(t))ft.call(t,r)&&ge(e,r,t[r]);return e};var he=e=>I(e,"__esModule",{value:!0});var ye=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lt=(e,t)=>{for(var r in t)I(e,r,{get:t[r],enumerable:!0})},_e=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ot(t))!pe.call(e,i)&&(r||i!=="default")&&I(e,i,{get:()=>t[i],enumerable:!(n=st(t,i))||n.enumerable});return e},be=(e,t)=>_e(he(I(e!=null?it(ut(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),ct=(e=>(t,r)=>e&&e.get(t)||(r=_e(he({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ae=ye((nn,we)=>{var dt="[object Object]";function pt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function gt(e,t){return function(r){return e(t(r))}}var ht=Function.prototype,ve=Object.prototype,Te=ht.toString,yt=ve.hasOwnProperty,_t=Te.call(Object),bt=ve.toString,vt=gt(Object.getPrototypeOf,Object);function Tt(e){return!!e&&typeof e=="object"}function wt(e){if(!Tt(e)||bt.call(e)!=dt||pt(e))return!1;var t=vt(e);if(t===null)return!0;var r=yt.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Te.call(r)==_t}we.exports=wt});var nt=ye((q,E)=>{var At=200,Q="__lodash_hash_undefined__",G=1,me=2,je=9007199254740991,N="[object Arguments]",V="[object Array]",mt="[object AsyncFunction]",Oe="[object Boolean]",Se="[object Date]",xe="[object Error]",Pe="[object Function]",jt="[object GeneratorFunction]",U="[object Map]",Ce="[object Number]",Ot="[object Null]",P="[object Object]",Ee="[object Promise]",St="[object Proxy]",Ie="[object RegExp]",B="[object Set]",De="[object String]",xt="[object Symbol]",Pt="[object Undefined]",k="[object WeakMap]",Le="[object ArrayBuffer]",F="[object DataView]",Ct="[object Float32Array]",Et="[object Float64Array]",It="[object Int8Array]",Dt="[object Int16Array]",Lt="[object Int32Array]",Mt="[object Uint8Array]",Rt="[object Uint8ClampedArray]",qt="[object Uint16Array]",zt="[object Uint32Array]",Ht=/[\\^$.*+?()[\]{}|]/g,Gt=/^\[object .+?Constructor\]$/,Nt=/^(?:0|[1-9]\d*)$/,s={};s[Ct]=s[Et]=s[It]=s[Dt]=s[Lt]=s[Mt]=s[Rt]=s[qt]=s[zt]=!0;s[N]=s[V]=s[Le]=s[Oe]=s[F]=s[Se]=s[xe]=s[Pe]=s[U]=s[Ce]=s[P]=s[Ie]=s[B]=s[De]=s[k]=!1;var Me=typeof global=="object"&&global&&global.Object===Object&&global,Ut=typeof self=="object"&&self&&self.Object===Object&&self,b=Me||Ut||Function("return this")(),Re=typeof q=="object"&&q&&!q.nodeType&&q,qe=Re&&typeof E=="object"&&E&&!E.nodeType&&E,ze=qe&&qe.exports===Re,ee=ze&&Me.process,He=function(){try{return ee&&ee.binding&&ee.binding("util")}catch(e){}}(),Ge=He&&He.isTypedArray;function Bt(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var u=e[r];t(u,r,e)&&(a[i++]=u)}return a}function Ft(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function $t(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function Kt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Wt(e){return function(t){return e(t)}}function Jt(e,t){return e.has(t)}function Xt(e,t){return e==null?void 0:e[t]}function Yt(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Zt(e,t){return function(r){return e(t(r))}}function Qt(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Vt=Array.prototype,kt=Function.prototype,$=Object.prototype,te=b["__core-js_shared__"],Ne=kt.toString,y=$.hasOwnProperty,Ue=function(){var e=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=$.toString,er=RegExp("^"+Ne.call(y).replace(Ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=ze?b.Buffer:void 0,K=b.Symbol,$e=b.Uint8Array,Ke=$.propertyIsEnumerable,tr=Vt.splice,j=K?K.toStringTag:void 0,We=Object.getOwnPropertySymbols,rr=Fe?Fe.isBuffer:void 0,nr=Zt(Object.keys,Object),re=C(b,"DataView"),D=C(b,"Map"),ne=C(b,"Promise"),ae=C(b,"Set"),ie=C(b,"WeakMap"),L=C(Object,"create"),ar=x(re),ir=x(D),sr=x(ne),or=x(ae),ur=x(ie),Je=K?K.prototype:void 0,se=Je?Je.valueOf:void 0;function O(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function fr(){this.__data__=L?L(null):{},this.size=0}function lr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function cr(e){var t=this.__data__;if(L){var r=t[e];return r===Q?void 0:r}return y.call(t,e)?t[e]:void 0}function dr(e){var t=this.__data__;return L?t[e]!==void 0:y.call(t,e)}function pr(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=L&&t===void 0?Q:t,this}O.prototype.clear=fr;O.prototype.delete=lr;O.prototype.get=cr;O.prototype.has=dr;O.prototype.set=pr;function v(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function gr(){this.__data__=[],this.size=0}function hr(e){var t=this.__data__,r=J(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():tr.call(t,r,1),--this.size,!0}function yr(e){var t=this.__data__,r=J(t,e);return r<0?void 0:t[r][1]}function _r(e){return J(this.__data__,e)>-1}function br(e,t){var r=this.__data__,n=J(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}v.prototype.clear=gr;v.prototype.delete=hr;v.prototype.get=yr;v.prototype.has=_r;v.prototype.set=br;function S(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function vr(){this.size=0,this.__data__={hash:new O,map:new(D||v),string:new O}}function Tr(e){var t=X(this,e).delete(e);return this.size-=t?1:0,t}function wr(e){return X(this,e).get(e)}function Ar(e){return X(this,e).has(e)}function mr(e,t){var r=X(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}S.prototype.clear=vr;S.prototype.delete=Tr;S.prototype.get=wr;S.prototype.has=Ar;S.prototype.set=mr;function W(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new S;++t<r;)this.add(e[t])}function jr(e){return this.__data__.set(e,Q),this}function Or(e){return this.__data__.has(e)}W.prototype.add=W.prototype.push=jr;W.prototype.has=Or;function w(e){var t=this.__data__=new v(e);this.size=t.size}function Sr(){this.__data__=new v,this.size=0}function xr(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Pr(e){return this.__data__.get(e)}function Cr(e){return this.__data__.has(e)}function Er(e,t){var r=this.__data__;if(r instanceof v){var n=r.__data__;if(!D||n.length<At-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new S(n)}return r.set(e,t),this.size=r.size,this}w.prototype.clear=Sr;w.prototype.delete=xr;w.prototype.get=Pr;w.prototype.has=Cr;w.prototype.set=Er;function Ir(e,t){var r=Y(e),n=!r&&Wr(e),i=!r&&!n&&oe(e),a=!r&&!n&&!i&&rt(e),u=r||n||i||a,f=u?Kt(e.length,String):[],l=f.length;for(var o in e)(t||y.call(e,o))&&!(u&&(o=="length"||i&&(o=="offset"||o=="parent")||a&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||Ur(o,l)))&&f.push(o);return f}function J(e,t){for(var r=e.length;r--;)if(Ve(e[r][0],t))return r;return-1}function Dr(e,t,r){var n=t(e);return Y(e)?n:Ft(n,r(e))}function M(e){return e==null?e===void 0?Pt:Ot:j&&j in Object(e)?Gr(e):Kr(e)}function Xe(e){return R(e)&&M(e)==N}function Ye(e,t,r,n,i){return e===t?!0:e==null||t==null||!R(e)&&!R(t)?e!==e&&t!==t:Lr(e,t,r,n,Ye,i)}function Lr(e,t,r,n,i,a){var u=Y(e),f=Y(t),l=u?V:A(e),o=f?V:A(t);l=l==N?P:l,o=o==N?P:o;var d=l==P,h=o==P,c=l==o;if(c&&oe(e)){if(!oe(t))return!1;u=!0,d=!1}if(c&&!d)return a||(a=new w),u||rt(e)?Ze(e,t,r,n,i,a):zr(e,t,l,r,n,i,a);if(!(r&G)){var p=d&&y.call(e,"__wrapped__"),g=h&&y.call(t,"__wrapped__");if(p||g){var T=p?e.value():e,_=g?t.value():t;return a||(a=new w),i(T,_,r,n,a)}}return c?(a||(a=new w),Hr(e,t,r,n,i,a)):!1}function Mr(e){if(!tt(e)||Fr(e))return!1;var t=ke(e)?er:Gt;return t.test(x(e))}function Rr(e){return R(e)&&et(e.length)&&!!s[M(e)]}function qr(e){if(!$r(e))return nr(e);var t=[];for(var r in Object(e))y.call(e,r)&&r!="constructor"&&t.push(r);return t}function Ze(e,t,r,n,i,a){var u=r&G,f=e.length,l=t.length;if(f!=l&&!(u&&l>f))return!1;var o=a.get(e);if(o&&a.get(t))return o==t;var d=-1,h=!0,c=r&me?new W:void 0;for(a.set(e,t),a.set(t,e);++d<f;){var p=e[d],g=t[d];if(n)var T=u?n(g,p,d,t,e,a):n(p,g,d,e,t,a);if(T!==void 0){if(T)continue;h=!1;break}if(c){if(!$t(t,function(_,m){if(!Jt(c,m)&&(p===_||i(p,_,r,n,a)))return c.push(m)})){h=!1;break}}else if(!(p===g||i(p,g,r,n,a))){h=!1;break}}return a.delete(e),a.delete(t),h}function zr(e,t,r,n,i,a,u){switch(r){case F:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Le:return!(e.byteLength!=t.byteLength||!a(new $e(e),new $e(t)));case Oe:case Se:case Ce:return Ve(+e,+t);case xe:return e.name==t.name&&e.message==t.message;case Ie:case De:return e==t+"";case U:var f=Yt;case B:var l=n&G;if(f||(f=Qt),e.size!=t.size&&!l)return!1;var o=u.get(e);if(o)return o==t;n|=me,u.set(e,t);var d=Ze(f(e),f(t),n,i,a,u);return u.delete(e),d;case xt:if(se)return se.call(e)==se.call(t)}return!1}function Hr(e,t,r,n,i,a){var u=r&G,f=Qe(e),l=f.length,o=Qe(t),d=o.length;if(l!=d&&!u)return!1;for(var h=l;h--;){var c=f[h];if(!(u?c in t:y.call(t,c)))return!1}var p=a.get(e);if(p&&a.get(t))return p==t;var g=!0;a.set(e,t),a.set(t,e);for(var T=u;++h<l;){c=f[h];var _=e[c],m=t[c];if(n)var ce=u?n(m,_,c,t,e,a):n(_,m,c,e,t,a);if(!(ce===void 0?_===m||i(_,m,r,n,a):ce)){g=!1;break}T||(T=c=="constructor")}if(g&&!T){var z=e.constructor,H=t.constructor;z!=H&&"constructor"in e&&"constructor"in t&&!(typeof z=="function"&&z instanceof z&&typeof H=="function"&&H instanceof H)&&(g=!1)}return a.delete(e),a.delete(t),g}function Qe(e){return Dr(e,Yr,Nr)}function X(e,t){var r=e.__data__;return Br(t)?r[typeof t=="string"?"string":"hash"]:r.map}function C(e,t){var r=Xt(e,t);return Mr(r)?r:void 0}function Gr(e){var t=y.call(e,j),r=e[j];try{e[j]=void 0;var n=!0}catch(a){}var i=Be.call(e);return n&&(t?e[j]=r:delete e[j]),i}var Nr=We?function(e){return e==null?[]:(e=Object(e),Bt(We(e),function(t){return Ke.call(e,t)}))}:Zr,A=M;(re&&A(new re(new ArrayBuffer(1)))!=F||D&&A(new D)!=U||ne&&A(ne.resolve())!=Ee||ae&&A(new ae)!=B||ie&&A(new ie)!=k)&&(A=function(e){var t=M(e),r=t==P?e.constructor:void 0,n=r?x(r):"";if(n)switch(n){case ar:return F;case ir:return U;case sr:return Ee;case or:return B;case ur:return k}return t});function Ur(e,t){return t=t==null?je:t,!!t&&(typeof e=="number"||Nt.test(e))&&e>-1&&e%1==0&&e<t}function Br(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fr(e){return!!Ue&&Ue in e}function $r(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||$;return e===r}function Kr(e){return Be.call(e)}function x(e){if(e!=null){try{return Ne.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ve(e,t){return e===t||e!==e&&t!==t}var Wr=Xe(function(){return arguments}())?Xe:function(e){return R(e)&&y.call(e,"callee")&&!Ke.call(e,"callee")},Y=Array.isArray;function Jr(e){return e!=null&&et(e.length)&&!ke(e)}var oe=rr||Qr;function Xr(e,t){return Ye(e,t)}function ke(e){if(!tt(e))return!1;var t=M(e);return t==Pe||t==jt||t==mt||t==St}function et(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=je}function tt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function R(e){return e!=null&&typeof e=="object"}var rt=Ge?Wt(Ge):Rr;function Yr(e){return Jr(e)?Ir(e):qr(e)}function Zr(){return[]}function Qr(){return!1}E.exports=Xr});var tn={};lt(tn,{allEq:()=>en,version:()=>kr});var ue=be(Ae(),1),fe=be(nt(),1);var at="3.0.10";var kr=at;function le(e,t,r){if(Array.isArray(e)){if(e.length===0)return!0;if(r.arraysMustNotContainPlaceholders&&e.length>0&&e.some(n=>(0,fe.default)(n,t)))return!1;for(let n=e.length;n--;)if(!le(e[n],t,r))return!1;return!0}if((0,ue.default)(e)){let n=Object.keys(e);if(n.length===0)return!0;for(let i=n.length;i--;)if(!le(e[n[i]],t,r))return!1;return!0}return(0,fe.default)(e,t)}function en(e,t,r){if(e===void 0)throw new Error("object-all-values-equal-to: [THROW_ID_01] The first input is undefined! Please provide the first argument.");if(t===void 0)throw new Error("object-all-values-equal-to: [THROW_ID_02] The second input is undefined! Please provide the second argument.");if(r&&!(0,ue.default)(r))throw new Error(`object-all-values-equal-to: [THROW_ID_03] The third argument, options object, was given not as a plain object but as a ${typeof r}, equal to:
11
+ ${JSON.stringify(r,null,4)}`);let i=Z(Z({},{arraysMustNotContainPlaceholders:!0}),r);return le(e,t,i)}return ct(tn);})();
@@ -1,6 +1,7 @@
1
1
  // Quick Take
2
2
 
3
3
  import { strict as assert } from "assert";
4
+
4
5
  import { allEq } from "../dist/object-all-values-equal-to.esm.js";
5
6
 
6
7
  // are all values equal to null:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "object-all-values-equal-to",
3
- "version": "3.0.4",
3
+ "version": "3.0.10",
4
4
  "description": "Does the AST/nested-plain-object/array/whatever contain only one kind of value?",
5
5
  "keywords": [
6
6
  "all",
@@ -34,100 +34,42 @@
34
34
  },
35
35
  "types": "types/index.d.ts",
36
36
  "scripts": {
37
- "build": "rollup -c",
38
- "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov",
39
- "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
40
- "clean_types": "../../scripts/cleanTypes.js",
41
- "dev": "rollup -c --dev",
42
- "devunittest": "npm run dev && tap --only -R 'base'",
43
- "esbuild": "node '../../scripts/esbuild.js'",
44
- "esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
45
- "format": "npm run lect && npm run prettier && npm run lint",
46
- "lect": "lect",
47
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
48
- "perf": "node perf/check",
49
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
50
- "republish": "npm publish || :",
51
- "tap": "tap",
52
- "pretest": "npm run build",
53
- "test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
54
- "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
55
- "tsc": "tsc",
56
- "unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
37
+ "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
38
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
39
+ "dts": "rollup -c",
40
+ "examples": "node '../../ops/scripts/run-examples.js'",
41
+ "lect": "node '../../ops/lect/lect.js'",
42
+ "letspublish": "yarn publish || :",
43
+ "lint": "eslint . --fix",
44
+ "perf": "node perf/check.js",
45
+ "prepare": "echo 'ready'",
46
+ "pretest": "yarn run lect && yarn run build",
47
+ "test": "c8 yarn run unit && yarn run examples && yarn run lint",
48
+ "unit": "uvu test"
57
49
  },
58
- "tap": {
59
- "check-coverage": false,
60
- "coverage-report": [
61
- "json-summary",
62
- "text"
63
- ],
64
- "node-arg": [
65
- "--no-warnings",
66
- "--experimental-loader",
67
- "@istanbuljs/esm-loader-hook"
50
+ "engines": {
51
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
52
+ },
53
+ "c8": {
54
+ "check-coverage": true,
55
+ "exclude": [
56
+ "**/test/**/*.*"
68
57
  ],
69
- "timeout": 0
58
+ "lines": 100
70
59
  },
71
60
  "lect": {
72
61
  "licence": {
73
62
  "extras": [
74
63
  ""
75
64
  ]
76
- },
77
- "req": "{ allEq }",
78
- "various": {
79
- "devDependencies": [
80
- "@types/lodash.isequal",
81
- "@types/lodash.isplainobject"
82
- ]
83
65
  }
84
66
  },
85
67
  "dependencies": {
86
- "@babel/runtime": "^7.16.0",
87
68
  "lodash.isequal": "^4.5.0",
88
69
  "lodash.isplainobject": "^4.0.6"
89
70
  },
90
71
  "devDependencies": {
91
- "@babel/cli": "^7.16.0",
92
- "@babel/core": "^7.16.0",
93
- "@babel/node": "^7.16.0",
94
- "@babel/plugin-external-helpers": "^7.16.0",
95
- "@babel/plugin-proposal-class-properties": "^7.16.0",
96
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
97
- "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
98
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
99
- "@babel/plugin-transform-runtime": "^7.16.0",
100
- "@babel/preset-env": "^7.16.0",
101
- "@babel/preset-typescript": "^7.16.0",
102
- "@babel/register": "^7.16.0",
103
- "@istanbuljs/esm-loader-hook": "^0.1.2",
104
- "@rollup/plugin-babel": "^5.3.0",
105
- "@rollup/plugin-commonjs": "^21.0.1",
106
- "@rollup/plugin-json": "^4.1.0",
107
- "@rollup/plugin-node-resolve": "^13.0.6",
108
- "@rollup/plugin-strip": "^2.1.0",
109
- "@rollup/plugin-typescript": "^8.3.0",
110
72
  "@types/lodash.isequal": "^4.5.5",
111
- "@types/lodash.isplainobject": "^4.0.6",
112
- "@types/node": "^16.11.6",
113
- "@types/tap": "^15.0.5",
114
- "@typescript-eslint/eslint-plugin": "^5.3.0",
115
- "@typescript-eslint/parser": "^5.3.0",
116
- "core-js": "^3.19.1",
117
- "cross-env": "^7.0.3",
118
- "eslint": "^8.1.0",
119
- "lect": "^0.18.4",
120
- "rollup": "^2.59.0",
121
- "rollup-plugin-ascii": "^0.0.3",
122
- "rollup-plugin-banner": "^0.2.1",
123
- "rollup-plugin-cleanup": "^3.2.1",
124
- "rollup-plugin-dts": "^4.0.0",
125
- "rollup-plugin-terser": "^7.0.2",
126
- "tap": "^15.0.10",
127
- "tslib": "^2.3.1",
128
- "typescript": "^4.4.4"
129
- },
130
- "engines": {
131
- "node": ">=12"
73
+ "@types/lodash.isplainobject": "^4.0.6"
132
74
  }
133
75
  }
package/types/index.d.ts CHANGED
File without changes
package/examples/api.json DELETED
@@ -1 +0,0 @@
1
- {"_quickTake.js":{"title":"Quick Take","content":"import &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; allEq &#x7D; from \"object-all-values-equal-to\";\n\n// are all values equal to null:\nassert.equal(allEq(&#x7B; a: null, c: null &#x7D;, null), true);\n// yes\n\n// are all values equal to \"false\":\nassert.equal(allEq(&#x7B; a: false, c: \"zzz\" &#x7D;, false), false);\n// no\n\n// are all values equal to \"false\"?\nassert.equal(\n allEq(\n &#x7B;\n a: &#x7B;\n b: false,\n c: [\n &#x7B;\n d: false,\n e: false,\n &#x7D;,\n &#x7B;\n g: false,\n &#x7D;,\n ],\n &#x7D;,\n c: false,\n &#x7D;,\n false // reference value to check\n ),\n true // answer is, yes\n);"}}