util-nonempty 5.2.1 → 5.2.3

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,6 +3,12 @@
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.2.2 (2026-09-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **util-nonempty:** harden shallow value checks ([6f1eda6](https://github.com/codsen/codsen/commit/6f1eda6108ec38d15d30d4b3cb24a8880fcb4656))
11
+
6
12
  ## 5.2.1 (2026-08-22)
7
13
 
8
14
  ### Performance Improvements
package/README.md CHANGED
@@ -21,6 +21,8 @@
21
21
  <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
22
22
  </p>
23
23
 
24
+ **No dependencies whatsoever.** This package declares no dependencies or devDependencies.
25
+
24
26
  ## Install
25
27
 
26
28
  This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 3.1.0 (`npm i util-nonempty@3.1.0`).
@@ -43,7 +45,7 @@ assert.equal(nonEmpty(""), false);
43
45
 
44
46
  ## Documentation
45
47
 
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).
48
+ Please [visit codsen.com](https://codsen.com/os/util-nonempty/) for a full description of the API. For **Changelog**, see [raw md on GitHub](https://github.com/codsen/codsen/blob/main/packages/util-nonempty/CHANGELOG.md) or [the website](https://codsen.com/os/util-nonempty/changelog).
47
49
 
48
50
  ## Contributing
49
51
 
@@ -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.2.1
4
+ * @version 5.2.3
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 s}from"codsen-utils";var t="5.2.1";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};
10
+ var n="5.2.3";var a=n,o=Function.prototype.toString,c=o.call(Object);function i(e){if(e===null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);if(r===null||r===Object.prototype)return!0;let t=Object.getOwnPropertyDescriptor(r,"constructor");return!t||!("value"in t)||typeof t.value!="function"?!1:Object.getOwnPropertyDescriptor(t.value,"prototype")?.value===r&&o.call(t.value)===c}function m(e){return e==null?!1:Array.isArray(e)||typeof e=="string"?!!e.length:i(e)?!!Object.keys(e).length:typeof e=="number"}export{m as nonEmpty,a as version};
@@ -1,18 +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.2.1
4
+ * @version 5.2.3
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 i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!c.call(e,r)&&r!==n&&i(e,r,{get:()=>t[r],enumerable:!(s=a(t,r))||s.enumerable});return e};var d=e=>h(i({},"__esModule",{value:!0}),e);var b={};p(b,{nonEmpty:()=>m,version:()=>y});var w=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 o(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 l,C=(l=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:l.get;var x=Date.prototype.getTime;var u="5.2.1";var y=u;function m(e){return e==null?!1:Array.isArray(e)||typeof e=="string"?!!e.length:o(e)?!!Object.keys(e).length:typeof e=="number"}return d(b);})();
11
- /**
12
- * @name codsen-utils
13
- * @fileoverview Various utility functions
14
- * @version 1.9.0
15
- * @author Roy Revelt
16
- * @license MIT
17
- * {@link https://codsen.com/os/codsen-utils/}
18
- */
10
+ "use strict";var utilNonempty=(()=>{var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var a=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!u.call(e,o)&&o!==n&&s(e,o,{get:()=>t[o],enumerable:!(r=p(t,o))||r.enumerable});return e};var d=e=>m(s({},"__esModule",{value:!0}),e);var j={};a(j,{nonEmpty:()=>h,version:()=>f});var c="5.2.3";var f=c,i=Function.prototype.toString,g=i.call(Object);function b(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");if(!n||!("value"in n)||typeof n.value!="function")return!1;let r=Object.getOwnPropertyDescriptor(n.value,"prototype");return(r==null?void 0:r.value)===t&&i.call(n.value)===g}function h(e){return e==null?!1:Array.isArray(e)||typeof e=="string"?!!e.length:b(e)?!!Object.keys(e).length:typeof e=="number"}return d(j);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "util-nonempty",
3
- "version": "5.2.1",
3
+ "version": "5.2.3",
4
4
  "description": "Is the input (plain object, array, string or whatever) not empty?",
5
5
  "keywords": ["array", "empty", "is", "not", "object", "string", "util"],
6
6
  "homepage": "https://codsen.com/os/util-nonempty",
@@ -57,9 +57,6 @@
57
57
  "extras": [""]
58
58
  }
59
59
  },
60
- "dependencies": {
61
- "codsen-utils": "^1.9.0"
62
- },
63
60
  "engines": {
64
61
  "node": ">=18.20.8"
65
62
  },
package/types/index.d.ts CHANGED
@@ -1,4 +1,13 @@
1
1
  declare const version: string;
2
- declare function nonEmpty(input: unknown): boolean;
2
+ /**
3
+ * Check whether a supported value is shallowly non-empty.
4
+ *
5
+ * Strings and native arrays use their outer `length`; sparse array slots count
6
+ * and array expando properties do not. Plain records use own enumerable string
7
+ * keys without reading their values. Every number is non-empty. All other
8
+ * values, including boxed primitives, collections, class instances, symbols,
9
+ * bigints, Booleans, functions, and nullish values, are empty.
10
+ */
11
+ declare function nonEmpty(input?: unknown): boolean;
3
12
 
4
13
  export { nonEmpty, version };