@teleporthq/teleport-plugin-next-workflows 0.43.47 → 0.43.48
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/__tests__/runtime-stringified-boolean-truthiness.test.ts +76 -0
- package/dist/cjs/executor-generator.d.ts.map +1 -1
- package/dist/cjs/executor-generator.js +12 -2
- package/dist/cjs/executor-generator.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/executor-generator.d.ts.map +1 -1
- package/dist/esm/executor-generator.js +12 -2
- package/dist/esm/executor-generator.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/executor-generator.ts +12 -2
|
@@ -540,6 +540,16 @@ function coerceForComparison(a, b) {
|
|
|
540
540
|
return [a, b];
|
|
541
541
|
}
|
|
542
542
|
|
|
543
|
+
// Several producers cannot type their output and emit booleans as the strings
|
|
544
|
+
// "true"/"false": the evaluate-auth custom-js, text inputs in the inspector,
|
|
545
|
+
// form fields. coerceForComparison and is-true/is-false already read those as
|
|
546
|
+
// booleans, so truthiness must agree — under a plain double-negation the
|
|
547
|
+
// string "false" is TRUTHY, which let an is-truthy gate on isLoggedIn admit
|
|
548
|
+
// every visitor (see is-logged-in-gate.ts).
|
|
549
|
+
function isStringifiedBoolean(value) {
|
|
550
|
+
return value === 'true' || value === 'false';
|
|
551
|
+
}
|
|
552
|
+
|
|
543
553
|
// The operator vocabulary is written by THREE producers that never agreed on
|
|
544
554
|
// a spelling: the worker canonicalizes to snake_case (is_not_empty,
|
|
545
555
|
// greater_than), the GUI editor emits camelCase named forms (startsWith,
|
|
@@ -584,8 +594,8 @@ function evaluateSingleComparison(config, context) {
|
|
|
584
594
|
case 'is-not-null': return left !== null && left !== undefined;
|
|
585
595
|
case 'is-true': return left === true || left === 'true';
|
|
586
596
|
case 'is-false': return left === false || left === 'false';
|
|
587
|
-
case 'is-truthy': return !!left;
|
|
588
|
-
case 'is-falsy': return !left;
|
|
597
|
+
case 'is-truthy': return isStringifiedBoolean(left) ? left === 'true' : !!left;
|
|
598
|
+
case 'is-falsy': return isStringifiedBoolean(left) ? left === 'false' : !left;
|
|
589
599
|
case 'matches-regex': try { return new RegExp(String(right)).test(String(left)); } catch(e) { return false; }
|
|
590
600
|
default:
|
|
591
601
|
console.warn('[workflow] Unknown comparison operator "' + config.operator + '" — falling back to loose equality');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor-generator.js","sourceRoot":"","sources":["../../src/executor-generator.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAW,EAAE;IACzD,OAAO
|
|
1
|
+
{"version":3,"file":"executor-generator.js","sourceRoot":"","sources":["../../src/executor-generator.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAW,EAAE;IACzD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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