ast-is-empty 4.1.0 → 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,11 +3,22 @@
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)
6
+ ## 4.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
11
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
7
12
 
8
13
  ### Features
9
14
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
15
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
16
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
17
+
18
+ ### Reverts
19
+
20
+ - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
21
+ - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
11
22
 
12
23
  ## 4.0.10 (2023-05-13)
13
24
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2026 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
@@ -32,7 +32,7 @@ npm i ast-is-empty
32
32
  ## Quick Take
33
33
 
34
34
  ```js
35
- import { strict as assert } from "assert";
35
+ import { strict as assert } from "node:assert";
36
36
 
37
37
  import { isEmpty } from "ast-is-empty";
38
38
 
@@ -42,35 +42,12 @@ assert.equal(
42
42
  }),
43
43
  true,
44
44
  );
45
-
46
- assert.equal(
47
- isEmpty({
48
- a: [""],
49
- b: {
50
- c: {
51
- d: "",
52
- },
53
- },
54
- }),
55
- true,
56
- );
57
-
58
- assert.equal(
59
- isEmpty([
60
- {
61
- a: [""],
62
- b: { c: { d: "" } },
63
- },
64
- "",
65
- ["", "", ""],
66
- ]),
67
- true,
68
- );
69
45
  ```
70
46
 
47
+
71
48
  ## Documentation
72
49
 
73
- Please [visit codsen.com](https://codsen.com/os/ast-is-empty/) for a full description of the API.
50
+ Please [visit codsen.com](https://codsen.com/os/ast-is-empty/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/ast-is-empty/CHANGELOG.md).
74
51
 
75
52
  ## Contributing
76
53
 
@@ -80,6 +57,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
80
57
 
81
58
  MIT License
82
59
 
83
- Copyright © 2010-2025 Roy Revelt and other contributors
60
+ Copyright © 2010-2026 Roy Revelt and other contributors
84
61
 
85
62
  <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 ast-is-empty
3
3
  * @fileoverview Find out, is nested array/object/string/AST tree is empty
4
- * @version 4.1.0
4
+ * @version 4.2.0
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.1.0";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 l}from"codsen-utils";var r="4.2.0";var m=r;function n(e){let t=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(let s of e){if(t=n(s),t===null)return null;if(!t)return!1}}else if(l(e)){let s=Object.keys(e);if(s.length===0)return!0;for(let o of s){if(t=n(e[o]),t===null)return null;if(!t)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return t}export{n 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.1.0
4
+ * @version 4.2.0
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.1.0";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 s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})},h=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!c.call(e,n)&&n!==r&&s(e,n,{get:()=>t[n],enumerable:!(i=a(t,n))||i.enumerable});return e};var d=e=>h(s({},"__esModule",{value:!0}),e);var y={};p(y,{isEmpty:()=>l,version:()=>m});var A=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);function o(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}var u="4.2.0";var m=u;function l(e){let t=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(let r of e){if(t=l(r),t===null)return null;if(!t)return!1}}else if(o(e)){let r=Object.keys(e);if(r.length===0)return!0;for(let i of r){if(t=l(e[i]),t===null)return null;if(!t)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return t}return d(y);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.7.0
14
+ * @version 1.8.0
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.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "Find out, is nested array/object/string/AST tree is empty",
5
5
  "keywords": [
6
6
  "array",
@@ -45,43 +45,45 @@
45
45
  },
46
46
  "types": "types/index.d.ts",
47
47
  "scripts": {
48
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
49
- "cjs-off": "exit 0",
50
- "cjs-on": "exit 0",
51
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
48
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
49
+ "coverage": "c8 uvu test",
50
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
52
51
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
53
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
52
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
54
53
  "examples": "node '../../ops/scripts/run-examples.js'",
55
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
56
- "letspublish": "npm publish --provenance || :",
57
- "lint": "eslint . --fix --concurrency=auto --cache",
54
+ "lect": "node '../../ops/lect/lect.js'",
55
+ "lect:check": "node '../../ops/lect/lect.js' --check",
56
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
57
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
58
58
  "perf": "node perf/check.js",
59
59
  "prep": "echo 'ready'",
60
- "prettier": "prettier",
61
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
62
- "pretest": "npm run lect && npm run build",
60
+ "prettier": "biome format",
61
+ "prettier:format": "biome format --write .",
62
+ "pretest": "npm run lect:check && npm run build",
63
63
  "test": "npm run devtest",
64
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
64
65
  "unit": "uvu test"
65
66
  },
66
- "engines": {
67
- "node": ">=14.18.0"
68
- },
69
67
  "c8": {
68
+ "all": true,
69
+ "branches": 100,
70
70
  "check-coverage": true,
71
- "exclude": [
72
- "**/test/**/*.*"
73
- ],
74
- "lines": 100
71
+ "exclude": ["**/test/**/*.*"],
72
+ "functions": 100,
73
+ "include": ["dist/*.esm.js"],
74
+ "lines": 100,
75
+ "statements": 100
75
76
  },
76
77
  "lect": {
77
78
  "licence": {
78
- "extras": [
79
- ""
80
- ]
79
+ "extras": [""]
81
80
  }
82
81
  },
83
82
  "dependencies": {
84
- "codsen-utils": "^1.7.0"
83
+ "codsen-utils": "^1.8.0"
84
+ },
85
+ "engines": {
86
+ "node": ">=18.20.8"
85
87
  },
86
88
  "publishConfig": {
87
89
  "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":1760566739071,"results":"6","hashOfConfig":"7"},{"size":330,"mtime":1760566739071,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760566739071,"results":"10","hashOfConfig":"7"},{"size":1149,"mtime":1760566739071,"results":"11","hashOfConfig":"9"},{"size":2303,"mtime":1760566739071,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"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},"nrihsz","/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",""]