jsfunx 1.2.0 → 1.2.1
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/jsfunx.cjs +6 -2
- package/jsfunx.mjs +6 -2
- package/package.json +1 -1
package/jsfunx.cjs
CHANGED
|
@@ -1551,9 +1551,13 @@ function not(obj) {
|
|
|
1551
1551
|
if (len !== 1)
|
|
1552
1552
|
throw new TypeError(`not() takes exactly one argument (${len} given)`);
|
|
1553
1553
|
|
|
1554
|
-
|
|
1554
|
+
/** @type {*} */
|
|
1555
1555
|
|
|
1556
|
-
|
|
1556
|
+
let val = obj?.valueOf();
|
|
1557
|
+
|
|
1558
|
+
if (!(val instanceof Object) || val instanceof Function) return !val;
|
|
1559
|
+
|
|
1560
|
+
return val.length === 0 || !val; // handling the true object case
|
|
1557
1561
|
}
|
|
1558
1562
|
|
|
1559
1563
|
/**
|
package/jsfunx.mjs
CHANGED
|
@@ -1555,9 +1555,13 @@ export function not(obj) {
|
|
|
1555
1555
|
if (len !== 1)
|
|
1556
1556
|
throw new TypeError(`not() takes exactly one argument (${len} given)`);
|
|
1557
1557
|
|
|
1558
|
-
|
|
1558
|
+
/** @type {*} */
|
|
1559
1559
|
|
|
1560
|
-
|
|
1560
|
+
let val = obj?.valueOf();
|
|
1561
|
+
|
|
1562
|
+
if (!(val instanceof Object) || val instanceof Function) return !val;
|
|
1563
|
+
|
|
1564
|
+
return val.length === 0 || !val; // handling the true object case
|
|
1561
1565
|
}
|
|
1562
1566
|
|
|
1563
1567
|
/**
|