@nxtedition/lib 23.15.5 → 23.15.6
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/package.json +1 -1
- package/util/template/javascript.js +9 -6
- package/yield.js +3 -3
package/package.json
CHANGED
|
@@ -631,14 +631,17 @@ export default function ({ ds, proxify, compiler, logger, platform }) {
|
|
|
631
631
|
script = new Function(
|
|
632
632
|
transform(`
|
|
633
633
|
const _ = (value, ...fns) => {
|
|
634
|
-
if (value
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
634
|
+
if (value == null) {
|
|
635
|
+
return value
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
for (const fn of fns) {
|
|
639
|
+
value = fn(value)
|
|
640
|
+
if (value == null) {
|
|
641
|
+
return value
|
|
640
642
|
}
|
|
641
643
|
}
|
|
644
|
+
|
|
642
645
|
return value
|
|
643
646
|
};
|
|
644
647
|
_.asset = (type, state, suspend) => (name) => nxt._asset(name, type, state, suspend);
|
package/yield.js
CHANGED
|
@@ -7,15 +7,15 @@ let yieldScheduled = false
|
|
|
7
7
|
let yieldTime = performance.now()
|
|
8
8
|
let yieldActive = false
|
|
9
9
|
|
|
10
|
-
export function maybeYield(
|
|
10
|
+
export function maybeYield(callback) {
|
|
11
11
|
if (callback != null && typeof callback !== 'function') {
|
|
12
12
|
throw new TypeError('callback must be a function')
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
return performance.now() - yieldTime < yieldTimeout ? null : doYield(
|
|
15
|
+
return performance.now() - yieldTime < yieldTimeout ? null : doYield(callback)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export function doYield(
|
|
18
|
+
export function doYield(callback) {
|
|
19
19
|
if (!yieldScheduled) {
|
|
20
20
|
yieldScheduled = true
|
|
21
21
|
yieldSchedule(dispatchYield)
|