util-nonempty 4.0.4 → 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/CHANGELOG.md CHANGED
@@ -3,26 +3,6 @@
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.0.3 (2021-11-02)
7
-
8
- ### Bug Fixes
9
-
10
- - bump TS and separate ESLint plugins away from this monorepo ([b1ebce1](https://github.com/codsen/codsen/commit/b1ebce1637d8c41c2d848fc24b0ba4058865bd5d))
11
-
12
- ### Features
13
-
14
- - migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
15
-
16
- ### BREAKING CHANGES
17
-
18
- - programs now are in ES Modules and won't work with Common JS require()
19
-
20
- ## 4.0.1 (2021-09-13)
21
-
22
- ### Bug Fixes
23
-
24
- - bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
25
-
26
6
  ## 4.0.0 (2021-09-09)
27
7
 
28
8
  ### Features
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-%YEAR% Roy Revelt and other contributors
3
+ Copyright (c) 2010-2021 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
@@ -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.4
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.4";
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.4
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.4",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.4",
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,97 +30,40 @@
30
30
  },
31
31
  "types": "types/index.d.ts",
32
32
  "scripts": {
33
- "build": "rollup -c",
34
- "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov",
35
- "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
36
- "clean_types": "../../scripts/cleanTypes.js",
37
- "dev": "rollup -c --dev",
38
- "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
- "format": "npm run lect && npm run prettier && npm run lint",
42
- "lect": "lect",
43
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
44
- "perf": "node perf/check",
45
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
46
- "republish": "npm publish || :",
47
- "tap": "tap",
48
- "pretest": "npm run build",
49
- "test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
50
- "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
51
- "tsc": "tsc",
52
- "unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
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
- "coverage-report": [
57
- "json-summary",
58
- "text"
59
- ],
60
- "node-arg": [
61
- "--no-warnings",
62
- "--experimental-loader",
63
- "@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/**/*.*"
64
53
  ],
65
- "timeout": 0
54
+ "lines": 100
66
55
  },
67
56
  "lect": {
68
57
  "licence": {
69
58
  "extras": [
70
59
  ""
71
60
  ]
72
- },
73
- "req": "{ nonEmpty }",
74
- "various": {
75
- "devDependencies": [
76
- "@types/lodash.isplainobject"
77
- ]
78
61
  }
79
62
  },
80
63
  "dependencies": {
81
- "@babel/runtime": "^7.16.0",
82
64
  "lodash.isplainobject": "^4.0.6"
83
65
  },
84
66
  "devDependencies": {
85
- "@babel/cli": "^7.16.0",
86
- "@babel/core": "^7.16.0",
87
- "@babel/node": "^7.16.0",
88
- "@babel/plugin-external-helpers": "^7.16.0",
89
- "@babel/plugin-proposal-class-properties": "^7.16.0",
90
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
91
- "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
92
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
93
- "@babel/plugin-transform-runtime": "^7.16.0",
94
- "@babel/preset-env": "^7.16.0",
95
- "@babel/preset-typescript": "^7.16.0",
96
- "@babel/register": "^7.16.0",
97
- "@istanbuljs/esm-loader-hook": "^0.1.2",
98
- "@rollup/plugin-babel": "^5.3.0",
99
- "@rollup/plugin-commonjs": "^21.0.1",
100
- "@rollup/plugin-json": "^4.1.0",
101
- "@rollup/plugin-node-resolve": "^13.0.6",
102
- "@rollup/plugin-strip": "^2.1.0",
103
- "@rollup/plugin-typescript": "^8.3.0",
104
- "@types/lodash.isplainobject": "^4.0.6",
105
- "@types/node": "^16.11.6",
106
- "@types/tap": "^15.0.5",
107
- "@typescript-eslint/eslint-plugin": "^5.3.0",
108
- "@typescript-eslint/parser": "^5.3.0",
109
- "core-js": "^3.19.1",
110
- "cross-env": "^7.0.3",
111
- "eslint": "^8.1.0",
112
- "lect": "^0.18.4",
113
- "rollup": "^2.59.0",
114
- "rollup-plugin-ascii": "^0.0.3",
115
- "rollup-plugin-banner": "^0.2.1",
116
- "rollup-plugin-cleanup": "^3.2.1",
117
- "rollup-plugin-dts": "^4.0.0",
118
- "rollup-plugin-terser": "^7.0.2",
119
- "tap": "^15.0.10",
120
- "tslib": "^2.3.1",
121
- "typescript": "^4.4.4"
122
- },
123
- "engines": {
124
- "node": ">=12"
67
+ "@types/lodash.isplainobject": "^4.0.6"
125
68
  }
126
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)"}}