ast-is-empty 4.0.30 → 4.1.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 CHANGED
@@ -3,6 +3,12 @@
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.1.0 (2025-10-15)
7
+
8
+ ### Features
9
+
10
+ - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
11
+
6
12
  ## 4.0.10 (2023-05-13)
7
13
 
8
14
  ### Bug Fixes
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name ast-is-empty
3
3
  * @fileoverview Find out, is nested array/object/string/AST tree is empty
4
- * @version 4.0.30
4
+ * @version 4.1.3
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-is-empty/}
8
8
  */
9
9
 
10
- import{isPlainObject as o}from"codsen-utils";var n="4.0.30";var m=n;function i(e){let t,r,s=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(t=0,r=e.length;t<r;t++){if(s=i(e[t]),s===null)return null;if(!s)return!1}}else if(o(e)){if(Object.keys(e).length===0)return!0;for(t=0,r=Object.keys(e).length;t<r;t++){if(s=i(e[Object.keys(e)[t]]),s===null)return null;if(!s)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return s}export{i as isEmpty,m as version};
10
+ import{isPlainObject as o}from"codsen-utils";var n="4.1.3";var m=n;function i(e){let t,r,s=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(t=0,r=e.length;t<r;t++){if(s=i(e[t]),s===null)return null;if(!s)return!1}}else if(o(e)){if(Object.keys(e).length===0)return!0;for(t=0,r=Object.keys(e).length;t<r;t++){if(s=i(e[Object.keys(e)[t]]),s===null)return null;if(!s)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return s}export{i as isEmpty,m as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name ast-is-empty
3
3
  * @fileoverview Find out, is nested array/object/string/AST tree is empty
4
- * @version 4.0.30
4
+ * @version 4.1.3
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-is-empty/}
8
8
  */
9
9
 
10
- "use strict";var astIsEmpty=(()=>{var v=Object.create;var b=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var E=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),$=(e,n)=>{for(var o in n)b(e,o,{get:n[o],enumerable:!0})},A=(e,n,o,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of S(n))!D.call(e,l)&&l!==o&&b(e,l,{get:()=>n[l],enumerable:!(u=C(n,l))||u.enumerable});return e};var M=(e,n,o)=>(o=e!=null?v(B(e)):{},A(n||!e||!e.__esModule?b(o,"default",{value:e,enumerable:!0}):o,e)),F=e=>A(b({},"__esModule",{value:!0}),e);var w=E((I,j)=>{"use strict";j.exports=L;function m(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function L(e){if(e=e||{},e.circles)return P(e);let n=new Map;if(n.set(Date,s=>new Date(s)),n.set(Map,(s,c)=>new Map(u(Array.from(s),c))),n.set(Set,(s,c)=>new Set(u(Array.from(s),c))),e.constructorHandlers)for(let s of e.constructorHandlers)n.set(s[0],s[1]);let o=null;return e.proto?p:l;function u(s,c){let r=Object.keys(s),t=new Array(r.length);for(let a=0;a<r.length;a++){let i=r[a],f=s[i];typeof f!="object"||f===null?t[i]=f:f.constructor!==Object&&(o=n.get(f.constructor))?t[i]=o(f,c):ArrayBuffer.isView(f)?t[i]=m(f):t[i]=c(f)}return t}function l(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return u(s,l);if(s.constructor!==Object&&(o=n.get(s.constructor)))return o(s,l);let c={};for(let r in s){if(Object.hasOwnProperty.call(s,r)===!1)continue;let t=s[r];typeof t!="object"||t===null?c[r]=t:t.constructor!==Object&&(o=n.get(t.constructor))?c[r]=o(t,l):ArrayBuffer.isView(t)?c[r]=m(t):c[r]=l(t)}return c}function p(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return u(s,p);if(s.constructor!==Object&&(o=n.get(s.constructor)))return o(s,p);let c={};for(let r in s){let t=s[r];typeof t!="object"||t===null?c[r]=t:t.constructor!==Object&&(o=n.get(t.constructor))?c[r]=o(t,p):ArrayBuffer.isView(t)?c[r]=m(t):c[r]=p(t)}return c}}function P(e){let n=[],o=[],u=new Map;if(u.set(Date,r=>new Date(r)),u.set(Map,(r,t)=>new Map(p(Array.from(r),t))),u.set(Set,(r,t)=>new Set(p(Array.from(r),t))),e.constructorHandlers)for(let r of e.constructorHandlers)u.set(r[0],r[1]);let l=null;return e.proto?c:s;function p(r,t){let a=Object.keys(r),i=new Array(a.length);for(let f=0;f<a.length;f++){let y=a[f],d=r[y];if(typeof d!="object"||d===null)i[y]=d;else if(d.constructor!==Object&&(l=u.get(d.constructor)))i[y]=l(d,t);else if(ArrayBuffer.isView(d))i[y]=m(d);else{let h=n.indexOf(d);h!==-1?i[y]=o[h]:i[y]=t(d)}}return i}function s(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return p(r,s);if(r.constructor!==Object&&(l=u.get(r.constructor)))return l(r,s);let t={};n.push(r),o.push(t);for(let a in r){if(Object.hasOwnProperty.call(r,a)===!1)continue;let i=r[a];if(typeof i!="object"||i===null)t[a]=i;else if(i.constructor!==Object&&(l=u.get(i.constructor)))t[a]=l(i,s);else if(ArrayBuffer.isView(i))t[a]=m(i);else{let f=n.indexOf(i);f!==-1?t[a]=o[f]:t[a]=s(i)}}return n.pop(),o.pop(),t}function c(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return p(r,c);if(r.constructor!==Object&&(l=u.get(r.constructor)))return l(r,c);let t={};n.push(r),o.push(t);for(let a in r){let i=r[a];if(typeof i!="object"||i===null)t[a]=i;else if(i.constructor!==Object&&(l=u.get(i.constructor)))t[a]=l(i,c);else if(ArrayBuffer.isView(i))t[a]=m(i);else{let f=n.indexOf(i);f!==-1?t[a]=o[f]:t[a]=c(i)}}return n.pop(),o.pop(),t}}});var T={};$(T,{isEmpty:()=>g,version:()=>N});var O=M(w(),1);var V=(0,O.default)();function x(e){if(e==null||typeof e!="object")return!1;let n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}var k="4.0.30";var N=k;function g(e){let n,o,u=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(n=0,o=e.length;n<o;n++){if(u=g(e[n]),u===null)return null;if(!u)return!1}}else if(x(e)){if(Object.keys(e).length===0)return!0;for(n=0,o=Object.keys(e).length;n<o;n++){if(u=g(e[Object.keys(e)[n]]),u===null)return null;if(!u)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return u}return F(T);})();
10
+ "use strict";var astIsEmpty=(()=>{var v=Object.create;var b=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var E=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),$=(e,n)=>{for(var o in n)b(e,o,{get:n[o],enumerable:!0})},A=(e,n,o,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of S(n))!D.call(e,l)&&l!==o&&b(e,l,{get:()=>n[l],enumerable:!(u=C(n,l))||u.enumerable});return e};var M=(e,n,o)=>(o=e!=null?v(B(e)):{},A(n||!e||!e.__esModule?b(o,"default",{value:e,enumerable:!0}):o,e)),F=e=>A(b({},"__esModule",{value:!0}),e);var w=E((I,j)=>{"use strict";j.exports=L;function m(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function L(e){if(e=e||{},e.circles)return P(e);let n=new Map;if(n.set(Date,s=>new Date(s)),n.set(Map,(s,c)=>new Map(u(Array.from(s),c))),n.set(Set,(s,c)=>new Set(u(Array.from(s),c))),e.constructorHandlers)for(let s of e.constructorHandlers)n.set(s[0],s[1]);let o=null;return e.proto?p:l;function u(s,c){let r=Object.keys(s),t=new Array(r.length);for(let a=0;a<r.length;a++){let i=r[a],f=s[i];typeof f!="object"||f===null?t[i]=f:f.constructor!==Object&&(o=n.get(f.constructor))?t[i]=o(f,c):ArrayBuffer.isView(f)?t[i]=m(f):t[i]=c(f)}return t}function l(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return u(s,l);if(s.constructor!==Object&&(o=n.get(s.constructor)))return o(s,l);let c={};for(let r in s){if(Object.hasOwnProperty.call(s,r)===!1)continue;let t=s[r];typeof t!="object"||t===null?c[r]=t:t.constructor!==Object&&(o=n.get(t.constructor))?c[r]=o(t,l):ArrayBuffer.isView(t)?c[r]=m(t):c[r]=l(t)}return c}function p(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return u(s,p);if(s.constructor!==Object&&(o=n.get(s.constructor)))return o(s,p);let c={};for(let r in s){let t=s[r];typeof t!="object"||t===null?c[r]=t:t.constructor!==Object&&(o=n.get(t.constructor))?c[r]=o(t,p):ArrayBuffer.isView(t)?c[r]=m(t):c[r]=p(t)}return c}}function P(e){let n=[],o=[],u=new Map;if(u.set(Date,r=>new Date(r)),u.set(Map,(r,t)=>new Map(p(Array.from(r),t))),u.set(Set,(r,t)=>new Set(p(Array.from(r),t))),e.constructorHandlers)for(let r of e.constructorHandlers)u.set(r[0],r[1]);let l=null;return e.proto?c:s;function p(r,t){let a=Object.keys(r),i=new Array(a.length);for(let f=0;f<a.length;f++){let y=a[f],d=r[y];if(typeof d!="object"||d===null)i[y]=d;else if(d.constructor!==Object&&(l=u.get(d.constructor)))i[y]=l(d,t);else if(ArrayBuffer.isView(d))i[y]=m(d);else{let h=n.indexOf(d);h!==-1?i[y]=o[h]:i[y]=t(d)}}return i}function s(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return p(r,s);if(r.constructor!==Object&&(l=u.get(r.constructor)))return l(r,s);let t={};n.push(r),o.push(t);for(let a in r){if(Object.hasOwnProperty.call(r,a)===!1)continue;let i=r[a];if(typeof i!="object"||i===null)t[a]=i;else if(i.constructor!==Object&&(l=u.get(i.constructor)))t[a]=l(i,s);else if(ArrayBuffer.isView(i))t[a]=m(i);else{let f=n.indexOf(i);f!==-1?t[a]=o[f]:t[a]=s(i)}}return n.pop(),o.pop(),t}function c(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return p(r,c);if(r.constructor!==Object&&(l=u.get(r.constructor)))return l(r,c);let t={};n.push(r),o.push(t);for(let a in r){let i=r[a];if(typeof i!="object"||i===null)t[a]=i;else if(i.constructor!==Object&&(l=u.get(i.constructor)))t[a]=l(i,c);else if(ArrayBuffer.isView(i))t[a]=m(i);else{let f=n.indexOf(i);f!==-1?t[a]=o[f]:t[a]=c(i)}}return n.pop(),o.pop(),t}}});var T={};$(T,{isEmpty:()=>g,version:()=>N});var O=M(w(),1);var V=(0,O.default)();function x(e){if(e==null||typeof e!="object")return!1;let n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}var k="4.1.3";var N=k;function g(e){let n,o,u=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(n=0,o=e.length;n<o;n++){if(u=g(e[n]),u===null)return null;if(!u)return!1}}else if(x(e)){if(Object.keys(e).length===0)return!0;for(n=0,o=Object.keys(e).length;n<o;n++){if(u=g(e[Object.keys(e)[n]]),u===null)return null;if(!u)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return u}return F(T);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.6.19
14
+ * @version 1.7.3
15
15
  * @author Roy Revelt
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": "ast-is-empty",
3
- "version": "4.0.30",
3
+ "version": "4.1.3",
4
4
  "description": "Find out, is nested array/object/string/AST tree is empty",
5
5
  "keywords": [
6
6
  "array",
@@ -81,7 +81,7 @@
81
81
  }
82
82
  },
83
83
  "dependencies": {
84
- "codsen-utils": "^1.6.19"
84
+ "codsen-utils": "^1.7.3"
85
85
  },
86
86
  "publishConfig": {
87
87
  "registry": "https://registry.npmjs.org/"
package/.eslintcache DELETED
@@ -1 +0,0 @@
1
- [{"/home/runner/work/codsen/codsen/packages/ast-is-empty/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/ast-is-empty/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/ast-is-empty/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/ast-is-empty/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/ast-is-empty/test/test.js":"5"},{"size":402,"mtime":1760280945881,"results":"6","hashOfConfig":"7"},{"size":330,"mtime":1760280945881,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760280945881,"results":"10","hashOfConfig":"7"},{"size":1149,"mtime":1760280945881,"results":"11","hashOfConfig":"9"},{"size":2303,"mtime":1760280945882,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1f1u168",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"91l1rm",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ns3qdb","/home/runner/work/codsen/codsen/packages/ast-is-empty/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-is-empty/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-is-empty/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/ast-is-empty/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/ast-is-empty/test/test.js",[],["29","30","31","32","33","34"],{"ruleId":"35","severity":2,"message":"36","line":3,"column":17,"nodeType":null,"messageId":"37","endLine":3,"endColumn":19,"suppressions":"38"},{"ruleId":"35","severity":2,"message":"39","line":3,"column":21,"nodeType":null,"messageId":"37","endLine":3,"endColumn":23,"suppressions":"40"},{"ruleId":"35","severity":2,"message":"41","line":3,"column":25,"nodeType":null,"messageId":"37","endLine":3,"endColumn":31,"suppressions":"42"},{"ruleId":"35","severity":2,"message":"43","line":3,"column":33,"nodeType":null,"messageId":"37","endLine":3,"endColumn":37,"suppressions":"44"},{"ruleId":"35","severity":2,"message":"45","line":3,"column":39,"nodeType":null,"messageId":"37","endLine":3,"endColumn":42,"suppressions":"46"},{"ruleId":"35","severity":2,"message":"47","line":3,"column":44,"nodeType":null,"messageId":"37","endLine":3,"endColumn":49,"suppressions":"48"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["49"],"'ok' is defined but never used.",["50"],"'throws' is defined but never used.",["51"],"'type' is defined but never used.",["52"],"'not' is defined but never used.",["53"],"'match' is defined but never used.",["54"],{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},"directive",""]