ast-is-empty 3.0.10 → 3.0.11

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2021 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2022 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
@@ -26,14 +26,12 @@
26
26
 
27
27
  ## Install
28
28
 
29
- This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
29
+ The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `2.1.0`.
30
30
 
31
31
  ```bash
32
32
  npm i ast-is-empty
33
33
  ```
34
34
 
35
- If you need a legacy version which works with `require`, use version 2.1.0
36
-
37
35
  ## Quick Take
38
36
 
39
37
  ```js
@@ -85,8 +83,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
85
83
 
86
84
  MIT License
87
85
 
88
- Copyright (c) 2010-2021 Roy Revelt and other contributors
89
-
86
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
90
87
 
91
88
  <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,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 3.0.10
4
+ * @version 3.0.11
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-is-empty/}
8
8
  */
9
9
 
10
- import i from"lodash.isplainobject";var n="3.0.10";var d=n;function l(e){let s,r,t=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(s=0,r=e.length;s<r;s++){if(t=l(e[s]),t===null)return null;if(!t)return!1}}else if(i(e)){if(Object.keys(e).length===0)return!0;for(s=0,r=Object.keys(e).length;s<r;s++){if(t=l(e[Object.keys(e)[s]]),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{l as isEmpty,d as version};
10
+ import o from"lodash.isplainobject";var n="3.0.11";var d=n;function l(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=l(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=l(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{l as isEmpty,d as version};
@@ -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 3.0.10
4
+ * @version 3.0.11
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-is-empty/}
8
8
  */
9
9
 
10
- var astIsEmpty=(()=>{var b=Object.create;var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var c=e=>o(e,"__esModule",{value:!0});var O=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),v=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})},l=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of j(t))!h.call(e,n)&&(r||n!=="default")&&o(e,n,{get:()=>t[n],enumerable:!(s=m(t,n))||s.enumerable});return e},x=(e,t)=>l(c(o(e!=null?b(g(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),k=(e=>(t,r)=>e&&e.get(t)||(r=l(c({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var y=O((V,u)=>{var P="[object Object]";function S(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function T(e,t){return function(r){return e(t(r))}}var A=Function.prototype,a=Object.prototype,p=A.toString,w=a.hasOwnProperty,C=p.call(Object),D=a.toString,E=T(Object.getPrototypeOf,Object);function F(e){return!!e&&typeof e=="object"}function R(e){if(!F(e)||D.call(e)!=P||S(e))return!1;var t=E(e);if(t===null)return!0;var r=w.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&p.call(r)==C}u.exports=R});var L={};v(L,{isEmpty:()=>i,version:()=>I});var d=x(y(),1);var f="3.0.10";var I=f;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((0,d.default)(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}return k(L);})();
10
+ var astIsEmpty=(()=>{var m=Object.create;var o=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var c=e=>o(e,"__esModule",{value:!0});var O=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),v=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})},l=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of j(t))!h.call(e,s)&&(r||s!=="default")&&o(e,s,{get:()=>t[s],enumerable:!(n=b(t,s))||n.enumerable});return e},x=(e,t)=>l(c(o(e!=null?m(g(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),k=(e=>(t,r)=>e&&e.get(t)||(r=l(c({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var y=O((V,u)=>{var P="[object Object]";function S(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function w(e,t){return function(r){return e(t(r))}}var T=Function.prototype,a=Object.prototype,p=T.toString,A=a.hasOwnProperty,C=p.call(Object),D=a.toString,E=w(Object.getPrototypeOf,Object);function F(e){return!!e&&typeof e=="object"}function R(e){if(!F(e)||D.call(e)!=P||S(e))return!1;var t=E(e);if(t===null)return!0;var r=A.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&p.call(r)==C}u.exports=R});var L={};v(L,{isEmpty:()=>i,version:()=>I});var f=x(y(),1);var d="3.0.11";var I=d;function i(e){let t,r,n=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(t=0,r=e.length;t<r;t++){if(n=i(e[t]),n===null)return null;if(!n)return!1}}else if((0,f.default)(e)){if(Object.keys(e).length===0)return!0;for(t=0,r=Object.keys(e).length;t<r;t++){if(n=i(e[Object.keys(e)[t]]),n===null)return null;if(!n)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return n}return k(L);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-is-empty",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
4
4
  "description": "Find out, is nested array/object/string/AST tree is empty",
5
5
  "keywords": [
6
6
  "array",
@@ -46,13 +46,15 @@
46
46
  "scripts": {
47
47
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
48
48
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
49
- "dts": "rollup -c",
49
+ "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
50
50
  "examples": "node '../../ops/scripts/run-examples.js'",
51
51
  "lect": "node '../../ops/lect/lect.js'",
52
52
  "letspublish": "yarn publish || :",
53
53
  "lint": "eslint . --fix",
54
54
  "perf": "node perf/check.js",
55
55
  "prepare": "echo 'ready'",
56
+ "prettier": "prettier",
57
+ "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
56
58
  "pretest": "yarn run lect && yarn run build",
57
59
  "test": "c8 yarn run unit && yarn run examples && yarn run lint",
58
60
  "unit": "uvu test"