bobe 0.0.74 → 0.0.75
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/dist/bobe.cjs +9 -6
- package/dist/bobe.cjs.map +1 -1
- package/dist/bobe.compiler.cjs +9 -6
- package/dist/bobe.compiler.cjs.map +1 -1
- package/dist/bobe.compiler.esm.js +9 -6
- package/dist/bobe.compiler.esm.js.map +1 -1
- package/dist/bobe.esm.js +9 -6
- package/dist/bobe.esm.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.umd.js +9 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/bobe.compiler.cjs
CHANGED
|
@@ -2527,6 +2527,11 @@ class Interpreter {
|
|
|
2527
2527
|
getFn(data, expression) {
|
|
2528
2528
|
return new Function('data', `with(data){return (${expression})}`).bind(undefined, safe(data));
|
|
2529
2529
|
}
|
|
2530
|
+
getBoolFn(data, expression) {
|
|
2531
|
+
return new Function('data', `with(data){return Boolean(${expression})}`).bind(undefined, safeExclude(data, {
|
|
2532
|
+
'Boolean': true
|
|
2533
|
+
}));
|
|
2534
|
+
}
|
|
2530
2535
|
getAssignFn(data, expression) {
|
|
2531
2536
|
const valueId = `value_bobe_${bobeShared.date32()}`;
|
|
2532
2537
|
return new Function('data', valueId, `with(data){${expression}=${valueId}};`).bind(undefined, safeExclude(data, {
|
|
@@ -2564,11 +2569,9 @@ class Interpreter {
|
|
|
2564
2569
|
switch (keyWord.value) {
|
|
2565
2570
|
case 'if':
|
|
2566
2571
|
if (valueIsMapKey) {
|
|
2567
|
-
aoye.
|
|
2568
|
-
const cells = data[aoye.Keys.Meta].cells;
|
|
2569
|
-
signal = cells.get(value);
|
|
2572
|
+
signal = new aoye.Computed(() => Boolean(data[value]));
|
|
2570
2573
|
} else {
|
|
2571
|
-
const fn = this.
|
|
2574
|
+
const fn = this.getBoolFn(data, value);
|
|
2572
2575
|
signal = new aoye.Computed(fn);
|
|
2573
2576
|
}
|
|
2574
2577
|
break;
|
|
@@ -2588,7 +2591,7 @@ class Interpreter {
|
|
|
2588
2591
|
return true;
|
|
2589
2592
|
});
|
|
2590
2593
|
} else {
|
|
2591
|
-
const fn = valueIsMapKey ? null : this.
|
|
2594
|
+
const fn = valueIsMapKey ? null : this.getBoolFn(data, value);
|
|
2592
2595
|
signal = new aoye.Computed(() => {
|
|
2593
2596
|
let point = ifNode.preCond;
|
|
2594
2597
|
while (point) {
|
|
@@ -2600,7 +2603,7 @@ class Interpreter {
|
|
|
2600
2603
|
}
|
|
2601
2604
|
point = point.preCond;
|
|
2602
2605
|
}
|
|
2603
|
-
return valueIsMapKey ? data[value] : fn();
|
|
2606
|
+
return valueIsMapKey ? Boolean(data[value]) : fn();
|
|
2604
2607
|
});
|
|
2605
2608
|
}
|
|
2606
2609
|
break;
|