util-nonempty 4.0.7 → 4.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/README.md CHANGED
@@ -38,6 +38,7 @@ If you need a legacy version which works with `require`, use version 3.1.0
38
38
 
39
39
  ```js
40
40
  import { strict as assert } from "assert";
41
+
41
42
  import { nonEmpty } from "util-nonempty";
42
43
 
43
44
  assert.equal(nonEmpty("z"), true);
@@ -58,7 +59,7 @@ assert.equal(nonEmpty(f), false);
58
59
 
59
60
  ## Documentation
60
61
 
61
- Please [visit codsen.com](https://codsen.com/os/util-nonempty/) for a full description of the API and examples.
62
+ Please [visit codsen.com](https://codsen.com/os/util-nonempty/) for a full description of the API.
62
63
 
63
64
  ## Contributing
64
65
 
@@ -70,4 +71,6 @@ MIT License
70
71
 
71
72
  Copyright (c) 2010-2021 Roy Revelt and other contributors
72
73
 
74
+
73
75
  <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">
76
+
@@ -1,28 +1,10 @@
1
1
  /**
2
2
  * @name util-nonempty
3
3
  * @fileoverview Is the input (plain object, array, string or whatever) not empty?
4
- * @version 4.0.7
4
+ * @version 4.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/util-nonempty/}
8
8
  */
9
9
 
10
- import isPlainObject from 'lodash.isplainobject';
11
-
12
- var version$1 = "4.0.7";
13
-
14
- const version = version$1;
15
- function nonEmpty(input) {
16
- if (input == null) {
17
- return false;
18
- }
19
- if (Array.isArray(input) || typeof input === "string") {
20
- return !!input.length;
21
- }
22
- if (isPlainObject(input)) {
23
- return !!Object.keys(input).length;
24
- }
25
- return typeof input === "number";
26
- }
27
-
28
- export { nonEmpty, version };
10
+ import n from"lodash.isplainobject";var t="4.0.10";var l=t;function p(e){return e==null?!1:Array.isArray(e)||typeof e=="string"?!!e.length:n(e)?!!Object.keys(e).length:typeof e=="number"}export{p as nonEmpty,l as version};
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name util-nonempty
3
3
  * @fileoverview Is the input (plain object, array, string or whatever) not empty?
4
- * @version 4.0.7
4
+ * @version 4.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/util-nonempty/}
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).utilNonempty={})}(this,(function(t){"use strict";var e,n,o=Object.prototype,r=Function.prototype.toString,c=o.hasOwnProperty,i=r.call(Object),f=o.toString,u=(e=Object.getPrototypeOf,n=Object,function(t){return e(n(t))});var l=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=f.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=u(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&r.call(n)==i};t.nonEmpty=function(t){return null!=t&&(Array.isArray(t)||"string"==typeof t?!!t.length:l(t)?!!Object.keys(t).length:"number"==typeof t)},t.version="4.0.7",Object.defineProperty(t,"__esModule",{value:!0})}));
10
+ var utilNonempty=(()=>{var f=Object.create;var o=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var c=t=>o(t,"__esModule",{value:!0});var h=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),v=(t,e)=>{for(var r in e)o(t,r,{get:e[r],enumerable:!0})},i=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of j(e))!g.call(t,n)&&(r||n!=="default")&&o(t,n,{get:()=>e[n],enumerable:!(s=b(e,n))||s.enumerable});return t},O=(t,e)=>i(c(o(t!=null?f(m(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),x=(t=>(e,r)=>t&&t.get(e)||(r=i(c({}),e,1),t&&t.set(e,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var u=h((V,a)=>{var P="[object Object]";function k(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}function S(t,e){return function(r){return t(e(r))}}var w=Function.prototype,p=Object.prototype,l=w.toString,T=p.hasOwnProperty,A=l.call(Object),C=p.toString,D=S(Object.getPrototypeOf,Object);function E(t){return!!t&&typeof t=="object"}function I(t){if(!E(t)||C.call(t)!=P||k(t))return!1;var e=D(t);if(e===null)return!0;var r=T.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&l.call(r)==A}a.exports=I});var L={};v(L,{nonEmpty:()=>H,version:()=>F});var d=O(u(),1);var y="4.0.10";var F=y;function H(t){return t==null?!1:Array.isArray(t)||typeof t=="string"?!!t.length:(0,d.default)(t)?!!Object.keys(t).length:typeof t=="number"}return x(L);})();
@@ -1,6 +1,7 @@
1
1
  // Quick Take
2
2
 
3
3
  import { strict as assert } from "assert";
4
+
4
5
  import { nonEmpty } from "../dist/util-nonempty.esm.js";
5
6
 
6
7
  assert.equal(nonEmpty("z"), true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "util-nonempty",
3
- "version": "4.0.7",
3
+ "version": "4.0.10",
4
4
  "description": "Is the input (plain object, array, string or whatever) not empty?",
5
5
  "keywords": [
6
6
  "array",
@@ -30,93 +30,40 @@
30
30
  },
31
31
  "types": "types/index.d.ts",
32
32
  "scripts": {
33
- "build": "rollup -c",
34
- "build:esbuild": "node '../../scripts/esbuild.js'",
35
- "build:esbuild:dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
36
- "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent",
37
- "clean_types": "../../scripts/cleanTypes.js",
38
- "dev": "rollup -c --dev",
39
- "devunittest": "npm run dev && tap --only -R 'base'",
40
- "format": "npm run lect && npm run prettier && npm run lint",
41
- "lect": "lect",
42
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
43
- "perf": "node perf/check",
44
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
45
- "republish": "npm publish || :",
46
- "tap": "tap",
47
- "pretest": "npm run build",
48
- "test": "npm run test:ci && npm run perf",
49
- "test:ci": "npm run unittest && npm run test:examples && npm run format",
50
- "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
51
- "tsc": "tsc",
52
- "unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
33
+ "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
34
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
35
+ "dts": "rollup -c",
36
+ "examples": "node '../../ops/scripts/run-examples.js'",
37
+ "lect": "node '../../ops/lect/lect.js'",
38
+ "letspublish": "yarn publish || :",
39
+ "lint": "eslint . --fix",
40
+ "perf": "node perf/check.js",
41
+ "prepare": "echo 'ready'",
42
+ "pretest": "yarn run lect && yarn run build",
43
+ "test": "c8 yarn run unit && yarn run examples && yarn run lint",
44
+ "unit": "uvu test"
53
45
  },
54
- "tap": {
55
- "check-coverage": false,
56
- "node-arg": [
57
- "--no-warnings",
58
- "--experimental-loader",
59
- "@istanbuljs/esm-loader-hook"
46
+ "engines": {
47
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
48
+ },
49
+ "c8": {
50
+ "check-coverage": true,
51
+ "exclude": [
52
+ "**/test/**/*.*"
60
53
  ],
61
- "timeout": 0
54
+ "lines": 100
62
55
  },
63
56
  "lect": {
64
57
  "licence": {
65
58
  "extras": [
66
59
  ""
67
60
  ]
68
- },
69
- "req": "{ nonEmpty }",
70
- "various": {
71
- "devDependencies": [
72
- "@types/lodash.isplainobject"
73
- ]
74
61
  }
75
62
  },
76
63
  "dependencies": {
77
- "@babel/runtime": "^7.16.3",
78
64
  "lodash.isplainobject": "^4.0.6"
79
65
  },
80
66
  "devDependencies": {
81
- "@babel/cli": "^7.16.0",
82
- "@babel/core": "^7.16.0",
83
- "@babel/node": "^7.16.0",
84
- "@babel/plugin-external-helpers": "^7.16.0",
85
- "@babel/plugin-proposal-class-properties": "^7.16.0",
86
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
87
- "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
88
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
89
- "@babel/plugin-transform-runtime": "^7.16.4",
90
- "@babel/preset-env": "^7.16.4",
91
- "@babel/preset-typescript": "^7.16.0",
92
- "@babel/register": "^7.16.0",
93
- "@istanbuljs/esm-loader-hook": "^0.1.2",
94
- "@rollup/plugin-babel": "^5.3.0",
95
- "@rollup/plugin-commonjs": "^21.0.1",
96
- "@rollup/plugin-json": "^4.1.0",
97
- "@rollup/plugin-node-resolve": "^13.0.6",
98
- "@rollup/plugin-strip": "^2.1.0",
99
- "@rollup/plugin-typescript": "^8.3.0",
100
- "@types/lodash.isplainobject": "^4.0.6",
101
- "@types/node": "^16.11.10",
102
- "@types/tap": "^15.0.5",
103
- "@typescript-eslint/eslint-plugin": "^5.5.0",
104
- "@typescript-eslint/parser": "^5.5.0",
105
- "core-js": "^3.19.2",
106
- "cross-env": "^7.0.3",
107
- "eslint": "^8.3.0",
108
- "lect": "^0.18.7",
109
- "rollup": "^2.60.1",
110
- "rollup-plugin-ascii": "^0.0.3",
111
- "rollup-plugin-banner": "^0.2.1",
112
- "rollup-plugin-cleanup": "^3.2.1",
113
- "rollup-plugin-dts": "^4.0.1",
114
- "rollup-plugin-terser": "^7.0.2",
115
- "tap": "^15.1.5",
116
- "tslib": "^2.3.1",
117
- "typescript": "^4.5.2"
118
- },
119
- "engines": {
120
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
67
+ "@types/lodash.isplainobject": "^4.0.6"
121
68
  }
122
69
  }
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; nonEmpty &#x7D; from \"util-nonempty\";\n\nassert.equal(nonEmpty(\"z\"), true);\nassert.equal(nonEmpty(\"\"), false);\nassert.equal(nonEmpty([\"a\"]), true);\nassert.equal(nonEmpty([123]), true);\nassert.equal(nonEmpty([[[[[[[[[[[]]]]]]]]]]]), true);\nassert.equal(nonEmpty(&#x7B; a: \"\" &#x7D;), true);\nassert.equal(nonEmpty(&#x7B; a: \"a\" &#x7D;), true);\nassert.equal(nonEmpty(&#x7B;&#x7D;), false);\n\nconst f = () => &#x7B;\n return \"z\";\n&#x7D;;\nassert.equal(nonEmpty(f), false);\n// (answer is instantly false if input is not array, plain object or string)"}}