diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2025-11-04 20:53:37 -0800 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2025-11-04 21:01:45 -0800 |
| commit | e86c68dffaffee6ba44d98ba06761245f6d5b670 (patch) | |
| tree | 507922cde204c414d3a6072aef704859639aebb8 /test | |
| parent | b8fd8f0672c289ff43e501f430b76de1c7b0440a (diff) | |
add branching
Diffstat (limited to 'test')
| -rw-r--r-- | test/test.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test.ts b/test/test.ts index 89697fe..672fb4e 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,6 +1,10 @@ import { createFn } from "../src"; -const adder = createFn("fn(x, map(arr(10,20,30), fn(y, add(x, y))))"); +const KS_boolToBin = "fn(b, ?(b, 1, 0))"; -const result = adder(5); +const boolArrToBinaryArr = createFn<[boolean[]]>()( + `fn(boolArr, map(boolArr, ${KS_boolToBin}))` +); + +const result = boolArrToBinaryArr([true, false, true]); console.log(result); |
