util-nonempty 4.0.5 → 4.0.6
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/dist/util-nonempty.esm.js +12 -12
- package/dist/util-nonempty.umd.js +2 -2
- package/package.json +19 -23
|
@@ -1,7 +1,7 @@
|
|
|
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.
|
|
4
|
+
* @version 4.0.6
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/util-nonempty/}
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
import isPlainObject from 'lodash.isplainobject';
|
|
11
11
|
|
|
12
|
-
var version$1 = "4.0.
|
|
12
|
+
var version$1 = "4.0.6";
|
|
13
13
|
|
|
14
14
|
const version = version$1;
|
|
15
15
|
function nonEmpty(input) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
26
|
}
|
|
27
27
|
|
|
28
28
|
export { nonEmpty, 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.
|
|
4
|
+
* @version 4.0.6
|
|
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.
|
|
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.6",Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "util-nonempty",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"description": "Is the input (plain object, array, string or whatever) not empty?",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -31,13 +31,12 @@
|
|
|
31
31
|
"types": "types/index.d.ts",
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "rollup -c",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
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",
|
|
36
37
|
"clean_types": "../../scripts/cleanTypes.js",
|
|
37
38
|
"dev": "rollup -c --dev",
|
|
38
39
|
"devunittest": "npm run dev && tap --only -R 'base'",
|
|
39
|
-
"esbuild": "node '../../scripts/esbuild.js'",
|
|
40
|
-
"esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
41
40
|
"format": "npm run lect && npm run prettier && npm run lint",
|
|
42
41
|
"lect": "lect",
|
|
43
42
|
"lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
|
|
@@ -46,17 +45,14 @@
|
|
|
46
45
|
"republish": "npm publish || :",
|
|
47
46
|
"tap": "tap",
|
|
48
47
|
"pretest": "npm run build",
|
|
49
|
-
"test": "npm run
|
|
48
|
+
"test": "npm run test:ci && npm run perf",
|
|
49
|
+
"test:ci": "npm run unittest && npm run test:examples && npm run format",
|
|
50
50
|
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
51
51
|
"tsc": "tsc",
|
|
52
|
-
"unittest": "tap --no-only --
|
|
52
|
+
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
|
|
53
53
|
},
|
|
54
54
|
"tap": {
|
|
55
55
|
"check-coverage": false,
|
|
56
|
-
"coverage-report": [
|
|
57
|
-
"json-summary",
|
|
58
|
-
"text"
|
|
59
|
-
],
|
|
60
56
|
"node-arg": [
|
|
61
57
|
"--no-warnings",
|
|
62
58
|
"--experimental-loader",
|
|
@@ -78,7 +74,7 @@
|
|
|
78
74
|
}
|
|
79
75
|
},
|
|
80
76
|
"dependencies": {
|
|
81
|
-
"@babel/runtime": "^7.16.
|
|
77
|
+
"@babel/runtime": "^7.16.3",
|
|
82
78
|
"lodash.isplainobject": "^4.0.6"
|
|
83
79
|
},
|
|
84
80
|
"devDependencies": {
|
|
@@ -90,8 +86,8 @@
|
|
|
90
86
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
91
87
|
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
92
88
|
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
93
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
94
|
-
"@babel/preset-env": "^7.16.
|
|
89
|
+
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
90
|
+
"@babel/preset-env": "^7.16.4",
|
|
95
91
|
"@babel/preset-typescript": "^7.16.0",
|
|
96
92
|
"@babel/register": "^7.16.0",
|
|
97
93
|
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
@@ -102,25 +98,25 @@
|
|
|
102
98
|
"@rollup/plugin-strip": "^2.1.0",
|
|
103
99
|
"@rollup/plugin-typescript": "^8.3.0",
|
|
104
100
|
"@types/lodash.isplainobject": "^4.0.6",
|
|
105
|
-
"@types/node": "^16.11.
|
|
101
|
+
"@types/node": "^16.11.9",
|
|
106
102
|
"@types/tap": "^15.0.5",
|
|
107
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
108
|
-
"@typescript-eslint/parser": "^5.
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
104
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
109
105
|
"core-js": "^3.19.1",
|
|
110
106
|
"cross-env": "^7.0.3",
|
|
111
|
-
"eslint": "^8.
|
|
112
|
-
"lect": "^0.18.
|
|
113
|
-
"rollup": "^2.
|
|
107
|
+
"eslint": "^8.3.0",
|
|
108
|
+
"lect": "^0.18.6",
|
|
109
|
+
"rollup": "^2.60.0",
|
|
114
110
|
"rollup-plugin-ascii": "^0.0.3",
|
|
115
111
|
"rollup-plugin-banner": "^0.2.1",
|
|
116
112
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
117
113
|
"rollup-plugin-dts": "^4.0.1",
|
|
118
114
|
"rollup-plugin-terser": "^7.0.2",
|
|
119
|
-
"tap": "^15.
|
|
115
|
+
"tap": "^15.1.2",
|
|
120
116
|
"tslib": "^2.3.1",
|
|
121
|
-
"typescript": "^4.
|
|
117
|
+
"typescript": "^4.5.2"
|
|
122
118
|
},
|
|
123
119
|
"engines": {
|
|
124
|
-
"node": ">=
|
|
120
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
125
121
|
}
|
|
126
122
|
}
|