ast-is-empty 3.1.3 → 3.1.5

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
@@ -17,7 +17,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
17
17
 
18
18
  ### BREAKING CHANGES
19
19
 
20
- - programs now are in ES Modules and won't work with Common JS require()
20
+ - programs now are in ES Modules and won't work with Common JS `require()`
21
21
 
22
22
  ## 2.1.0 (2021-05-24)
23
23
 
@@ -35,7 +35,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
35
35
 
36
36
  ### Fixed
37
37
 
38
- - add testStats to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29))
38
+ - add `testStats` to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29))
39
39
 
40
40
  ## 2.0.0 (2021-01-23)
41
41
 
@@ -49,7 +49,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
49
49
 
50
50
  ## 1.11.0 (2020-11-28)
51
51
 
52
- Accidental version bump during migration to sourcehut. Sorry about that.
52
+ Accidental version bump during migration to SourceHut. Sorry about that.
53
53
 
54
54
  ## 1.10.0 (2020-02-01)
55
55
 
package/README.md CHANGED
@@ -1,28 +1,25 @@
1
- # ast-is-empty
1
+ <h1 align="center">ast-is-empty</h1>
2
2
 
3
- > Find out, is nested array/object/string/AST tree is empty
3
+ <p align="center">Find out, is nested array/object/string/AST tree is empty</p>
4
4
 
5
- <div class="package-badges">
6
- <a href="https://www.npmjs.com/package/ast-is-empty" rel="nofollow noreferrer noopener">
7
- <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
8
- </a>
5
+ <p align="center">
9
6
  <a href="https://codsen.com/os/ast-is-empty" rel="nofollow noreferrer noopener">
10
7
  <img src="https://img.shields.io/badge/-codsen-blue?style=flat-square" alt="page on codsen.com">
11
8
  </a>
9
+ <a href="https://www.npmjs.com/package/ast-is-empty" rel="nofollow noreferrer noopener">
10
+ <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
11
+ </a>
12
12
  <a href="https://github.com/codsen/codsen/tree/main/packages/ast-is-empty" rel="nofollow noreferrer noopener">
13
13
  <img src="https://img.shields.io/badge/-github-blue?style=flat-square" alt="page on github">
14
14
  </a>
15
15
  <a href="https://npmcharts.com/compare/ast-is-empty?interval=30" rel="nofollow noreferrer noopener" target="_blank">
16
16
  <img src="https://img.shields.io/npm/dm/ast-is-empty.svg?style=flat-square" alt="Downloads per month">
17
17
  </a>
18
- <a href="https://prettier.io" rel="nofollow noreferrer noopener" target="_blank">
19
- <img src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg?style=flat-square" alt="Code style: prettier">
20
- </a>
21
- <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT License">
22
- <a href="https://liberamanifesto.com" rel="nofollow noreferrer noopener" target="_blank">
23
- <img src="https://img.shields.io/badge/libera-manifesto-lightgrey.svg?style=flat-square" alt="libera manifesto">
18
+ <a href="https://codsen.com/os/ast-is-empty/changelog" rel="nofollow noreferrer noopener">
19
+ <img src="https://img.shields.io/badge/changelog-here-brightgreen?style=flat-square" alt="changelog">
24
20
  </a>
25
- </div>
21
+ <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
22
+ </p>
26
23
 
27
24
  ## Install
28
25
 
@@ -81,8 +78,8 @@ To report bugs or request features or assistance, [raise an issue](https://githu
81
78
 
82
79
  ## Licence
83
80
 
84
- MIT License
81
+ MIT License.
85
82
 
86
- Copyright (c) 2010-2022 Roy Revelt and other contributors
83
+ Copyright © 2010-2022 Roy Revelt and other contributors.
87
84
 
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">
85
+ <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 3.1.3
4
+ * @version 3.1.5
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 o from"lodash.isplainobject";var n="3.1.3";var d=n;function i(e){let t,s,r=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(t=0,s=e.length;t<s;t++){if(r=i(e[t]),r===null)return null;if(!r)return!1}}else if(o(e)){if(Object.keys(e).length===0)return!0;for(t=0,s=Object.keys(e).length;t<s;t++){if(r=i(e[Object.keys(e)[t]]),r===null)return null;if(!r)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return r}export{i as isEmpty,d as version};
10
+ import o from"lodash.isplainobject";var n="3.1.5";var d=n;function i(e){let t,s,r=!0;if(Array.isArray(e)){if(e.length===0)return!0;for(t=0,s=e.length;t<s;t++){if(r=i(e[t]),r===null)return null;if(!r)return!1}}else if(o(e)){if(Object.keys(e).length===0)return!0;for(t=0,s=Object.keys(e).length;t<s;t++){if(r=i(e[Object.keys(e)[t]]),r===null)return null;if(!r)return!1}}else if(typeof e=="string"){if(e.length!==0)return!1}else return null;return r}export{i 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.1.3
4
+ * @version 3.1.5
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
- "use strict";var astIsEmpty=(()=>{var f=Object.create;var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=(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})},c=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of b(t))!g.call(e,s)&&s!==r&&o(e,s,{get:()=>t[s],enumerable:!(n=m(t,s))||n.enumerable});return e};var O=(e,t,r)=>(r=e!=null?f(j(e)):{},c(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e)),x=e=>c(o({},"__esModule",{value:!0}),e);var u=h((L,p)=>{var k="[object Object]";function P(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function S(e,t){return function(r){return e(t(r))}}var w=Function.prototype,l=Object.prototype,a=w.toString,A=l.hasOwnProperty,T=a.call(Object),E=l.toString,D=S(Object.getPrototypeOf,Object);function R(e){return!!e&&typeof e=="object"}function C(e){if(!R(e)||E.call(e)!=k||P(e))return!1;var t=D(e);if(t===null)return!0;var r=A.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&a.call(r)==T}p.exports=C});var H={};v(H,{isEmpty:()=>i,version:()=>M});var d=O(u(),1);var y="3.1.3";var M=y;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,d.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 x(H);})();
10
+ "use strict";var astIsEmpty=(()=>{var f=Object.create;var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=(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})},c=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of b(t))!g.call(e,n)&&n!==r&&o(e,n,{get:()=>t[n],enumerable:!(s=m(t,n))||s.enumerable});return e};var x=(e,t,r)=>(r=e!=null?f(j(e)):{},c(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e)),O=e=>c(o({},"__esModule",{value:!0}),e);var u=h((L,p)=>{var k="[object Object]";function P(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function S(e,t){return function(r){return e(t(r))}}var w=Function.prototype,l=Object.prototype,a=w.toString,A=l.hasOwnProperty,T=a.call(Object),E=l.toString,D=S(Object.getPrototypeOf,Object);function R(e){return!!e&&typeof e=="object"}function C(e){if(!R(e)||E.call(e)!=k||P(e))return!1;var t=D(e);if(t===null)return!0;var r=A.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&a.call(r)==T}p.exports=C});var H={};v(H,{isEmpty:()=>i,version:()=>M});var d=x(u(),1);var y="3.1.5";var M=y;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 O(H);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-is-empty",
3
- "version": "3.1.3",
3
+ "version": "3.1.5",
4
4
  "description": "Find out, is nested array/object/string/AST tree is empty",
5
5
  "keywords": [
6
6
  "array",
@@ -52,7 +52,7 @@
52
52
  "examples": "node '../../ops/scripts/run-examples.js'",
53
53
  "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
54
54
  "letspublish": "yarn publish || :",
55
- "lint": "eslint . --fix",
55
+ "lint": "eslint . --ext .js --ext .ts --fix",
56
56
  "perf": "node perf/check.js",
57
57
  "prepare": "echo 'ready'",
58
58
  "prettier": "prettier",
@@ -1,36 +0,0 @@
1
- // Quick Take
2
-
3
- import { strict as assert } from "assert";
4
-
5
- import { isEmpty } from "../dist/ast-is-empty.esm.js";
6
-
7
- assert.equal(
8
- isEmpty({
9
- a: "",
10
- }),
11
- true
12
- );
13
-
14
- assert.equal(
15
- isEmpty({
16
- a: [""],
17
- b: {
18
- c: {
19
- d: "",
20
- },
21
- },
22
- }),
23
- true
24
- );
25
-
26
- assert.equal(
27
- isEmpty([
28
- {
29
- a: [""],
30
- b: { c: { d: "" } },
31
- },
32
- "",
33
- ["", "", ""],
34
- ]),
35
- true
36
- );