util-nonempty 5.2.1 → 5.2.2
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 +6 -0
- package/dist/util-nonempty.esm.js +2 -2
- package/dist/util-nonempty.umd.js +2 -10
- package/package.json +1 -4
- package/types/index.d.ts +10 -1
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
|
|
@@ -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.
|
|
4
|
+
* @version 5.2.2
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/util-nonempty/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var n="5.2.2";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.
|
|
4
|
+
* @version 5.2.2
|
|
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
|
|
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.2";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.
|
|
3
|
+
"version": "5.2.2",
|
|
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
|
-
|
|
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 };
|