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/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ declare class Interpreter {
|
|
|
70
70
|
private createComponentData;
|
|
71
71
|
componentOrFragmentDeclaration(ComponentOrRender: UI | typeof Store | InlineFragment, ctx: ProgramCtx): ComponentNode$1;
|
|
72
72
|
getFn(data: any, expression: string | number): any;
|
|
73
|
+
getBoolFn(data: any, expression: string | number): any;
|
|
73
74
|
getAssignFn(data: any, expression: string | number): any;
|
|
74
75
|
condDeclaration(ctx: ProgramCtx): IfNode;
|
|
75
76
|
removeLogicNode(node: LogicNode): void;
|
package/dist/index.umd.js
CHANGED
|
@@ -2501,6 +2501,11 @@
|
|
|
2501
2501
|
getFn(data, expression) {
|
|
2502
2502
|
return new Function('data', `with(data){return (${expression})}`).bind(undefined, safe(data));
|
|
2503
2503
|
}
|
|
2504
|
+
getBoolFn(data, expression) {
|
|
2505
|
+
return new Function('data', `with(data){return Boolean(${expression})}`).bind(undefined, safeExclude(data, {
|
|
2506
|
+
'Boolean': true
|
|
2507
|
+
}));
|
|
2508
|
+
}
|
|
2504
2509
|
getAssignFn(data, expression) {
|
|
2505
2510
|
const valueId = `value_bobe_${bobeShared.date32()}`;
|
|
2506
2511
|
return new Function('data', valueId, `with(data){${expression}=${valueId}};`).bind(undefined, safeExclude(data, {
|
|
@@ -2538,11 +2543,9 @@
|
|
|
2538
2543
|
switch (keyWord.value) {
|
|
2539
2544
|
case 'if':
|
|
2540
2545
|
if (valueIsMapKey) {
|
|
2541
|
-
aoye.
|
|
2542
|
-
const cells = data[aoye.Keys.Meta].cells;
|
|
2543
|
-
signal = cells.get(value);
|
|
2546
|
+
signal = new aoye.Computed(() => Boolean(data[value]));
|
|
2544
2547
|
} else {
|
|
2545
|
-
const fn = this.
|
|
2548
|
+
const fn = this.getBoolFn(data, value);
|
|
2546
2549
|
signal = new aoye.Computed(fn);
|
|
2547
2550
|
}
|
|
2548
2551
|
break;
|
|
@@ -2562,7 +2565,7 @@
|
|
|
2562
2565
|
return true;
|
|
2563
2566
|
});
|
|
2564
2567
|
} else {
|
|
2565
|
-
const fn = valueIsMapKey ? null : this.
|
|
2568
|
+
const fn = valueIsMapKey ? null : this.getBoolFn(data, value);
|
|
2566
2569
|
signal = new aoye.Computed(() => {
|
|
2567
2570
|
let point = ifNode.preCond;
|
|
2568
2571
|
while (point) {
|
|
@@ -2574,7 +2577,7 @@
|
|
|
2574
2577
|
}
|
|
2575
2578
|
point = point.preCond;
|
|
2576
2579
|
}
|
|
2577
|
-
return valueIsMapKey ? data[value] : fn();
|
|
2580
|
+
return valueIsMapKey ? Boolean(data[value]) : fn();
|
|
2578
2581
|
});
|
|
2579
2582
|
}
|
|
2580
2583
|
break;
|