From e86c68dffaffee6ba44d98ba06761245f6d5b670 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Tue, 4 Nov 2025 20:53:37 -0800 Subject: add branching --- test/test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/test.ts') 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); -- cgit v1.2.3-70-g09d2