util-nonempty 5.1.0 → 5.2.0

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,11 +3,22 @@
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
- ## 5.1.0 (2025-10-15)
6
+ ## 5.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
11
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
7
12
 
8
13
  ### Features
9
14
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
15
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
16
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
17
+
18
+ ### Reverts
19
+
20
+ - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
21
+ - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
11
22
 
12
23
  ## 5.0.0 (2022-12-01)
13
24
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2026 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
@@ -32,26 +32,15 @@ npm i util-nonempty
32
32
  ## Quick Take
33
33
 
34
34
  ```js
35
- import { strict as assert } from "assert";
35
+ import { strict as assert } from "node:assert";
36
36
 
37
37
  import { nonEmpty } from "util-nonempty";
38
38
 
39
39
  assert.equal(nonEmpty("z"), true);
40
40
  assert.equal(nonEmpty(""), false);
41
- assert.equal(nonEmpty(["a"]), true);
42
- assert.equal(nonEmpty([123]), true);
43
- assert.equal(nonEmpty([[[[[[[[[[[]]]]]]]]]]]), true);
44
- assert.equal(nonEmpty({ a: "" }), true);
45
- assert.equal(nonEmpty({ a: "a" }), true);
46
- assert.equal(nonEmpty({}), false);
47
-
48
- const f = () => {
49
- return "z";
50
- };
51
- assert.equal(nonEmpty(f), false);
52
- // (answer is instantly false if input is not array, plain object or string)
53
41
  ```
54
42
 
43
+
55
44
  ## Documentation
56
45
 
57
46
  Please [visit codsen.com](https://codsen.com/os/util-nonempty/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/util-nonempty/CHANGELOG.md).
@@ -64,6 +53,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
64
53
 
65
54
  MIT License
66
55
 
67
- Copyright © 2010-2025 Roy Revelt and other contributors
56
+ Copyright © 2010-2026 Roy Revelt and other contributors
68
57
 
69
58
  <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 util-nonempty
3
3
  * @fileoverview Is the input (plain object, array, string or whatever) not empty?
4
- * @version 5.1.0
4
+ * @version 5.2.0
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/util-nonempty/}
8
8
  */
9
9
 
10
- import{isPlainObject as r}from"codsen-utils";var t="5.1.0";var p=t;function l(e){return e==null?!1:Array.isArray(e)||typeof e=="string"?!!e.length:r(e)?!!Object.keys(e).length:typeof e=="number"}export{l as nonEmpty,p as version};
10
+ import{isPlainObject as s}from"codsen-utils";var t="5.2.0";var c=t;function p(e){return e==null?!1:Array.isArray(e)||typeof e=="string"?!!e.length:s(e)?!!Object.keys(e).length:typeof e=="number"}export{p as nonEmpty,c as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name util-nonempty
3
3
  * @fileoverview Is the input (plain object, array, string or whatever) not empty?
4
- * @version 5.1.0
4
+ * @version 5.2.0
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/util-nonempty/}
8
8
  */
9
9
 
10
- "use strict";var utilNonempty=(()=>{var v=Object.create;var b=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var D=(r,s)=>()=>(s||r((s={exports:{}}).exports,s),s.exports),E=(r,s)=>{for(var i in s)b(r,i,{get:s[i],enumerable:!0})},h=(r,s,i,f)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of k(s))!B.call(r,c)&&c!==i&&b(r,c,{get:()=>s[c],enumerable:!(f=C(s,c))||f.enumerable});return r};var $=(r,s,i)=>(i=r!=null?v(S(r)):{},h(s||!r||!r.__esModule?b(i,"default",{value:r,enumerable:!0}):i,r)),M=r=>h(b({},"__esModule",{value:!0}),r);var j=D((I,A)=>{"use strict";A.exports=L;function m(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function L(r){if(r=r||{},r.circles)return P(r);let s=new Map;if(s.set(Date,n=>new Date(n)),s.set(Map,(n,u)=>new Map(f(Array.from(n),u))),s.set(Set,(n,u)=>new Set(f(Array.from(n),u))),r.constructorHandlers)for(let n of r.constructorHandlers)s.set(n[0],n[1]);let i=null;return r.proto?p:c;function f(n,u){let e=Object.keys(n),t=new Array(e.length);for(let a=0;a<e.length;a++){let o=e[a],l=n[o];typeof l!="object"||l===null?t[o]=l:l.constructor!==Object&&(i=s.get(l.constructor))?t[o]=i(l,u):ArrayBuffer.isView(l)?t[o]=m(l):t[o]=u(l)}return t}function c(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return f(n,c);if(n.constructor!==Object&&(i=s.get(n.constructor)))return i(n,c);let u={};for(let e in n){if(Object.hasOwnProperty.call(n,e)===!1)continue;let t=n[e];typeof t!="object"||t===null?u[e]=t:t.constructor!==Object&&(i=s.get(t.constructor))?u[e]=i(t,c):ArrayBuffer.isView(t)?u[e]=m(t):u[e]=c(t)}return u}function p(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return f(n,p);if(n.constructor!==Object&&(i=s.get(n.constructor)))return i(n,p);let u={};for(let e in n){let t=n[e];typeof t!="object"||t===null?u[e]=t:t.constructor!==Object&&(i=s.get(t.constructor))?u[e]=i(t,p):ArrayBuffer.isView(t)?u[e]=m(t):u[e]=p(t)}return u}}function P(r){let s=[],i=[],f=new Map;if(f.set(Date,e=>new Date(e)),f.set(Map,(e,t)=>new Map(p(Array.from(e),t))),f.set(Set,(e,t)=>new Set(p(Array.from(e),t))),r.constructorHandlers)for(let e of r.constructorHandlers)f.set(e[0],e[1]);let c=null;return r.proto?u:n;function p(e,t){let a=Object.keys(e),o=new Array(a.length);for(let l=0;l<a.length;l++){let d=a[l],y=e[d];if(typeof y!="object"||y===null)o[d]=y;else if(y.constructor!==Object&&(c=f.get(y.constructor)))o[d]=c(y,t);else if(ArrayBuffer.isView(y))o[d]=m(y);else{let g=s.indexOf(y);g!==-1?o[d]=i[g]:o[d]=t(y)}}return o}function n(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,n);if(e.constructor!==Object&&(c=f.get(e.constructor)))return c(e,n);let t={};s.push(e),i.push(t);for(let a in e){if(Object.hasOwnProperty.call(e,a)===!1)continue;let o=e[a];if(typeof o!="object"||o===null)t[a]=o;else if(o.constructor!==Object&&(c=f.get(o.constructor)))t[a]=c(o,n);else if(ArrayBuffer.isView(o))t[a]=m(o);else{let l=s.indexOf(o);l!==-1?t[a]=i[l]:t[a]=n(o)}}return s.pop(),i.pop(),t}function u(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return p(e,u);if(e.constructor!==Object&&(c=f.get(e.constructor)))return c(e,u);let t={};s.push(e),i.push(t);for(let a in e){let o=e[a];if(typeof o!="object"||o===null)t[a]=o;else if(o.constructor!==Object&&(c=f.get(o.constructor)))t[a]=c(o,u);else if(ArrayBuffer.isView(o))t[a]=m(o);else{let l=s.indexOf(o);l!==-1?t[a]=i[l]:t[a]=u(o)}}return s.pop(),i.pop(),t}}});var T={};E(T,{nonEmpty:()=>N,version:()=>F});var w=$(j(),1);var V=(0,w.default)();function O(r){if(r==null||typeof r!="object")return!1;let s=Object.getPrototypeOf(r);return s!==null&&s!==Object.prototype&&Object.getPrototypeOf(s)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}var x="5.1.0";var F=x;function N(r){return r==null?!1:Array.isArray(r)||typeof r=="string"?!!r.length:O(r)?!!Object.keys(r).length:typeof r=="number"}return M(T);})();
10
+ "use strict";var utilNonempty=(()=>{var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},p=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of a(t))!f.call(e,r)&&r!==n&&i(e,r,{get:()=>t[r],enumerable:!(s=u(t,r))||s.enumerable});return e};var h=e=>p(i({},"__esModule",{value:!0}),e);var m={};c(m,{nonEmpty:()=>y,version:()=>g});var A=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);function l(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}var o="5.2.0";var g=o;function y(e){return e==null?!1:Array.isArray(e)||typeof e=="string"?!!e.length:l(e)?!!Object.keys(e).length:typeof e=="number"}return h(m);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.7.0
14
+ * @version 1.8.0
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/codsen-utils/}
package/package.json CHANGED
@@ -1,16 +1,8 @@
1
1
  {
2
2
  "name": "util-nonempty",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Is the input (plain object, array, string or whatever) not empty?",
5
- "keywords": [
6
- "array",
7
- "empty",
8
- "is",
9
- "not",
10
- "object",
11
- "string",
12
- "util"
13
- ],
5
+ "keywords": ["array", "empty", "is", "not", "object", "string", "util"],
14
6
  "homepage": "https://codsen.com/os/util-nonempty",
15
7
  "repository": {
16
8
  "type": "git",
@@ -31,43 +23,45 @@
31
23
  },
32
24
  "types": "types/index.d.ts",
33
25
  "scripts": {
34
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
35
- "cjs-off": "exit 0",
36
- "cjs-on": "exit 0",
37
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
26
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
27
+ "coverage": "c8 uvu test",
28
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
38
29
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
39
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
30
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
40
31
  "examples": "node '../../ops/scripts/run-examples.js'",
41
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
42
- "letspublish": "npm publish --provenance || :",
43
- "lint": "eslint . --fix --concurrency=auto --cache",
32
+ "lect": "node '../../ops/lect/lect.js'",
33
+ "lect:check": "node '../../ops/lect/lect.js' --check",
34
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
35
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
44
36
  "perf": "node perf/check.js",
45
37
  "prep": "echo 'ready'",
46
- "prettier": "prettier",
47
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
48
- "pretest": "npm run lect && npm run build",
38
+ "prettier": "biome format",
39
+ "prettier:format": "biome format --write .",
40
+ "pretest": "npm run lect:check && npm run build",
49
41
  "test": "npm run devtest",
42
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
50
43
  "unit": "uvu test"
51
44
  },
52
- "engines": {
53
- "node": ">=14.18.0"
54
- },
55
45
  "c8": {
46
+ "all": true,
47
+ "branches": 100,
56
48
  "check-coverage": true,
57
- "exclude": [
58
- "**/test/**/*.*"
59
- ],
60
- "lines": 100
49
+ "exclude": ["**/test/**/*.*"],
50
+ "functions": 100,
51
+ "include": ["dist/*.esm.js"],
52
+ "lines": 100,
53
+ "statements": 100
61
54
  },
62
55
  "lect": {
63
56
  "licence": {
64
- "extras": [
65
- ""
66
- ]
57
+ "extras": [""]
67
58
  }
68
59
  },
69
60
  "dependencies": {
70
- "codsen-utils": "^1.7.0"
61
+ "codsen-utils": "^1.8.0"
62
+ },
63
+ "engines": {
64
+ "node": ">=18.20.8"
71
65
  },
72
66
  "publishConfig": {
73
67
  "registry": "https://registry.npmjs.org/"
package/.eslintcache DELETED
@@ -1 +0,0 @@
1
- [{"/home/runner/work/codsen/codsen/packages/util-nonempty/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/util-nonempty/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/util-nonempty/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/util-nonempty/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/util-nonempty/test/test.js":"5"},{"size":580,"mtime":1760566739165,"results":"6","hashOfConfig":"7"},{"size":298,"mtime":1760566739165,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760566739165,"results":"10","hashOfConfig":"7"},{"size":494,"mtime":1760566739165,"results":"11","hashOfConfig":"9"},{"size":1428,"mtime":1760566739165,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"nrihsz","/home/runner/work/codsen/codsen/packages/util-nonempty/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/util-nonempty/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/util-nonempty/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/util-nonempty/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/util-nonempty/test/test.js",[],["29","30","31","32","33","34"],{"ruleId":"35","severity":2,"message":"36","line":3,"column":17,"nodeType":null,"messageId":"37","endLine":3,"endColumn":19,"suppressions":"38"},{"ruleId":"35","severity":2,"message":"39","line":3,"column":21,"nodeType":null,"messageId":"37","endLine":3,"endColumn":23,"suppressions":"40"},{"ruleId":"35","severity":2,"message":"41","line":3,"column":25,"nodeType":null,"messageId":"37","endLine":3,"endColumn":31,"suppressions":"42"},{"ruleId":"35","severity":2,"message":"43","line":3,"column":33,"nodeType":null,"messageId":"37","endLine":3,"endColumn":37,"suppressions":"44"},{"ruleId":"35","severity":2,"message":"45","line":3,"column":39,"nodeType":null,"messageId":"37","endLine":3,"endColumn":42,"suppressions":"46"},{"ruleId":"35","severity":2,"message":"47","line":3,"column":44,"nodeType":null,"messageId":"37","endLine":3,"endColumn":49,"suppressions":"48"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["49"],"'ok' is defined but never used.",["50"],"'throws' is defined but never used.",["51"],"'type' is defined but never used.",["52"],"'not' is defined but never used.",["53"],"'match' is defined but never used.",["54"],{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},{"kind":"55","justification":"56"},"directive",""]