id
stringlengths
1
6
tokens
sequence
labels
sequence
600
[ "import", "{", "createStore", ",", "createEvent", ",", "guard", ",", "Event", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "test", "(", "'wide union (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<{ a: 1; } | { a: 2; }>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<{ a: 1; } | { a: 2; } | { a: 3; }>' is not assignable to type 'Event<{ a: 1; } | { a: 2; }>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: 1; } | { a: 2; } | { a: 3; }) => any) => Subscription' is not assignable to type '(watcher: (payload: { a: 1; } | { a: 2; }) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: 1; } | { a: 2; } | { a: 3; }' is not assignable to type '{ a: 1; } | { a: 2; }'.\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<{ a: 1; } | { a: 2; }>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<{ a: 1; } | { a: 2; } | { a: 3; }>' is not assignable to type '[Event<{ a: 1; } | { a: 2; }>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow union (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unknown type in source (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<string>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<unknown>' is not assignable to type 'Event<string>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: unknown) => any) => Subscription' is not assignable to type '(watcher: (payload: string) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type 'unknown' is not assignable to type 'string'.\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<string>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<unknown>' is not assignable to type '[Event<string>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unknown type in target (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'optional props (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<{ a: 1; b: 2; }>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<{ a: 1; b?: 2 | undefined; }>' is not assignable to type 'Event<{ a: 1; b: 2; }>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: 1; b?: 2 | undefined; }) => any) => Subscription' is not assignable to type '(watcher: (payload: { a: 1; b: 2; }) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: 1; b?: 2 | undefined; }' is not assignable to type '{ a: 1; b: 2; }'.\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<{ a: 1; b: 2; }>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<{ a: 1; b?: 2 | undefined; }>' is not assignable to type '[Event<{ a: 1; b: 2; }>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'wide object (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow object (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<{ a: 1; b: 2; c: 3; }>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<{ a: 1; b: 2; }>' is not assignable to type 'Event<{ a: 1; b: 2; c: 3; }>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: 1; b: 2; }) => any) => Subscription' is not assignable to type '(watcher: (payload: { a: 1; b: 2; c: 3; }) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: 1; b: 2; }' is not assignable to type '{ a: 1; b: 2; c: 3; }'.\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<{ a: 1; b: 2; c: 3; }>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<{ a: 1; b: 2; }>' is not assignable to type '[Event<{ a: 1; b: 2; c: 3; }>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow object combined (should fail)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'not enough'", ")", ";", "const", "target", "=", "createEvent", "<", "{", "foo", ":", "string", ";", "bar", ":", "string", ";", "}", ">", "(", ")", ";", "guard", "(", "{", "source", ":", "{", "foo", "}", ",", "filter", ":", "(", ")", "=>", "true", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<{ foo: string; bar: string; }>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'wide tuple (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "guard", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow tuple (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "guard", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<[1, 2, 3]>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<[1, 2, 3]>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'wide union in array (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<(string | number)[]>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<(string | number | boolean)[]>' is not assignable to type 'Event<(string | number)[]>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: (string | number | boolean)[]) => any) => Subscription' is not assignable to type '(watcher: (payload: (string | number)[]) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '(string | number | boolean)[]' is not assignable to type '(string | number)[]'.\n No overload matches this call.\n The last overload gave the following error.\n Type 'Event<(string | number)[]>' is not assignable to type '\\\\\"incompatible unit in target\\\\\"'.\n Type 'Event<(string | number | boolean)[]>' is not assignable to type '[Event<(string | number)[]>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow union in array (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "guard", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
601
[ "import", "{", "createStore", ",", "createEvent", ",", "createEffect", ",", "sample", ",", "Store", ",", "Event", ",", "guard", ",", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "/**\n * Please note, that some tests may seem duplicating, having the same target sets but\n * in different order. This is crucial for testing the correctness of conditional tuple\n * iteration algorithms as they rely on order in some situations.\n */", "describe", "(", "'basic cases (should pass)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: number, clock: any, target: [number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [numberString, number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "numberString", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "numberString", ",", "num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [void] } (should pass)'", ",", "(", ")", "=>", "{", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "voidt", "=", "createEvent", "<", "void", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "voidt", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [number, void] } (should pass)'", ",", "(", ")", "=>", "{", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "voidt", "=", "createEvent", "<", "void", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "num", ",", "voidt", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [void, number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "voidt", "=", "createEvent", "<", "void", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "voidt", ",", "num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'basic cases'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: number, clock: any, target: [] } (?)'", ",", "(", ")", "=>", "{", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [string] } (should fail)'", ",", "(", ")", "=>", "{", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: Event<string>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [number, string] } (should fail)'", ",", "(", ")", "=>", "{", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "num", ",", "str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<number> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [string, number] } (should fail)'", ",", "(", ")", "=>", "{", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "str", ",", "num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<number> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<number>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<number>]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [numberString, string] } (should fail)'", ",", "(", ")", "=>", "{", "const", "numberString", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "numberString", ",", "str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<string> | Event<string | number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<string | number>, { sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<string | number>, { sourceType: number; targetType: string; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [string, numberString] } (should fail)'", ",", "(", ")", "=>", "{", "const", "numberString", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "str", ",", "numberString", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<string> | Event<string | number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<string | number>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<string | number>]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [number, stringBoolean] } (should fail)'", ",", "(", ")", "=>", "{", "const", "stringBoolean", "=", "createEvent", "<", "string", "|", "boolean", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "num", ",", "stringBoolean", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string | boolean; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string | boolean; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [stringBoolean, number] } (should fail)'", ",", "(", ")", "=>", "{", "const", "stringBoolean", "=", "createEvent", "<", "string", "|", "boolean", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "stringBoolean", ",", "num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<number>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<number>]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [void, string] } (should fail)'", ",", "(", ")", "=>", "{", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "voidt", "=", "createEvent", "<", "void", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "voidt", ",", "str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<void> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, { sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, { sourceType: number; targetType: string; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [string, void] } (should fail)'", ",", "(", ")", "=>", "{", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "voidt", "=", "createEvent", "<", "void", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "str", ",", "voidt", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<void> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<void>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<void>]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [any, string] } (should fail)'", ",", "(", ")", "=>", "{", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "anyt", ",", "str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<any> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<any>, { sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<any>, { sourceType: number; targetType: string; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: any, target: [string, any] } (should fail)'", ",", "(", ")", "=>", "{", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "anyt", ",", "target", ":", "[", "str", ",", "anyt", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; clock: Event<any>; target: (Event<any> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<any>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<any>]; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'source & clock mapping (should pass)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: number, clock: number, fn: (s, c) => s + c, target: [number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "num", ",", "fn", ":", "(", "s", ",", "c", ")", "=>", "s", "+", "c", ",", "target", ":", "[", "num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: number, clock: number, fn: (s, c) => s + c, target: [numberString, number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "numberString", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "num", ",", "clock", ":", "num", ",", "fn", ":", "(", "s", ",", "c", ")", "=>", "s", "+", "c", ",", "target", ":", "[", "numberString", ",", "num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'combinable source object (should pass)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: { a: $num }, clock: any, target: [a_num] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "a_num", "=", "createEvent", "<", "{", "a", ":", "number", ";", "}", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "anyt", ",", "target", ":", "[", "a_num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: { a: $num, b: $num }, clock: any, target: [a_num] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "a_num", "=", "createEvent", "<", "{", "a", ":", "number", ";", "}", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$num", "}", ",", "clock", ":", "anyt", ",", "target", ":", "[", "a_num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: { a: $num, b: $num }, clock: any, target: [a_num_b_num] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "a_num_b_num", "=", "createEvent", "<", "{", "a", ":", "number", ";", "b", ":", "number", ";", "}", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$num", "}", ",", "clock", ":", "anyt", ",", "target", ":", "[", "a_num_b_num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'combinable source object (should fail)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: { a: $num }, clock: any, target: [a_str] } (should fail)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "a_str", "=", "createEvent", "<", "{", "a", ":", "string", ";", "}", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "anyt", ",", "target", ":", "[", "a_str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: { a: Store<number>; }; clock: Event<any>; target: Event<{ a: string; }>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: { a: string; }; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: { a: string; }; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: { a: $num }, clock: any, target: [a_num, a_str] } (should fail)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "a_str", "=", "createEvent", "<", "{", "a", ":", "string", ";", "}", ">", "(", ")", ";", "const", "a_num", "=", "createEvent", "<", "{", "a", ":", "number", ";", "}", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "anyt", ",", "target", ":", "[", "a_num", ",", "a_str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: { a: Store<number>; }; clock: Event<any>; target: (Event<{ a: string; }> | Event<{ a: number; }>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<{ a: number; }>, { sourceType: { a: number; }; targetType: { a: string; }; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<{ a: number; }>, { sourceType: { a: number; }; targetType: { a: string; }; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: { a: $num }, clock: any, target: [a_num_b_str] } (should fail)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "a_num_b_str", "=", "createEvent", "<", "{", "a", ":", "number", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "anyt", ",", "target", ":", "[", "a_num_b_str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: { a: Store<number>; }; clock: Event<any>; target: Event<{ a: number; b: string; }>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: { a: number; b: string; }; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: { a: number; b: string; }; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: { a: $num }, clock: any, target: [a_num_b_num, a_num] } (should fail)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "a_num_b_num", "=", "createEvent", "<", "{", "a", ":", "number", ";", "b", ":", "number", ";", "}", ">", "(", ")", ";", "const", "a_num", "=", "createEvent", "<", "{", "a", ":", "number", ";", "}", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "anyt", ",", "target", ":", "[", "a_num_b_num", ",", "a_num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: { a: Store<number>; }; clock: Event<any>; target: (Event<{ a: number; b: number; }> | Event<{ a: number; }>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: { a: number; b: number; }; }, Event<{ a: number; }>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: { a: number; b: number; }; }, Event<{ a: number; }>]; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'combinable source object & clock mapping (should pass)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: { a: $num, b: $num }, clock: number, fn: (s, c) => s.a + s.b + c, target: [number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$num", "}", ",", "clock", ":", "num", ",", "fn", ":", "(", "s", ",", "c", ")", "=>", "s", ".", "a", "+", "s", ".", "b", "+", "c", ",", "target", ":", "[", "num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: { a: $num, b: $num }, clock: number, fn: (s, c) => s.a + s.b + c, target: [numberString, number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "numberString", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$num", "}", ",", "clock", ":", "num", ",", "fn", ":", "(", "s", ",", "c", ")", "=>", "s", ".", "a", "+", "s", ".", "b", "+", "c", ",", "target", ":", "[", "numberString", ",", "num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'combinable source list (should pass)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: [$num], clock: any, target: [l_num] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "l_num", "=", "createEvent", "<", "[", "number", "]", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "[", "$num", "]", ",", "clock", ":", "anyt", ",", "target", ":", "[", "l_num", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: [$num, $num], clock: any, target: [l_num_num] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "l_num_num", "=", "createEvent", "<", "[", "number", ",", "number", "]", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "[", "$num", ",", "$num", "]", ",", "clock", ":", "anyt", ",", "target", ":", "[", "l_num_num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'combinable source list (should fail)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: [$num], clock: any, target: [l_str] } (should fail)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "l_str", "=", "createEvent", "<", "[", "string", "]", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "[", "$num", "]", ",", "clock", ":", "anyt", ",", "target", ":", "[", "l_str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<number>[]; clock: Event<any>; target: Event<[string]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: [$num], clock: any, target: [l_num, l_str] } (should fail)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "l_str", "=", "createEvent", "<", "[", "string", "]", ">", "(", ")", ";", "const", "l_num", "=", "createEvent", "<", "[", "number", "]", ">", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "[", "$num", "]", ",", "clock", ":", "anyt", ",", "target", ":", "[", "l_num", ",", "l_str", "]", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<number>[]; clock: Event<any>; target: (Event<[number]> | Event<[string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [string]; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'combinable source list & clock mapping (should pass)'", ",", "(", ")", "=>", "{", "test", "(", "'{ source: [$num, $num], clock: number, fn: ([a, b], c) => a + b + c, target: [number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "[", "$num", ",", "$num", "]", ",", "clock", ":", "num", ",", "fn", ":", "(", "[", "a", ",", "b", "]", ",", "c", ")", "=>", "a", "+", "b", "+", "c", ",", "target", ":", "[", "num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'{ source: [$num, $num], clock: number, fn: ([a, b], c) => a + b + c, target: [numberString, number] } (should pass)'", ",", "(", ")", "=>", "{", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "numberString", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "[", "$num", ",", "$num", "]", ",", "clock", ":", "num", ",", "fn", ":", "(", "[", "a", ",", "b", "]", ",", "c", ")", "=>", "a", "+", "b", "+", "c", ",", "target", ":", "[", "numberString", ",", "num", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
602
[ "import", "{", "createStore", ",", "createEvent", ",", "sample", ",", "Event", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "describe", "(", "'with target'", ",", "(", ")", "=>", "{", "it", "(", "'without fn (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'without fn with combinable source (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'with fn (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "describe", "(", "'with fn and combinable source (should pass)'", ",", "(", ")", "=>", "{", "describe", "(", "'with explicitly typed arguments'", ",", "(", ")", "=>", "{", "describe", "(", "'with second argument in fn'", ",", "(", ")", "=>", "{", "test", "(", "'with unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'without second argument in fn'", ",", "(", ")", "=>", "{", "test", "(", "'with unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'with implicitly typed arguments'", ",", "(", ")", "=>", "{", "describe", "(", "'with second argument in fn'", ",", "(", ")", "=>", "{", "test", "(", "'with unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'without second argument in fn'", ",", "(", ")", "=>", "{", "test", "(", "'with unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without unification to any (should pass)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "test", "(", "'detect incorrect arguments in fn with combinable source (should fail)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "a", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "clock", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type '({ a }: { a: number; }, clock: any) => { a: number; clock: any; }' is not assignable to type '((src: { a: string; }, clk: string | void) => any) & (({ a }: { a: number; }, clock: any) => { a: number; clock: any; })'.\n Type '({ a }: { a: number; }, clock: any) => { a: number; clock: any; }' is not assignable to type '(src: { a: string; }, clk: string | void) => any'.\n Types of parameters '__0' and 'src' are incompatible.\n Type '{ a: string; }' is not assignable to type '{ a: number; }'.\n Types of property 'a' are incompatible.\n Type 'string' is not assignable to type 'number'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'detect too wide type of clocks (should fail)'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "clock", ":", "string", ";", "}", ">", "(", ")", ";", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type '({ a, b }: any, clock: string) => { a: any; b: any; clock: string; }' is not assignable to type '((src: { a: string; b: string; }, clk: string | void) => any) & (({ a, b }: any, clock: string) => { a: any; b: any; clock: string; })'.\n Type '({ a, b }: any, clock: string) => { a: any; b: any; clock: string; }' is not assignable to type '(src: { a: string; b: string; }, clk: string | void) => any'.\n Types of parameters 'clock' and 'clk' are incompatible.\n Type 'string | void' is not assignable to type 'string'.\n Type 'void' is not assignable to type 'string'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'without target'", ",", "(", ")", "=>", "{", "it", "(", "'without fn (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'without fn with combinable source (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'with fn (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target1", "=", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "}", ")", ";", "const", "target2", "=", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "}", ")", ";", "const", "target3", "=", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Binding element 'a' implicitly has an 'any' type.\n Binding element 'b' implicitly has an 'any' type.\n Parameter 'clock' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'with fn and combinable source (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target1", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "}", ")", ";", "const", "target2", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "}", ")", ";", "const", "target3", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Binding element 'a' implicitly has an 'any' type.\n Binding element 'b' implicitly has an 'any' type.\n Parameter 'clock' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'should detect incorrect arguments in fn with combinable source (should fail)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockB", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "sample", "(", "{", "source", ":", "{", "a", "}", ",", "clock", ":", "[", "clockA", ",", "clockB", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "clock", "}", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type '({ a }: { a: number; }, clock: any) => { a: number; clock: any; }' is not assignable to type '((src: { a: string; }, clk: string | void) => any) & (({ a }: { a: number; }, clock: any) => { a: number; clock: any; })'.\n Type '({ a }: { a: number; }, clock: any) => { a: number; clock: any; }' is not assignable to type '(src: { a: string; }, clk: string | void) => any'.\n Types of parameters '__0' and 'src' are incompatible.\n Type '{ a: string; }' is not assignable to type '{ a: number; }'.\n Types of property 'a' are incompatible.\n Type 'string' is not assignable to type 'number'.\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'should detect too wide type of clocks (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clockA", "=", "createEvent", "(", ")", ";", "const", "clockC", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "sample", "(", "{", "source", ",", "clock", ":", "[", "clockA", ",", "clockC", "]", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type '({ a, b }: any, clock: string) => { a: any; b: any; clock: string; }' is not assignable to type '((src: { a: string; b: string; }, clk: string | void) => any) & (({ a, b }: any, clock: string) => { a: any; b: any; clock: string; })'.\n Type '({ a, b }: any, clock: string) => { a: any; b: any; clock: string; }' is not assignable to type '(src: { a: string; b: string; }, clk: string | void) => any'.\n Types of parameters 'clock' and 'clk' are incompatible.\n Type 'string | void' is not assignable to type 'string'.\n Type 'void' is not assignable to type 'string'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
603
[ "import", "{", "createStore", ",", "createEvent", ",", "createEffect", ",", "sample", ",", "Store", ",", "Event", ",", "guard", ",", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "it", "(", "'supports store objects as a source (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports a list of stores as a source (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "[", "a", ",", "b", "]", ",", "clock", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports store objects as a source + mapping (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "a", ".", "toString", "(", ")", "+", "b", "+", "clock", ".", "toString", "(", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports a list of stores as a source + mapping (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "[", "a", ",", "b", "]", ",", "clock", ",", "fn", ":", "(", "[", "a", ",", "b", "]", ",", "clock", ")", "=>", "a", ".", "toString", "(", ")", "+", "b", "+", "clock", ".", "toString", "(", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports store objects as a source + target forwarding (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "number", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports a list of stores as a source + target forwarding (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "[", "number", ",", "string", "]", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "[", "a", ",", "b", "]", ",", "clock", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports store objects as a source + mapping + target forwarding (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ",", "fn", ":", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "a", ".", "toString", "(", ")", "+", "b", "+", "clock", ".", "toString", "(", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports a list of stores as a source + mapping + target forwarding (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "[", "a", ",", "b", "]", ",", "clock", ",", "fn", ":", "(", "[", "a", ",", "b", "]", ",", "clock", ")", "=>", "a", ".", "toString", "(", ")", "+", "b", "+", "clock", ".", "toString", "(", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports store objects as a source (should pass) [non-config sample overload]'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "a", ",", "b", "}", ",", "clock", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports a list of stores as a source (should pass) [non-config sample overload]'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "[", "a", ",", "b", "]", ",", "clock", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports store objects as a source + mapping (should pass) [non-config sample overload]'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "{", "a", ",", "b", "}", ",", "clock", ",", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "a", ".", "toString", "(", ")", "+", "b", "+", "clock", ".", "toString", "(", ")", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'supports a list of stores as a source + mapping (should pass) [non-config sample overload]'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "1", ")", ";", "const", "b", "=", "createStore", "(", "'b'", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "(", "[", "a", ",", "b", "]", ",", "clock", ",", "(", "[", "a", ",", "b", "]", ",", "clock", ")", "=>", "a", ".", "toString", "(", ")", "+", "b", "+", "clock", ".", "toString", "(", ")", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
604
[ "import", "{", "createStore", ",", "createEvent", ",", "createEffect", ",", "sample", ",", "Store", ",", "Event", ",", "guard", ",", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "describe", "(", "'explicit generics'", ",", "(", ")", "=>", "{", "test", "(", "'sample<A, B, R>({source, clock, fn, target})'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "<", "string", ",", "number", ",", "number", ">", "(", "{", "source", ",", "clock", ",", "fn", ":", "str", "=>", "str", ".", "length", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Expected 19 type arguments, but got 3.\n Parameter 'str' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'sample<A, B>({source, fn, target})'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "<", "string", ",", "number", ">", "(", "{", "source", ",", "fn", ":", "str", "=>", "str", ".", "length", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Expected 19 type arguments, but got 2.\n Parameter 'str' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'sample<A>({source, clock, target})'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "<", "string", ">", "(", "{", "source", ",", "clock", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Expected 19 type arguments, but got 1.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'sample<A>({source, target})'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "string", ">", "(", ")", ";", "sample", "<", "string", ">", "(", "{", "source", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Expected 19 type arguments, but got 1.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'sample<A, B, R>({source, clock, fn})'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "result", "=", "sample", "<", "string", ",", "number", ",", "number", ">", "(", "{", "source", ",", "clock", ",", "fn", ":", "(", "str", ",", "num", ")", "=>", "str", ".", "length", "+", "num", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'string' is not assignable to type 'Event<number>'.\n Expected 19 type arguments, but got 3.\n Parameter 'str' implicitly has an 'any' type.\n Parameter 'num' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'sample<A>({source: store, clock})'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "''", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "<", "string", ">", "(", "{", "source", ",", "clock", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Expected 19 type arguments, but got 1.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'sample<A>({source: event, clock})'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "<", "string", ">", "(", "{", "source", ",", "clock", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Expected 19 type arguments, but got 1.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'generic edge cases'", ",", "(", ")", "=>", "{", "test", "(", "'generic edge cases (should pass)'", ",", "(", ")", "=>", "{", "function", "generic1", "<", "A", ",", "B", ">", "(", "target", ",", "clock", ")", "{", "{", "sample", "(", "{", "source", ":", "target", ",", "clock", ",", "target", ",", "}", ")", ";", "const", "result", "=", "sample", "(", "{", "source", ":", "target", ",", "clock", ",", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "source", ":", "target", ",", "clock", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", ",", "target", ",", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "source", ":", "target", ",", "clock", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "clock", ",", "target", ":", "clock", ",", "}", ")", ";", "}", "{", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "Boolean", ",", "target", ",", "}", ")", ";", "const", "result", "=", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "Boolean", ",", "}", ")", ";", "}", "{", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", ",", "target", ",", "}", ")", ";", "const", "result", "=", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", ",", "}", ")", ";", "}", "{", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "(", "source", ",", "clock", ")", "=>", "true", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", ",", "target", ",", "}", ")", ";", "const", "result", "=", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "(", "source", ",", "clock", ")", "=>", "true", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", ",", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'generic edge cases (should fail)'", ",", "(", ")", "=>", "{", "function", "generic1", "<", "A", ",", "B", ">", "(", "target", ",", "clock", ")", "{", "{", "sample", "(", "{", "source", ":", "target", ",", "clock", ",", "target", ":", "clock", ",", "}", ")", ";", "}", "{", "sample", "(", "{", "source", ":", "target", ",", "clock", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", ",", "target", ":", "clock", ",", "}", ")", ";", "}", "{", "sample", "(", "{", "source", ":", "target", ",", "clock", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "clock", ",", "target", ",", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "Boolean", ",", "target", ":", "clock", ",", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "clock", ",", "target", ",", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "clock", ",", "source", ":", "target", ",", "filter", ":", "(", "source", ",", "clock", ")", "=>", "true", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "clock", ",", "target", ",", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '[{ source: Store<A>; clock: Event<B>; target: Event<B>; }]' is not assignable to parameter of type 'TargetOrError<A, \\\\\"src\\\\\", Event<B>, { clock: Event<B>; source: Store<A>; filter?: undefined; target: Event<B>; greedy?: boolean | undefined; } & { source: Store<...>; clock: Event<...>; target: Event<...>; }>'.\n Argument of type '[{ source: Store<A>; clock: Event<B>; fn: (source: A, clock: B) => A; target: Event<B>; }]' is not assignable to parameter of type 'TargetOrError<A, \\\\\"fnRet\\\\\", Event<B>, { clock: Event<B>; source: Store<A>; filter?: undefined; fn: (source: A, clock: B) => A; target: Event<B>; greedy?: boolean | undefined; } & { ...; }>'.\n Argument of type '[{ source: Store<A>; clock: Event<B>; fn: (source: A, clock: B) => B; target: Store<A>; }]' is not assignable to parameter of type 'TargetOrError<B, \\\\\"fnRet\\\\\", Store<A>, { clock: Event<B>; source: Store<A>; filter?: undefined; fn: (source: A, clock: B) => B; target: Store<A>; greedy?: boolean | undefined; } & { ...; }>'.\n Argument of type '[{ clock: Event<B>; source: Store<A>; filter: BooleanConstructor; target: Event<B>; }]' is not assignable to parameter of type 'TargetOrError<NonFalsy<A>, \\\\\"src\\\\\", Event<B>, { clock: Event<B>; source: Store<A>; filter: BooleanConstructor; target: Event<B>; greedy?: boolean | undefined; } & { ...; }>'.\n Argument of type '[{ clock: Event<B>; source: Store<A>; filter: BooleanConstructor; fn: (source: NonFalsy<A>, clock: B) => B; target: Store<A>; }]' is not assignable to parameter of type 'TargetOrError<B, \\\\\"fnRet\\\\\", Store<A>, { clock: Event<B>; source: Store<A>; filter?: BooleanConstructor | undefined; fn?: ((source: NonFalsy<A>, clock: B) => B) | undefined; target: Store<...>; greedy?: boolean | undefined; } & { ...; }>'.\n Argument of type '[{ clock: Event<B>; source: Store<A>; filter: (source: A, clock: B) => true; fn: (source: A, clock: B) => B; target: Store<A>; }]' is not assignable to parameter of type 'TargetOrError<B, \\\\\"fnRet\\\\\", Store<A>, { clock: Event<B>; source: Store<A>; filter?: ((source: A, clock: B) => true) | undefined; fn?: ((source: A, clock: B) => B) | undefined; target: Store<...>; greedy?: boolean | undefined; } & { ...; }>'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "test", "(", "'event by event'", ",", "(", ")", "=>", "{", "const", "a", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "b", "=", "createEvent", "<", "boolean", ">", "(", ")", ";", "const", "c", "=", "sample", "(", "a", ",", "b", ")", ";", "const", "sample_ee_check1", "=", "c", ";", "const", "sample_ee_check2", "=", "c", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Event<number>' is not assignable to type 'Event<string>'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'event by event with handler'", ",", "(", ")", "=>", "{", "const", "a", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "b", "=", "createEvent", "<", "boolean", ">", "(", ")", ";", "const", "c", "=", "sample", "(", "a", ",", "b", ",", "(", "a", ",", "b", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ")", ";", "const", "sample_eeh_check1", "=", "c", ";", "const", "sample_eeh_check2", "=", "c", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Event<{ a: string; b: boolean; }>' is not assignable to type 'Event<string>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: string; b: boolean; }) => any) => Subscription' is not assignable to type '(watcher: (payload: string) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: string; b: boolean; }' is not assignable to type 'string'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'store by event'", ",", "(", ")", "=>", "{", "const", "d", "=", "createStore", "(", "0", ")", ";", "const", "b", "=", "createEvent", "<", "boolean", ">", "(", ")", ";", "const", "e", "=", "sample", "(", "d", ",", "b", ")", ";", "const", "sample_se_check1", "=", "e", ";", "const", "sample_se_check2", "=", "e", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Event<number>' is not assignable to type 'Event<string>'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'store by event with handler'", ",", "(", ")", "=>", "{", "const", "d", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createEvent", "<", "boolean", ">", "(", ")", ";", "const", "e", "=", "sample", "(", "d", ",", "b", ",", "(", "a", ",", "b", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ")", ";", "const", "sample_seh_check1", "=", "e", ";", "const", "sample_seh_check2", "=", "e", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Event<{ a: string; b: boolean; }>' is not assignable to type 'Event<string>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: string; b: boolean; }) => any) => Subscription' is not assignable to type '(watcher: (payload: string) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: string; b: boolean; }' is not assignable to type 'string'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'effect by event'", ",", "(", ")", "=>", "{", "const", "f", "=", "createEffect", "<", "string", ",", "any", ",", "any", ">", "(", ")", ";", "const", "b", "=", "createEvent", "<", "boolean", ">", "(", ")", ";", "const", "g", "=", "sample", "(", "f", ",", "b", ")", ";", "const", "sample_efe_check1", "=", "g", ";", "const", "sample_efe_check2", "=", "g", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Event<string>' is not assignable to type 'Event<number>'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'effect by event with handler'", ",", "(", ")", "=>", "{", "const", "f", "=", "createEffect", "<", "string", ",", "any", ",", "any", ">", "(", ")", ";", "const", "b", "=", "createEvent", "<", "boolean", ">", "(", ")", ";", "const", "g", "=", "sample", "(", "f", ",", "b", ",", "(", "a", ",", "b", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ")", ";", "const", "sample_efeh_check1", "=", "g", ";", "const", "sample_efeh_check2", "=", "g", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Event<{ a: string; b: boolean; }>' is not assignable to type 'Event<number>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: string; b: boolean; }) => any) => Subscription' is not assignable to type '(watcher: (payload: number) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: string; b: boolean; }' is not assignable to type 'number'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'store by store'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "false", ")", ";", "const", "b", "=", "createStore", "(", "0", ")", ";", "const", "c", "=", "sample", "(", "a", ",", "b", ")", ";", "const", "sample_ss_check1", "=", "c", ";", "const", "sample_ss_check2", "=", "c", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Store<boolean>' is not assignable to type 'Store<string>'.\n The types returned by 'getState()' are incompatible between these types.\n Type 'boolean' is not assignable to type 'string'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'store by store with handler'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "true", ")", ";", "const", "c", "=", "sample", "(", "a", ",", "b", ",", "(", "a", ",", "b", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ")", ";", "const", "sample_ssh_check1", "=", "c", ";", "const", "sample_ssh_check2", "=", "c", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Store<{ a: string; b: boolean; }>' is not assignable to type 'Store<string>'.\n The types returned by 'getState()' are incompatible between these types.\n Type '{ a: string; b: boolean; }' is not assignable to type 'string'.\n \"\n `", ")", ";", "}", ")", ";", "describe", "(", "'sample(Store<T>):Store<T>'", ",", "(", ")", "=>", "{", "test", "(", "'correct case (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "sample_s_correct", "=", "sample", "(", "a", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'incorrect case (should fail)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "sample_s_incorrect", "=", "sample", "(", "a", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Store<string>' is not assignable to type 'Store<number>'.\n \"\n `", ")", ";", "}", ")", ";", "describe", "(", "'edge case'", ",", "(", ")", "=>", "{", "test", "(", "'correct case (should pass)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "sample_s_edge_correct", "=", "sample", "(", "a", ",", "clock", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'incorrect case (should fail)'", ",", "(", ")", "=>", "{", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "sample_s_edge_incorrect", "=", "sample", "(", "a", ",", "clock", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Event<string>' is not assignable to type 'Event<number>'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'sample + guard (should pass)'", ",", "(", ")", "=>", "{", "test", "(", "\"directly assign `guard` invocation to `sample`'s `clock` argument without losing inference in `sample`'s `fn` (should pass)\"", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "0", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ":", "guard", "(", "clock", ",", "{", "filter", ":", "clock", "=>", "clock", ">", "0", ",", "}", ")", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", "+", "clock", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "\"directly assign `sample` invocation to `guard`'s `source` argument without losing inference in `guard`'s `filter` (should pass)\"", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "0", ")", ";", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "guard", "(", "{", "source", ":", "sample", "(", "{", "source", ",", "clock", ",", "fn", ":", "(", "source", ",", "clock", ")", "=>", "source", "+", "clock", ",", "}", ")", ",", "filter", ":", "n", "=>", "n", ">", "0", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'edge case (should pass)'", ",", "(", ")", "=>", "{", "function", "debounce", "<", "T", ">", "(", "event", ")", "{", "return", "event", ";", "}", "const", "$store", "=", "createStore", "(", "0", ")", ";", "const", "$flag", "=", "createStore", "(", "false", ")", ";", "const", "trigger", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "target", "=", "createEffect", "<", "{", "field", ":", "number", ";", "data", ":", "number", ";", "}", ",", "void", ">", "(", ")", ";", "guard", "(", "{", "source", ":", "sample", "(", "{", "clock", ":", "debounce", "(", "trigger", ")", ",", "source", ":", "[", "$flag", ",", "$store", "]", ",", "fn", ":", "(", "[", "isAble", ",", "field", "]", ",", "data", ")", "=>", "(", "isAble", "?", "{", "field", ",", "data", "}", ":", "null", ")", ",", "}", ")", ",", "filter", ":", "(", "e", ")", ":", "e", "is", "{", "field", ":", "number", ";", "data", ":", "number", ";", "}", "=>", "!", "!", "e", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Binding element 'isAble' implicitly has an 'any' type.\n Binding element 'field' implicitly has an 'any' type.\n Parameter 'data' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'without clock'", ",", "(", ")", "=>", "{", "test", "(", "'with fn (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "[", "{", "foo", ":", "'ok'", ",", "bar", ":", "0", "}", "]", ")", ";", "const", "target", "=", "createStore", "(", "{", "foo", ":", "'...'", ",", "bar", ":", "1", "}", ")", ";", "sample", "(", "{", "source", ",", "target", ",", "fn", ":", "(", "[", "obj", "]", ")", "=>", "obj", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'with fn [combinable] (should pass)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'ok'", ")", ";", "const", "bar", "=", "createStore", "(", "0", ")", ";", "const", "target", "=", "createStore", "(", "{", "foo", ":", "'...'", ",", "bar", ":", "1", "}", ")", ";", "sample", "(", "{", "source", ":", "{", "foo", ",", "bar", "}", ",", "target", ",", "fn", ":", "(", "{", "foo", ",", "bar", "}", ")", "=>", "(", "{", "foo", ",", "bar", "}", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "(", ")", ";", "const", "fx", "=", "createEffect", "<", "void", ",", "void", ",", "any", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "target", ":", "fx", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn [combinable] (should pass)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'ok'", ")", ";", "const", "bar", "=", "createStore", "(", "0", ")", ";", "const", "target", "=", "createStore", "(", "{", "foo", ":", "'...'", ",", "bar", ":", "1", "}", ")", ";", "sample", "(", "{", "source", ":", "{", "foo", ",", "bar", "}", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn, any to void (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "void", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'clock without source'", ",", "(", ")", "=>", "{", "test", "(", "'with fn (should pass)'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createStore", "(", "[", "{", "foo", ":", "'ok'", ",", "bar", ":", "0", "}", "]", ")", ";", "const", "target", "=", "createStore", "(", "{", "foo", ":", "'...'", ",", "bar", ":", "1", "}", ")", ";", "sample", "(", "{", "clock", ",", "target", ",", "fn", ":", "(", "[", "obj", "]", ")", "=>", "obj", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'with fn [clock array] (should pass)'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createStore", "(", "{", "foo", ":", "'ok'", ",", "bar", ":", "0", "}", ")", ";", "const", "target", "=", "createStore", "(", "{", "foo", ":", "'...'", ",", "bar", ":", "1", "}", ")", ";", "sample", "(", "{", "clock", ":", "[", "clock", "]", ",", "target", ",", "fn", ":", "foo", "=>", "foo", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn (should pass)'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "fx", "=", "createEffect", "<", "number", ",", "void", ",", "any", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "target", ":", "fx", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn [void] (should pass)'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "fx", "=", "createEffect", "<", "void", ",", "void", ",", "any", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "target", ":", "fx", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn [clock array] (should pass)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'ok'", ")", ";", "const", "bar", "=", "createStore", "(", "0", ")", ";", "const", "target", "=", "createEvent", "<", "string", "|", "number", ">", "(", ")", ";", "sample", "(", "{", "clock", ":", "[", "foo", ",", "bar", "]", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn, any to void (should pass)'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "void", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'with fn (should fail)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'ok'", ")", ";", "const", "target", "=", "createStore", "(", "1", ")", ";", "sample", "(", "{", "clock", ":", "foo", ",", "fn", ":", "foo", "=>", "foo", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Store<string>; fn: (foo: string) => string; target: Store<number>; }' is not assignable to parameter of type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: string; targetType: number; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: string; targetType: number; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'with fn [clock array] (should fail)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "0", ")", ";", "const", "bar", "=", "createStore", "(", "1", ")", ";", "const", "target", "=", "createStore", "(", "2", ")", ";", "sample", "(", "{", "clock", ":", "[", "foo", ",", "bar", "]", ",", "fn", ":", "foo", "=>", "true", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Store<number>[]; fn: (foo: number) => boolean; target: Store<number>; }' is not assignable to parameter of type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: boolean; targetType: number; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: boolean; targetType: number; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn (should fail)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'ok'", ")", ";", "const", "target", "=", "createStore", "(", "1", ")", ";", "sample", "(", "{", "clock", ":", "foo", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Store<string>; target: Store<number>; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: string; targetType: number; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: string; targetType: number; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'without fn [clock array] (should fail)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'ok'", ")", ";", "const", "bar", "=", "createStore", "(", "0", ")", ";", "const", "baz", "=", "createStore", "(", "true", ")", ";", "const", "target", "=", "createStore", "(", "1", ")", ";", "sample", "(", "{", "clock", ":", "[", "foo", ",", "bar", ",", "baz", "]", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: (Store<boolean> | Store<number> | Store<string>)[]; target: Store<number>; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: string | number | boolean; targetType: number; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: string | number | boolean; targetType: number; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'sample + .map'", ",", "(", ")", "=>", "{", "test", "(", "'directly assign `.map` result to `source` (should pass)'", ",", "(", ")", "=>", "{", "const", "event", "=", "createEvent", "(", ")", ";", "const", "target", "=", "createStore", "(", "'yes'", ")", ";", "sample", "(", "{", "source", ":", "event", ".", "map", "(", "(", "[", "obj", "]", ")", "=>", "obj", ".", "foo", ")", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'directly assign `.map` result to `source` without losing inference in `fn` (should pass)'", ",", "(", ")", "=>", "{", "const", "event", "=", "createEvent", "(", ")", ";", "const", "a", "=", "createStore", "(", "0", ")", ";", "const", "b", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "event", ".", "map", "(", "(", "[", "obj", "]", ")", "=>", "obj", ".", "foo", ")", ",", "fn", ":", "payload", "=>", "(", "payload", "as", "0", "extends", "1", "&", "typeof", "payload", "?", "never", ":", "typeof", "payload", ")", ".", "length", ",", "target", ":", "[", "a", ",", "b", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "test", "(", "'from unknown to known type (should fail)'", ",", "(", ")", "=>", "{", "const", "emitUnknown", "=", "createEvent", "<", "unknown", ">", "(", ")", ";", "const", "receiveNumber", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "emitUnknown", ",", "target", ":", "receiveNumber", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<unknown>; target: Event<number>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: unknown; targetType: number; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: unknown; targetType: number; }; }'.\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, 46, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 24283, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 24283, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, 204, null, null, null, null, null, null, null, null, null, null, 24283, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, null, null, null, 24283, null, null, null, null, null, null, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, 46, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, 88, null, 204, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, 2, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, 2, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, 2, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, 2, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
605
[ "import", "{", "createStore", ",", "createEvent", ",", "createEffect", ",", "sample", ",", "Store", ",", "Event", ",", "guard", ",", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "test", "(", "'a target receives a more strict value type from a source [with clock] (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'a target receives a more strict value type from a source [without clock] (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'a target receives an equal value type from a source [with clock] (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "<", "{", "a", ":", "string", ";", "b", "?", ":", "string", ";", "}", ">", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", "?", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'a target receives an equal value type from a source [without clock] (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "<", "{", "a", ":", "string", ";", "b", "?", ":", "string", ";", "}", ">", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", "?", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'a target receives a more strict (or equal) value type from a mapping fn [with clock] (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "null", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "fn", "=", "(", ")", "=>", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "fn", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'a target receives a more strict (or equal) value type from a mapping fn [without clock] (should pass)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "null", ")", ";", "const", "fn", "=", "(", ")", "=>", "(", "{", "a", ":", "''", ",", "b", ":", "''", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "fn", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when a target receives a more loose value type from a source [with clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", "}", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<{ a: string; }>; clock: Event<void>; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when a target receives a more loose value type from a source [without clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "a", ":", "''", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<{ a: string; }>; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when a target receives a more loose value type from a mapping fn [with clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "null", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "fn", "=", "(", ")", "=>", "(", "{", "a", ":", "''", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "fn", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<null>; clock: Event<void>; fn: () => { a: string; }; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when a target receives a more loose value type from a mapping fn [without clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "null", ")", ";", "const", "fn", "=", "(", ")", "=>", "(", "{", "a", ":", "''", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "fn", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<null>; fn: () => { a: string; }; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: { a: string; }; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when nullable field passed to strict target [with clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "<", "{", "foo", ":", "string", ";", "bar", ":", "string", "|", "null", ";", "}", ">", "(", "{", "foo", ":", "''", ",", "bar", ":", "null", ",", "}", ")", ";", "const", "clock", "=", "createStore", "<", "string", "|", "null", ">", "(", "null", ")", ";", "const", "target", "=", "createEffect", "<", "{", "foo", ":", "string", ";", "bar", ":", "string", ";", "}", ",", "void", ",", "Error", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<{ foo: string; bar: string | null; }>; clock: Store<string | null>; target: Effect<{ foo: string; bar: string; }, void, Error>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { foo: string; bar: string | null; }; targetType: { foo: string; bar: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { foo: string; bar: string | null; }; targetType: { foo: string; bar: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when nullable field passed to strict target [without clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "<", "{", "foo", ":", "string", ";", "bar", ":", "string", "|", "null", ";", "}", ">", "(", "{", "foo", ":", "''", ",", "bar", ":", "null", ",", "}", ")", ";", "const", "target", "=", "createEffect", "<", "{", "foo", ":", "string", ";", "bar", ":", "string", ";", "}", ",", "void", ",", "Error", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<{ foo: string; bar: string | null; }>; target: Effect<{ foo: string; bar: string; }, void, Error>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { foo: string; bar: string | null; }; targetType: { foo: string; bar: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { foo: string; bar: string | null; }; targetType: { foo: string; bar: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "describe", "(", "'edge case for {} type'", ",", "(", ")", "=>", "{", "test", "(", "'when a target receives a more loose value type from a source [with clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "}", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<{}>; clock: Event<void>; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: {}; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: {}; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when a target receives a more loose value type from a source [without clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "{", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<{}>; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: {}; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: {}; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when a target receives a more loose value type from a mapping fn [with clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "null", ")", ";", "const", "clock", "=", "createEvent", "(", ")", ";", "const", "fn", "=", "(", ")", "=>", "(", "{", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "clock", ",", "fn", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<null>; clock: Event<void>; fn: () => {}; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: {}; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: {}; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'when a target receives a more loose value type from a mapping fn [without clock] (should fail)'", ",", "(", ")", "=>", "{", "const", "source", "=", "createStore", "(", "null", ")", ";", "const", "fn", "=", "(", ")", "=>", "(", "{", "}", ")", ";", "const", "target", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ",", "fn", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Store<null>; fn: () => {}; target: Event<{ a: string; b: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: {}; targetType: { a: string; b: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"fn result should extend target type\\\\\"; targets: { fnResult: {}; targetType: { a: string; b: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
606
[ "import", "{", "createStore", ",", "createEvent", ",", "sample", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "/** used as valid source type */", "type", "AN", "=", "{", "a", ":", "number", ";", "}", ";", "/** used as invalid source type */", "type", "AS", "=", "{", "a", ":", "string", ";", "}", ";", "/** used as valid source type */", "type", "AB", "=", "{", "a", ":", "number", ";", "b", ":", "string", ";", "}", ";", "/** used as invalid source type */", "type", "ABN", "=", "{", "a", ":", "number", ";", "b", ":", "number", ";", "}", ";", "const", "voidt", "=", "createEvent", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "numStr", "=", "createEvent", "<", "number", "|", "string", ">", "(", ")", ";", "const", "strBool", "=", "createEvent", "<", "string", "|", "boolean", ">", "(", ")", ";", "const", "$num", "=", "createStore", "<", "number", ">", "(", "0", ")", ";", "const", "$str", "=", "createStore", "<", "string", ">", "(", "''", ")", ";", "const", "a_num", "=", "createEvent", "<", "AN", ">", "(", ")", ";", "const", "a_str", "=", "createEvent", "<", "AS", ">", "(", ")", ";", "const", "ab", "=", "createEvent", "<", "AB", ">", "(", ")", ";", "const", "abn", "=", "createEvent", "<", "ABN", ">", "(", ")", ";", "const", "l_num", "=", "createEvent", "<", "[", "number", "]", ">", "(", ")", ";", "const", "l_str", "=", "createEvent", "<", "[", "string", "]", ">", "(", ")", ";", "const", "l_num_str", "=", "createEvent", "<", "[", "number", ",", "string", "]", ">", "(", ")", ";", "const", "l_num_num", "=", "createEvent", "<", "[", "number", ",", "number", "]", ">", "(", ")", ";", "const", "fn", "=", "{", "noArgs", ":", "(", ")", "=>", "(", "{", "a", ":", "2", ",", "b", ":", "''", "}", ")", ",", "assertFirst", ":", "{", "object", ":", "{", "solo", ":", "(", "{", "a", "}", ",", "cl", ")", "=>", "(", "{", "a", ":", "cl", ",", "b", ":", "a", "}", ")", ",", "pair", ":", "(", "{", "a", ",", "b", "}", ",", "cl", ")", "=>", "(", "{", "a", ":", "b", "+", "cl", ",", "b", ":", "''", "}", ")", ",", "}", ",", "tuple", ":", "{", "solo", ":", "(", "[", "a", "]", ",", "cl", ")", "=>", "(", "{", "a", ":", "cl", ",", "b", ":", "a", "}", ")", ",", "pair", ":", "(", "[", "a", ",", "b", "]", ",", "cl", ")", "=>", "(", "{", "a", ":", "b", "+", "cl", ",", "b", ":", "''", "}", ")", ",", "}", ",", "}", ",", "assertFirstOnly", ":", "{", "object", ":", "{", "solo", ":", "(", "{", "a", "}", ")", "=>", "(", "{", "a", ":", "0", ",", "b", ":", "a", "}", ")", ",", "pair", ":", "(", "{", "b", "}", ")", "=>", "(", "{", "a", ":", "b", ",", "b", ":", "''", "}", ")", ",", "}", ",", "tuple", ":", "{", "solo", ":", "(", "[", "a", "]", ")", "=>", "(", "{", "a", ":", "2", ",", "b", ":", "a", "}", ")", ",", "pair", ":", "(", "[", ",", "b", "]", ")", "=>", "(", "{", "a", ":", "b", ",", "b", ":", "''", "}", ")", ",", "}", ",", "}", ",", "assertSecond", ":", "{", "object", ":", "{", "solo", ":", "(", "{", "a", "}", ",", "cl", ")", "=>", "(", "{", "a", ",", "b", ":", "cl", "}", ")", ",", "pair", ":", "(", "{", "a", "}", ",", "cl", ")", "=>", "(", "{", "a", ",", "b", ":", "cl", "}", ")", ",", "}", ",", "tuple", ":", "{", "solo", ":", "(", "[", "a", "]", ",", "cl", ")", "=>", "(", "{", "a", ",", "b", ":", "cl", "}", ")", ",", "pair", ":", "(", "[", "a", "]", ",", "cl", ")", "=>", "(", "{", "a", ",", "b", ":", "cl", "}", ")", ",", "}", ",", "}", ",", "typedSrc", ":", "{", "object", ":", "{", "solo", ":", "(", "{", "a", "}", ")", "=>", "(", "{", "a", ",", "b", ":", "''", "}", ")", ",", "pair", ":", "(", "{", "a", ",", "b", "}", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ",", "}", ",", "tuple", ":", "{", "solo", ":", "(", "[", "a", "]", ")", "=>", "(", "{", "a", ",", "b", ":", "''", "}", ")", ",", "pair", ":", "(", "[", "a", ",", "b", "]", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ",", "}", ",", "}", ",", "typedSrcClock", ":", "{", "object", ":", "{", "solo", ":", "(", "{", "a", "}", ",", "cl", ")", "=>", "(", "{", "a", ":", "a", "+", "cl", ",", "b", ":", "''", "}", ")", ",", "pair", ":", "(", "{", "a", ",", "b", "}", ",", "cl", ")", "=>", "(", "{", "a", ":", "a", "+", "cl", ",", "b", "}", ")", ",", "}", ",", "tuple", ":", "{", "solo", ":", "(", "[", "a", "]", ",", "cl", ")", "=>", "(", "{", "a", ":", "a", "+", "cl", ",", "b", ":", "''", "}", ")", ",", "pair", ":", "(", "[", "a", ",", "b", "]", ",", "cl", ")", "=>", "(", "{", "a", ":", "a", "+", "cl", ",", "b", "}", ")", ",", "}", ",", "}", ",", "}", ";", "describe", "(", "'basic cases'", ",", "(", ")", "=>", "{", "describe", "(", "'no fn'", ",", "(", ")", "=>", "{", "test", "(", "'no fn (should pass)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "anyt", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "numStr", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "numStr", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "numStr", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "anyt", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "anyt", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "str", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "str", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "str", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "str", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "numStr", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "str", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "numStr", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "str", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "numStr", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "anyt", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "anyt", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "anyt", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "anyt", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "numStr", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "numStr", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "anyt", ",", "numStr", "]", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'no fn (should fail)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "str", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "str", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "num", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "str", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "str", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "str", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "num", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "voidt", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "strBool", ",", "numStr", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "num", ",", "target", ":", "[", "str", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "str", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "voidt", ",", "strBool", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "num", ",", "clock", ":", "str", ",", "target", ":", "[", "strBool", ",", "numStr", "]", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<number>; target: (Event<number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | boolean>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | boolean>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<number>; target: Event<number>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<string>; target: Event<number>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: Event<string>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<number>; target: (Event<void> | Event<number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<void>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<void>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<string>; target: (Event<number> | Event<string | number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | number>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | number>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<string>; target: (Event<number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | boolean>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | boolean>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<string>; target: (Event<any> | Event<number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<any>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<any>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<string>; target: (Event<number> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<string>; target: (Event<void> | Event<number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<void>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<void>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: Event<string>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<number>; target: (Event<number> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<number>; target: (Event<any> | Event<number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<any>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<any>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<number> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<number> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<string>; clock: Event<number>; target: (Event<number> | Event<string | number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | number>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: string; targetType: number; }, Event<string | number>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<void> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<void>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<void>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<void> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<void>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<void>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string | boolean; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string | boolean; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<string> | Event<string | number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<string | number>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<string | number>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<string> | Event<string | number>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<string | number>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<string | number>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<void> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<void>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<void>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: Event<string | boolean>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: Event<string | boolean>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string | boolean; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<number>, { sourceType: number; targetType: string | boolean; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<any> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<any>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<any>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<void> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<void>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<void>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<void> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, { sourceType: number; targetType: string | boolean; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, { sourceType: number; targetType: string | boolean; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<any> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<any>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<any>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<string | number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<string | number>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<string | number>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<number>; target: (Event<any> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<any>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<any>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<any> | Event<string>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<any>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string; }, Event<any>]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<void> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, { sourceType: number; targetType: string | boolean; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, { sourceType: number; targetType: string | boolean; }]; }'.\n Argument of type '{ filter: () => boolean; source: Event<number>; clock: Event<string>; target: (Event<string | number> | Event<string | boolean>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<string | number>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: number; targetType: string | boolean; }, Event<string | number>]; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'combinable'", ",", "(", ")", "=>", "{", "describe", "(", "'source:wide'", ",", "(", ")", "=>", "{", "test", "(", "'source:wide (should pass)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "a_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "a_num", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num", ",", "l_num_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", ",", "l_num_str", "]", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'source:wide (should fail)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "a_num", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "abn", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "a_num", ",", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "abn", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "ab", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "target", ":", "[", "a_str", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "abn", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "ab", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", ",", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "abn", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_str", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", ",", "b", ":", "$str", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num_str", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num_num", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "target", ":", "[", "l_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_str", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_num", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", ",", "$str", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_num", "]", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: Event<ABN>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: (Event<AN> | Event<AS>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: (Event<AS> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: Event<AS>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: (Event<AN> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: (Event<AB> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, Event<AB>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, Event<AB>]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AB>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AB>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }, Event<AB>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }, Event<AB>]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: Event<ABN>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: (Event<AS> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AB>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AB>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: Event<AS>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: (Event<AN> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: (Event<AB> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, Event<AB>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: ABN; }, Event<AB>]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }, Event<AB>]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; b: string; }; targetType: AS; }, Event<AB>]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; b: Store<string>; }; clock: Event<number>; target: (Event<AN> | Event<AS>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; b: string; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: Event<[string]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: (Event<[number]> | Event<[string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: (Event<[number, string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: (Event<[number]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: (Event<[string]> | Event<[number, string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: Event<[number, number]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: Event<[string]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: (Event<[number]> | Event<[string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: (Event<[number]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: (Event<[string]> | Event<[number, string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }, { sourceType: [number, string]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [string]; }, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: (Event<[number, string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number, string]>, { sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: (Store<number> | Store<string>)[]; clock: Event<number>; target: Event<[number, number]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number, string]; targetType: [number, number]; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'source:same'", ",", "(", ")", "=>", "{", "test", "(", "'source:same (should pass)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "a_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", "]", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'source:same (should fail)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "a_num", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "a_num", ",", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "a_num", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "a_str", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "abn", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "abn", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "ab", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", ",", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "abn", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "abn", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "abn", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "ab", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", ",", "a_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_num", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "a_str", ",", "ab", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num", ",", "l_num_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num_str", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "target", ":", "[", "l_num_num", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", ",", "l_num_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_str", ",", "l_str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_str", ",", "l_num_num", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "[", "$num", "]", ",", "clock", ":", "num", ",", "target", ":", "[", "l_num_num", ",", "l_str", "]", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: Event<AS>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: Event<ABN>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: Event<AB>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: (Event<AN> | Event<AS>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: (Event<AN> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: (Event<AN> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: (Event<AS> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: (Event<AB> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: Event<AS>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: (Event<AN> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: (Event<AB> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: (Event<AS> | Event<ABN>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: Event<ABN>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: ABN; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: (Event<AN> | Event<AS>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AS; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: (Event<AN> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<AN>, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: Event<AB>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: { a: Store<number>; }; clock: Event<number>; target: (Event<AS> | Event<AB>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: { a: number; }; targetType: AS; }, { sourceType: { a: number; }; targetType: AB; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: Event<[string]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: Event<[number, string]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: Event<[number, number]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: (Event<[number]> | Event<[string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: (Event<[number]> | Event<[number, string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: (Event<[number]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: (Event<[string]> | Event<[number, string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: (Event<[number, string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: Event<[string]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: Event<[number, string]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: Event<[number, number]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: (Event<[number]> | Event<[string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: (Event<[number]> | Event<[number, string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: (Event<[number]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<[number]>, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: (Event<[string]> | Event<[number, string]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: (Event<[number, string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, string]; }, { sourceType: [number]; targetType: [number, number]; }]; }'.\n Argument of type '{ filter: () => boolean; source: Store<number>[]; clock: Event<number>; target: (Event<[string]> | Event<[number, number]>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n Object literal may only specify known properties, and 'filter' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [number]; targetType: [number, number]; }, { sourceType: [number]; targetType: [string]; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
607
[ "import", "{", "createStore", ",", "createEvent", ",", "sample", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "type", "AB", "=", "{", "a", ":", "string", ";", "b", ":", "number", ";", "}", ";", "const", "voidt", "=", "createEvent", "(", ")", ";", "const", "anyt", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "str", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "strClk", "=", "createEvent", "<", "string", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "a", "=", "createStore", "(", "''", ")", ";", "const", "b", "=", "createStore", "(", "0", ")", ";", "const", "aTarget", "=", "createEvent", "<", "{", "a", ":", "string", ";", "}", ">", "(", ")", ";", "const", "abTarget", "=", "createEvent", "<", "AB", ">", "(", ")", ";", "const", "aclock", "=", "createEvent", "<", "{", "a", ":", "string", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "abclock", "=", "createEvent", "<", "{", "a", ":", "string", ";", "b", ":", "number", ";", "clock", ":", "any", ";", "}", ">", "(", ")", ";", "const", "fnAbClockString", "=", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ";", "const", "fnAbClockAny", "=", "(", "{", "a", ",", "b", "}", ",", "clock", ")", "=>", "(", "{", "a", ",", "b", ",", "clock", "}", ")", ";", "const", "fnAString", "=", "(", "a", ")", "=>", "(", "{", "a", "}", ")", ";", "const", "fnAStringClockString", "=", "(", "a", ",", "clock", ")", "=>", "(", "{", "a", ",", "clock", "}", ")", ";", "const", "fnAStringClockAny", "=", "(", "a", ",", "clock", ")", "=>", "(", "{", "a", ",", "clock", "}", ")", ";", "const", "fnAb", "=", "(", "{", "a", ",", "b", "}", ")", "=>", "(", "{", "a", ",", "b", "}", ")", ";", "describe", "(", "'clock only'", ",", "(", ")", "=>", "{", "test", "(", "'noSource (should pass)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "strClk", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "anyt", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "[", "strClk", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "[", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "[", "strClk", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "strClk", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "anyt", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "[", "strClk", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "[", "anyt", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "clock", ":", "[", "strClk", ",", "anyt", "]", ",", "target", ":", "str", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "test", "(", "'noClock (should pass)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "target", ":", "abTarget", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "' (should pass)'", ",", "(", ")", "=>", "{", "{", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "str", ",", "voidt", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", ",", "str", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "anyt", ",", "str", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", ",", "anyt", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "str", ",", "anyt", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "anyt", ",", "voidt", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "anyt", ",", "str", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", ",", "anyt", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "anyt", ",", "voidt", ",", "str", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", ",", "str", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "str", ",", "anyt", ",", "voidt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "str", ",", "voidt", ",", "anyt", "]", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "str", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", ",", "str", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "str", ",", "voidt", ",", "anyt", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", ",", "anyt", ",", "str", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "anyt", ",", "str", ",", "voidt", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "voidt", ",", "str", ",", "anyt", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "str", ",", "anyt", ",", "voidt", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "anyt", ",", "voidt", ",", "str", "]", ",", "target", ":", "str", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "str", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", ",", "str", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", ",", "str", ",", "anyt", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "anyt", ",", "voidt", ",", "str", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "str", ",", "voidt", ",", "anyt", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "str", ",", "anyt", ",", "voidt", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "voidt", ",", "anyt", ",", "str", "]", ",", "target", ":", "abTarget", "}", ")", ";", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ",", "b", "}", ",", "clock", ":", "[", "anyt", ",", "str", ",", "voidt", "]", ",", "target", ":", "abTarget", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
608
[ "import", "{", "createStore", ",", "createEvent", ",", "createEffect", ",", "sample", ",", "Store", ",", "Event", ",", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "test", "(", "'clock param name in the function'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "(", "'no'", ")", ";", "const", "result1", "=", "sample", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "const", "result2", "=", "sample", "(", "{", "source", ":", "trigger", ",", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "const", "result3", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<number>; filter: Store<string>; }' is not assignable to parameter of type '{ error: \\\\\"filter unit should has boolean type\\\\\"; got: string; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"filter unit should has boolean type\\\\\"; got: string; }'.\n Argument of type '{ source: Event<number>; clock: Event<number>; filter: Store<string>; }' is not assignable to parameter of type '{ error: \\\\\"filter unit should has boolean type\\\\\"; got: string; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"filter unit should has boolean type\\\\\"; got: string; }'.\n Argument of type '{ clock: Event<number>; filter: Store<string>; }' is not assignable to parameter of type '{ error: \\\\\"filter unit should has boolean type\\\\\"; got: string; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"filter unit should has boolean type\\\\\"; got: string; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'custom typeguards: target array support (1)'", ",", "(", ")", "=>", "{", "function", "debounce", "<", "T", ">", "(", "event", ")", "{", "return", "event", ";", "}", "const", "$store", "=", "createStore", "<", "string", "|", "number", ">", "(", "0", ")", ";", "const", "$flag", "=", "createStore", "(", "false", ")", ";", "const", "trigger", "=", "createEvent", "<", "{", "a", ":", "number", ";", "}", ">", "(", ")", ";", "const", "targetA", "=", "createEffect", "<", "{", "field", ":", "number", "|", "string", ";", "data", ":", "number", ";", "}", ",", "void", ">", "(", ")", ";", "const", "targetB", "=", "createEvent", "<", "{", "field", ":", "number", "|", "string", ";", "data", ":", "string", ";", "}", ">", "(", ")", ";", "const", "targetC", "=", "createEvent", "<", "{", "field", ":", "unknown", ";", "data", ":", "number", ";", "}", ">", "(", ")", ";", "const", "targetD", "=", "createEvent", "<", "{", "field", ":", "number", ";", "data", ":", "number", ";", "}", ">", "(", ")", ";", "const", "targetE", "=", "createEvent", "<", "{", "field", ":", "any", ";", "}", ">", "(", ")", ";", "const", "targetF", "=", "createEvent", "<", "{", "field", ":", "any", ";", "data", ":", "any", ";", "extra", ":", "boolean", ";", "}", ">", "(", ")", ";", "const", "targetVoid", "=", "createEvent", "(", ")", ";", "const", "targetAny", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "res", "=", "sample", "(", "{", "source", ":", "sample", "(", "{", "clock", ":", "debounce", "(", "trigger", ")", ",", "source", ":", "[", "$flag", ",", "$store", "]", ",", "fn", ":", "(", "[", "isAble", ",", "field", "]", ",", "data", ")", "=>", "(", "isAble", "?", "{", "field", ",", "data", "}", ":", "null", ")", ",", "}", ")", ",", "filter", ":", "(", "e", ")", ":", "e", "is", "{", "field", ":", "number", "|", "string", ";", "data", ":", "number", ";", "}", "=>", "!", "!", "e", ",", "target", ":", "[", "targetVoid", ",", "targetA", ",", "targetB", ",", "targetC", ",", "targetD", ",", "targetE", ",", "targetF", ",", "targetAny", ",", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<{ field: any; data: any; } | null>; filter: (e: { field: any; data: any; } | null) => e is { field: string | number; data: number; }; target: (Event<any> | Event<void> | ... 5 more ... | Event<...>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, Effect<{ field: string | number; data: number; }, void, Error>, { sourceType: { field: string | number; data: number; }; targetType: { ...; }; }, ... 4 more ..., Event<...>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, Effect<{ field: string | number; data: number; }, void, Error>, { sourceType: { field: string | number; data: number; }; targetType: { ...; }; }, ... 4 more ..., Event<...>]; }'.\n Binding element 'isAble' implicitly has an 'any' type.\n Binding element 'field' implicitly has an 'any' type.\n Parameter 'data' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'custom typeguards: target array support (2)'", ",", "(", ")", "=>", "{", "function", "debounce", "<", "T", ">", "(", "event", ")", "{", "return", "event", ";", "}", "const", "$store", "=", "createStore", "<", "string", "|", "number", ">", "(", "0", ")", ";", "const", "$flag", "=", "createStore", "(", "false", ")", ";", "const", "trigger", "=", "createEvent", "<", "{", "a", ":", "number", ";", "}", ">", "(", ")", ";", "const", "targetA", "=", "createEffect", "<", "{", "field", ":", "number", "|", "string", ";", "data", ":", "number", ";", "}", ",", "void", ">", "(", ")", ";", "const", "targetB", "=", "createEvent", "<", "{", "field", ":", "number", "|", "string", ";", "data", ":", "string", ";", "}", ">", "(", ")", ";", "const", "targetC", "=", "createEvent", "<", "{", "field", ":", "unknown", ";", "data", ":", "number", ";", "}", ">", "(", ")", ";", "const", "targetD", "=", "createEvent", "<", "{", "field", ":", "string", ";", "data", ":", "number", ";", "}", ">", "(", ")", ";", "const", "targetE", "=", "createEvent", "<", "{", "field", ":", "any", ";", "}", ">", "(", ")", ";", "const", "targetF", "=", "createEvent", "<", "{", "field", ":", "any", ";", "data", ":", "any", ";", "extra", ":", "boolean", ";", "}", ">", "(", ")", ";", "const", "targetVoid", "=", "createEvent", "(", ")", ";", "const", "targetAny", "=", "createEvent", "<", "any", ">", "(", ")", ";", "const", "res", "=", "sample", "(", "{", "source", ":", "sample", "(", "{", "clock", ":", "debounce", "(", "trigger", ")", ",", "source", ":", "[", "$flag", ",", "$store", "]", ",", "fn", ":", "(", "[", "isAble", ",", "field", "]", ",", "data", ")", "=>", "(", "isAble", "?", "{", "field", ",", "data", "}", ":", "null", ")", ",", "}", ")", ",", "filter", ":", "(", "e", ")", ":", "e", "is", "{", "field", ":", "number", ";", "data", ":", "number", ";", "}", "=>", "!", "!", "e", ",", "target", ":", "[", "targetVoid", ",", "targetA", ",", "targetB", ",", "targetC", ",", "targetD", ",", "targetE", ",", "targetF", ",", "targetAny", ",", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<{ field: any; data: any; } | null>; filter: (e: { field: any; data: any; } | null) => e is { field: number; data: number; }; target: (Event<any> | Event<void> | Effect<...> | ... 4 more ... | Event<...>)[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, Effect<{ field: string | number; data: number; }, void, Error>, { sourceType: { field: number; data: number; }; targetType: { ...; }; }, ... 4 more ..., Event<...>]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [Event<void>, Effect<{ field: string | number; data: number; }, void, Error>, { sourceType: { field: number; data: number; }; targetType: { ...; }; }, ... 4 more ..., Event<...>]; }'.\n Binding element 'isAble' implicitly has an 'any' type.\n Binding element 'field' implicitly has an 'any' type.\n Parameter 'data' implicitly has an 'any' type.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'generic support'", ",", "(", ")", "=>", "{", "const", "source", "=", "createEvent", "<", "null", "|", "number", ">", "(", ")", ";", "const", "target", "=", "createEvent", "<", "number", ">", "(", ")", ";", "function", "filter", "<", "T", ">", "(", "value", ")", "{", "return", "value", "!=", "null", ";", "}", "sample", "(", "{", "source", ",", "filter", ",", "target", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "describe", "(", "'function without argument support'", ",", "(", ")", "=>", "{", "const", "target", "=", "createEvent", "<", "string", ">", "(", ")", ";", "test", "(", "'filter function'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "source", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "source", ",", "filter", ":", "arg", "=>", "arg", ">", "0", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "sample", "(", "{", "clock", ",", "filter", ":", "arg", "=>", "arg", ">", "0", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "sample", "(", "{", "source", ",", "filter", ":", "arg", "=>", "arg", ">", "0", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'filter infer'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "const", "source", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "source", ",", "filter", ":", "(", "arg", ")", ":", "arg", "is", "number", "=>", "typeof", "arg", "===", "'number'", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "sample", "(", "{", "clock", ",", "filter", ":", "(", "arg", ")", ":", "arg", "is", "number", "=>", "typeof", "arg", "===", "'number'", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "sample", "(", "{", "source", ",", "filter", ":", "(", "arg", ")", ":", "arg", "is", "number", "=>", "typeof", "arg", "===", "'number'", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'filter bool'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "const", "source", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "source", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "sample", "(", "{", "clock", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "sample", "(", "{", "source", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'filter function + target'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "source", "=", "createEvent", "<", "number", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "source", ",", "filter", ":", "arg", "=>", "arg", ">", "0", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "clock", ",", "filter", ":", "arg", "=>", "arg", ">", "0", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "source", ",", "filter", ":", "arg", "=>", "arg", ">", "0", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'filter infer + target'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "const", "source", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "source", ",", "filter", ":", "(", "arg", ")", ":", "arg", "is", "number", "=>", "typeof", "arg", "===", "'number'", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "clock", ",", "filter", ":", "(", "arg", ")", ":", "arg", "is", "number", "=>", "typeof", "arg", "===", "'number'", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "source", ",", "filter", ":", "(", "arg", ")", ":", "arg", "is", "number", "=>", "typeof", "arg", "===", "'number'", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'filter bool + target'", ",", "(", ")", "=>", "{", "const", "clock", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "const", "source", "=", "createEvent", "<", "number", "|", "null", ">", "(", ")", ";", "sample", "(", "{", "clock", ",", "source", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "clock", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "source", ",", "filter", ":", "Boolean", ",", "fn", ":", "(", ")", "=>", "'ok'", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'difference in behavior between typed and untyped filters/functions combinations'", ",", "(", ")", "=>", "{", "type", "AN", "=", "{", "a", ":", "number", ";", "}", ";", "const", "aNumNull", "=", "createEvent", "<", "AN", "|", "null", ">", "(", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "aNum", "=", "createEvent", "<", "number", ">", "(", ")", ";", "describe", "(", "'with target'", ",", "(", ")", "=>", "{", "test", "(", "'typed filter, untyped fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "target", ":", "aNum", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'typed filter, typed fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "target", ":", "aNum", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'untyped filter, untyped fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "target", ":", "aNum", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Property 'a' does not exist on type 'AN | null'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'untyped filter, typed fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "target", ":", "aNum", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'without target'", ",", "(", ")", "=>", "{", "test", "(", "'typed filter, untyped fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'typed filter, typed fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'untyped filter, untyped fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Property 'a' does not exist on type 'AN | null'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'untyped filter, typed fn'", ",", "(", ")", "=>", "{", "sample", "(", "{", "clock", ":", "num", ",", "source", ":", "aNumNull", ",", "filter", ":", "(", "val", ")", ":", "val", "is", "AN", "=>", "val", "!==", "null", ",", "fn", ":", "(", "{", "a", "}", ")", "=>", "a", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, 37, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 614, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, 11, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2923, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2923, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
609
[ "import", "{", "createStore", ",", "createEvent", ",", "sample", ",", "Event", ",", "Store", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "type", "AN", "=", "{", "a", ":", "number", ";", "}", ";", "const", "$num", "=", "createStore", "(", "0", ")", ";", "const", "a", "=", "createStore", "(", "{", "a", ":", "0", "}", ")", ";", "const", "num", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "aNum", "=", "createEvent", "<", "AN", ">", "(", ")", ";", "const", "aT", "=", "createStore", "(", "{", "a", ":", "0", "}", ")", ";", "const", "aNumT", "=", "createEvent", "<", "AN", ">", "(", ")", ";", "const", "fn0", "=", "(", ")", "=>", "(", "{", "a", ":", "0", "}", ")", ";", "const", "fn1", "=", "(", "{", "a", "}", ")", "=>", "(", "{", "a", "}", ")", ";", "const", "fn2", "=", "(", "{", "a", "}", ",", "c", ")", "=>", "(", "{", "a", ":", "a", "+", "c", "}", ")", ";", "describe", "(", "'no target'", ",", "(", ")", "=>", "{", "test", "(", "'no target, none clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'no target, event clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "num", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "num", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'no target, store clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "$num", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "$num", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "$num", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'no target, tuple clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "[", "num", ",", "$num", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "num", ",", "$num", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "[", "num", ",", "$num", "]", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'unit target'", ",", "(", ")", "=>", "{", "test", "(", "'unit target, none clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "aT", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unit target, event clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "num", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "num", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "num", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "num", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "aT", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unit target, store clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "$num", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "$num", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "$num", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "$num", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "$num", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "$num", ",", "target", ":", "aT", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unit target, tuple clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "aT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "aNumT", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "aT", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'tuple target'", ",", "(", ")", "=>", "{", "test", "(", "'tuple target, none clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'tuple target, event clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "num", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "num", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "num", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'tuple target, store clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "$num", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "$num", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "$num", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'tuple target, tuple clock (should pass)'", ",", "(", ")", "=>", "{", "{", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "aNum", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "a", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "{", "const", "result", "=", "sample", "(", "{", "filter", ":", "(", ")", "=>", "true", ",", "source", ":", "{", "a", ":", "$num", "}", ",", "clock", ":", "[", "num", ",", "$num", "]", ",", "target", ":", "[", "aNumT", ",", "aT", "]", "}", ")", ";", "}", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
610
[ "import", "{", "createStore", ",", "createEvent", ",", "sample", ",", "Event", "}", "from", "'effector'", ";", "const", "typecheck", "=", "'{global}'", ";", "test", "(", "'wide union (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Event<{ a: 1; } | { a: 2; } | { a: 3; }>; filter: Store<boolean>; target: Event<{ a: 1; } | { a: 2; }>; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: { a: 1; } | { a: 2; } | { a: 3; }; targetType: { a: 1; } | { a: 2; }; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: { a: 1; } | { a: 2; } | { a: 3; }; targetType: { a: 1; } | { a: 2; }; }; }'.\n Type 'Event<{ a: 1; } | { a: 2; } | { a: 3; }>' is not assignable to type 'Event<{ a: 1; } | { a: 2; }>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: 1; } | { a: 2; } | { a: 3; }) => any) => Subscription' is not assignable to type '(watcher: (payload: { a: 1; } | { a: 2; }) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: 1; } | { a: 2; } | { a: 3; }' is not assignable to type '{ a: 1; } | { a: 2; }'.\n Argument of type '{ clock: Event<{ a: 1; } | { a: 2; } | { a: 3; }>; filter: Store<boolean>; target: Event<{ a: 1; } | { a: 2; }>[]; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: { a: 1; } | { a: 2; } | { a: 3; }; targetType: { a: 1; } | { a: 2; }; }]; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: { a: 1; } | { a: 2; } | { a: 3; }; targetType: { a: 1; } | { a: 2; }; }]; }'.\n Type 'Event<{ a: 1; } | { a: 2; } | { a: 3; }>' is not assignable to type '[Event<{ a: 1; } | { a: 2; }>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow union (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unknown type in source (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Event<unknown>; filter: Store<boolean>; target: Event<string>; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: unknown; targetType: string; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: unknown; targetType: string; }; }'.\n Type 'Event<unknown>' is not assignable to type 'Event<string>'.\n Argument of type '{ clock: Event<unknown>; filter: Store<boolean>; target: Event<string>[]; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: unknown; targetType: string; }]; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: unknown; targetType: string; }]; }'.\n Type 'Event<unknown>' is not assignable to type '[Event<string>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unknown type in target (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'optional props (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Event<{ a: 1; b?: 2 | undefined; }>; filter: Store<boolean>; target: Event<{ a: 1; b: 2; }>; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: { a: 1; b?: 2 | undefined; }; targetType: { a: 1; b: 2; }; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: { a: 1; b?: 2 | undefined; }; targetType: { a: 1; b: 2; }; }; }'.\n Type 'Event<{ a: 1; b?: 2 | undefined; }>' is not assignable to type 'Event<{ a: 1; b: 2; }>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: 1; b?: 2 | undefined; }) => any) => Subscription' is not assignable to type '(watcher: (payload: { a: 1; b: 2; }) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: 1; b?: 2 | undefined; }' is not assignable to type '{ a: 1; b: 2; }'.\n Argument of type '{ clock: Event<{ a: 1; b?: 2 | undefined; }>; filter: Store<boolean>; target: Event<{ a: 1; b: 2; }>[]; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: { a: 1; b?: 2 | undefined; }; targetType: { a: 1; b: 2; }; }]; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: { a: 1; b?: 2 | undefined; }; targetType: { a: 1; b: 2; }; }]; }'.\n Type 'Event<{ a: 1; b?: 2 | undefined; }>' is not assignable to type '[Event<{ a: 1; b: 2; }>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'wide object (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow object (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Event<{ a: 1; b: 2; }>; filter: Store<boolean>; target: Event<{ a: 1; b: 2; c: 3; }>; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: { a: 1; b: 2; }; targetType: { a: 1; b: 2; c: 3; }; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: { a: 1; b: 2; }; targetType: { a: 1; b: 2; c: 3; }; }; }'.\n Type 'Event<{ a: 1; b: 2; }>' is not assignable to type 'Event<{ a: 1; b: 2; c: 3; }>'.\n Types of property 'watch' are incompatible.\n Type '(watcher: (payload: { a: 1; b: 2; }) => any) => Subscription' is not assignable to type '(watcher: (payload: { a: 1; b: 2; c: 3; }) => any) => Subscription'.\n Types of parameters 'watcher' and 'watcher' are incompatible.\n Types of parameters 'payload' and 'payload' are incompatible.\n Type '{ a: 1; b: 2; }' is not assignable to type '{ a: 1; b: 2; c: 3; }'.\n Argument of type '{ clock: Event<{ a: 1; b: 2; }>; filter: Store<boolean>; target: Event<{ a: 1; b: 2; c: 3; }>[]; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: { a: 1; b: 2; }; targetType: { a: 1; b: 2; c: 3; }; }]; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: { a: 1; b: 2; }; targetType: { a: 1; b: 2; c: 3; }; }]; }'.\n Type 'Event<{ a: 1; b: 2; }>' is not assignable to type '[Event<{ a: 1; b: 2; c: 3; }>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow object combined (should fail)'", ",", "(", ")", "=>", "{", "const", "foo", "=", "createStore", "(", "'not enough'", ")", ";", "const", "target", "=", "createEvent", "<", "{", "foo", ":", "string", ";", "bar", ":", "string", ";", "}", ">", "(", ")", ";", "sample", "(", "{", "source", ":", "{", "foo", "}", ",", "filter", ":", "(", ")", "=>", "true", ",", "target", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: { foo: Store<string>; }; filter: () => boolean; target: Event<{ foo: string; bar: string; }>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { foo: string; }; targetType: { foo: string; bar: string; }; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: { foo: string; }; targetType: { foo: string; bar: string; }; }; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'wide tuple (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow tuple (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "source", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ source: Event<[1, 2]>; filter: Store<boolean>; target: Event<[1, 2, 3]>; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: [1, 2]; targetType: [1, 2, 3]; }; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: { sourceType: [1, 2]; targetType: [1, 2, 3]; }; }'.\n Argument of type '{ source: Event<[1, 2]>; filter: Store<boolean>; target: Event<[1, 2, 3]>[]; }' is not assignable to parameter of type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [1, 2]; targetType: [1, 2, 3]; }]; }'.\n Object literal may only specify known properties, and 'source' does not exist in type '{ error: \\\\\"source should extend target type\\\\\"; targets: [{ sourceType: [1, 2]; targetType: [1, 2, 3]; }]; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'wide union in array (should fail)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "const", "result1", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "const", "result2", "=", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '{ clock: Event<(string | number | boolean)[]>; filter: Store<boolean>; target: Event<(string | number)[]>; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: (string | number | boolean)[]; targetType: (string | number)[]; }; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: { clockType: (string | number | boolean)[]; targetType: (string | number)[]; }; }'.\n Type 'Event<(string | number | boolean)[]>' is not assignable to type 'Event<(string | number)[]>'.\n Argument of type '{ clock: Event<(string | number | boolean)[]>; filter: Store<boolean>; target: Event<(string | number)[]>[]; }' is not assignable to parameter of type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: (string | number | boolean)[]; targetType: (string | number)[]; }]; }'.\n Object literal may only specify known properties, and 'clock' does not exist in type '{ error: \\\\\"clock should extend target type\\\\\"; targets: [{ clockType: (string | number | boolean)[]; targetType: (string | number)[]; }]; }'.\n Type 'Event<(string | number | boolean)[]>' is not assignable to type '[Event<(string | number)[]>]'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'narrow union in array (should pass)'", ",", "(", ")", "=>", "{", "const", "trigger", "=", "createEvent", "(", ")", ";", "const", "allow", "=", "createStore", "<", "boolean", ">", "(", "true", ")", ";", "const", "target", "=", "createEvent", "(", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ",", "}", ")", ";", "sample", "(", "{", "clock", ":", "trigger", ",", "filter", ":", "allow", ",", "target", ":", "[", "target", "]", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
611
[ "import", "*", "as", "React", "from", "'react'", ";", "import", "{", "createStore", ",", "createEvent", ",", "createEffect", "}", "from", "'effector'", ";", "import", "{", "createComponent", ",", "createGate", ",", "useGate", ",", "useEvent", "}", "from", "'effector-react'", ";", "const", "typecheck", "=", "'{global}'", ";", "test", "(", "'createComponent'", ",", "(", ")", "=>", "{", "const", "ImplicitObject", "=", "createComponent", "(", "{", "a", ":", "createStore", "<", "number", ">", "(", "0", ")", ",", "b", ":", "createStore", "<", "number", ">", "(", "1", ")", ",", "}", ",", "(", "props", ",", "state", ")", "=>", "{", "const", "createComponent_implicitObject_check1", "=", "state", ".", "a", ";", "const", "createComponent_implicitObject_check2", "=", "state", ".", "b", ";", "return", "null", ";", "}", ")", ";", "const", "Store", "=", "createComponent", "(", "createStore", "(", "0", ")", ",", "(", "props", ",", "state", ")", "=>", "{", "const", "createComponent_createStore_check1", "=", "state", ";", "return", "null", ";", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'createGate'", ",", "(", ")", "=>", "{", "const", "Foo", "=", "createGate", "<", "number", ">", "(", "'foo'", ")", ";", "const", "Bar", "=", "createGate", "<", "{", "a", ":", "number", ";", "}", ">", "(", "'bar'", ")", ";", "const", "Baz", "=", "createGate", "<", "number", "|", "null", ">", "(", "'baz'", ",", "null", ")", ";", "const", "Component", "=", "(", ")", "=>", "{", "useGate", "(", "Foo", ",", "1", ")", ";", "useGate", "(", "Bar", ",", "1", ")", ";", "useGate", "(", "Bar", ",", "{", "a", ":", "1", "}", ")", ";", "useGate", "(", "Bar", ",", "{", "}", ")", ";", "useGate", "(", "Baz", ",", "null", ")", ";", "useGate", "(", "Baz", ",", "1", ")", ";", "}", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Argument of type '1' is not assignable to parameter of type '{ a: number; } | undefined'.\n Argument of type '{}' is not assignable to parameter of type '{ a: number; }'.\n Property 'a' is missing in type '{}' but required in type '{ a: number; }'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'useEvent of Event'", ",", "(", ")", "=>", "{", "const", "runEvent", "=", "useEvent", "(", "createEvent", "<", "number", ">", "(", ")", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'useEvent of Event<void>'", ",", "(", ")", "=>", "{", "const", "runEvent", "=", "useEvent", "(", "createEvent", "<", "void", ">", "(", ")", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'useEvent of Effect'", ",", "(", ")", "=>", "{", "const", "runEffect", "=", "useEvent", "(", "createEffect", "<", "number", ",", "string", ",", "Error", ">", "(", ")", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'useEvent of Effect<void, unknown, Error>'", ",", "(", ")", "=>", "{", "const", "runEffect", "=", "useEvent", "(", "createEffect", "<", "void", ",", "unknown", ",", "Error", ">", "(", ")", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'useEvent of object'", ",", "(", ")", "=>", "{", "const", "handlers", "=", "useEvent", "(", "{", "foo", ":", "createEvent", "<", "number", ">", "(", ")", ",", "bar", ":", "createEffect", "<", "number", ",", "string", ",", "Error", ">", "(", ")", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'useEvent of array'", ",", "(", ")", "=>", "{", "const", "handlers", "=", "useEvent", "(", "[", "createEvent", "<", "number", ">", "(", ")", ",", "createEffect", "<", "number", ",", "string", ",", "Error", ">", "(", ")", "]", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 37600, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, 3, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, 37600, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
612
[ "import", "React", "from", "'react'", ";", "import", "{", "createStore", "}", "from", "'effector'", ";", "import", "{", "useList", "}", "from", "'effector-react'", ";", "const", "typecheck", "=", "'{global}'", ";", "type", "User", "=", "{", "username", ":", "string", ";", "email", ":", "string", ";", "bio", ":", "string", ";", "}", ";", "test", "(", "'plain array support'", ",", "(", ")", "=>", "{", "const", "users", "=", "createStore", "<", "User", "[", "]", ">", "(", "[", "{", "username", ":", "'alice'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'. . .'", ",", "}", ",", "{", "username", ":", "'bob'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'~/ - /~'", ",", "}", ",", "{", "username", ":", "'carol'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'- - -'", ",", "}", ",", "]", ")", ";", "const", "UserList", "=", "(", ")", "=>", "useList", "(", "users", ",", "(", "{", "username", "}", ")", "=>", "<", "p", ">", "{", "username", "}", "<", "/p>);", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'readonly array support'", ",", "(", ")", "=>", "{", "const", "users", "=", "createStore", "<", "ReadonlyArray", "<", "User", ">", ">", "(", "[", "{", "username", ":", "'alice'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'. . .'", ",", "}", ",", "{", "username", ":", "'bob'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'~/ - /~'", ",", "}", ",", "{", "username", ":", "'carol'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'- - -'", ",", "}", ",", "]", ")", ";", "const", "UserList", "=", "(", ")", "=>", "useList", "(", "users", ",", "(", "{", "username", "}", ")", "=>", "<", "p", ">", "{", "username", "}", "<", "/p>);", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'getKey support'", ",", "(", ")", "=>", "{", "const", "users", "=", "createStore", "<", "User", "[", "]", ">", "(", "[", "{", "username", ":", "'alice'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'. . .'", ",", "}", ",", "{", "username", ":", "'bob'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'~/ - /~'", ",", "}", ",", "{", "username", ":", "'carol'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'- - -'", ",", "}", ",", "]", ")", ";", "const", "UserList", "=", "(", ")", "=>", "useList", "(", "users", ",", "{", "getKey", ":", "(", "{", "email", "}", ")", "=>", "email", ",", "fn", ":", "(", "{", "username", "}", ",", "key", ")", "=>", "(", "<", "p", ">", "user", ":", "{", "username", "}", ",", "email", ":", "{", "key", "}", "<", "/p>),", "}", ")", ";", "const", "App", "=", "(", ")", "=>", "(", "<", "div", ">", "<", "UserList", "/>", "<", "/div>);", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "\"usage as components' return value\"", ",", "(", ")", "=>", "{", "const", "users", "=", "createStore", "<", "User", "[", "]", ">", "(", "[", "{", "username", ":", "'alice'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'. . .'", ",", "}", ",", "{", "username", ":", "'bob'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'~/ - /~'", ",", "}", ",", "{", "username", ":", "'carol'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'- - -'", ",", "}", ",", "]", ")", ";", "const", "UserList", "=", "(", ")", "=>", "useList", "(", "users", ",", "(", "{", "username", "}", ")", "=>", "<", "p", ">", "{", "username", "}", "<", "/p>);", "const", "App", "=", "(", ")", "=>", "(", "<", "div", ">", "<", "UserList", "/>", "<", "/div>);", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
613
[ "import", "React", "from", "'react'", ";", "import", "{", "createStore", "}", "from", "'effector'", ";", "import", "{", "useStoreMap", "}", "from", "'effector-react'", ";", "const", "typecheck", "=", "'{global}'", ";", "type", "User", "=", "{", "username", ":", "string", ";", "email", ":", "string", ";", "bio", ":", "string", ";", "}", ";", "type", "Props", "=", "{", "id", ":", "number", ";", "field", ":", "keyof", "User", ";", "}", ";", "describe", "(", "'useStoreMap'", ",", "(", ")", "=>", "{", "const", "users", "=", "createStore", "<", "User", "[", "]", ">", "(", "[", "{", "username", ":", "'alice'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'. . .'", ",", "}", ",", "{", "username", ":", "'bob'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'~/ - /~'", ",", "}", ",", "{", "username", ":", "'carol'", ",", "email", ":", "'[email protected]'", ",", "bio", ":", "'- - -'", ",", "}", ",", "]", ")", ";", "describe", "(", "'infer type with `as const`'", ",", "(", ")", "=>", "{", "it", "(", "'should pass typecheck'", ",", "(", ")", "=>", "{", "const", "UserProperty", "=", "(", "{", "id", ",", "field", "}", ")", "=>", "{", "const", "value", "=", "useStoreMap", "(", "{", "store", ":", "users", ",", "keys", ":", "[", "id", ",", "field", "]", "as", "const", ",", "fn", ":", "(", "users", ",", "[", "id", ",", "field", "]", ")", "=>", "users", "[", "id", "]", "[", "field", "]", "||", "null", ",", "}", ")", ";", "return", "<", "div", ">", "{", "value", "}", "<", "/div>;", "}", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'should fail typecheck'", ",", "(", ")", "=>", "{", "const", "UserProperty", "=", "(", "{", "id", ",", "field", "}", ")", "=>", "{", "const", "value", "=", "useStoreMap", "(", "{", "store", ":", "users", ",", "keys", ":", "[", "id", "]", "as", "const", ",", "fn", ":", "(", "users", ",", "[", "id", ",", "field", "]", ")", "=>", "null", ",", "}", ")", ";", "return", "<", "div", ">", "{", "value", "}", "<", "/div>;", "}", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Tuple type 'readonly [number]' of length '1' has no element at index '1'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'infer type with `as [explicit, tuple]`'", ",", "(", ")", "=>", "{", "it", "(", "'should pass typecheck'", ",", "(", ")", "=>", "{", "const", "UserProperty", "=", "(", "{", "id", ",", "field", "}", ")", "=>", "{", "const", "value", "=", "useStoreMap", "(", "{", "store", ":", "users", ",", "keys", ":", "[", "id", ",", "field", "]", "as", "[", "number", ",", "keyof", "User", "]", ",", "fn", ":", "(", "users", ",", "[", "id", ",", "field", "]", ")", "=>", "users", "[", "id", "]", "[", "field", "]", "||", "null", ",", "}", ")", ";", "return", "<", "div", ">", "{", "value", "}", "<", "/div>;", "}", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "it", "(", "'should fail typecheck'", ",", "(", ")", "=>", "{", "const", "UserProperty", "=", "(", "{", "id", ",", "field", "}", ")", "=>", "{", "const", "value", "=", "useStoreMap", "(", "{", "store", ":", "users", ",", "keys", ":", "[", "id", ",", "field", "]", "as", "[", "number", ",", "keyof", "User", "]", ",", "fn", ":", "(", "users", ",", "[", "id", ",", "field", "]", ")", "=>", "null", ",", "}", ")", ";", "return", "<", "div", ">", "{", "value", "}", "<", "/div>;", "}", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type '[number, keyof User]' is not assignable to type '[number, number]'.\n Type at position 1 in source is not compatible with type at position 1 in target.\n Type 'string' is not assignable to type 'number'.\n Type 'string' is not assignable to type 'number'.\n Type 'unknown' is not assignable to type 'ReactNode'.\n Type 'unknown' is not assignable to type 'ReactPortal'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "it", "(", "'can infer tuple type without `as`'", ",", "(", ")", "=>", "{", "const", "UserProperty", "=", "(", "{", "id", ",", "field", "}", ")", "=>", "{", "const", "value", "=", "useStoreMap", "(", "{", "store", ":", "users", ",", "keys", ":", "[", "id", ",", "field", "]", ",", "fn", ":", "(", "users", ",", "[", "id", ",", "field", "]", ")", "=>", "users", "[", "id", "]", "[", "field", "]", "||", "null", ",", "}", ")", ";", "return", "<", "div", ">", "{", "value", "}", "<", "/div>;", "}", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "test", "(", "'useStoreMap(store, fn)'", ",", "(", ")", "=>", "{", "const", "store", "=", "createStore", "(", "{", "foo", ":", "0", ",", "bar", ":", "'ok'", "}", ")", ";", "const", "Foo", "=", "(", ")", "=>", "{", "const", "value", "=", "useStoreMap", "(", "store", ",", "(", "{", "foo", "}", ")", "=>", "foo", ")", ";", "return", "<", "div", ">", "{", "value", "}", "<", "/div>;", "}", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
614
[ "import", "{", "createStore", "}", "from", "'effector'", ";", "import", "Vue", "from", "'vue'", ";", "import", "{", "createComponent", "}", "from", "'effector-vue'", ";", "const", "typecheck", "=", "'{global}'", ";", "describe", "(", "'vue extend'", ",", "(", ")", "=>", "{", "describe", "(", "'object type'", ",", "(", ")", "=>", "{", "test", "(", "'should pass typecheck'", ",", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "1", ")", ";", "Vue", ".", "extend", "(", "{", "effector", ":", "{", "counter", ":", "$counter", ",", "}", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "counter", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'should fail typecheck'", ",", "(", ")", "=>", "{", "const", "$name", "=", "createStore", "(", "'effector'", ")", ";", "Vue", ".", "extend", "(", "{", "effector", ":", "{", "name", ":", "$name", ",", "}", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "name", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'function'", ",", "(", ")", "=>", "{", "test", "(", "'arrow function should pass typecheck'", ",", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "1", ")", ";", "Vue", ".", "extend", "(", "{", "effector", ":", "(", ")", "=>", "$counter", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "state", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'arrow function should fail typecheck'", ",", "(", ")", "=>", "{", "const", "$name", "=", "createStore", "(", "'effector'", ")", ";", "Vue", ".", "extend", "(", "{", "effector", ":", "(", ")", "=>", "$name", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "state", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'function should pass typecheck'", ",", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "1", ")", ";", "Vue", ".", "extend", "(", "{", "effector", "(", ")", "{", "return", "$counter", ";", "}", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "state", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'function should fail typecheck'", ",", "(", ")", "=>", "{", "const", "$name", "=", "createStore", "(", "'effector'", ")", ";", "Vue", ".", "extend", "(", "{", "effector", "(", ")", "{", "return", "$name", ";", "}", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "state", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'directly'", ",", "(", ")", "=>", "{", "test", "(", "'should pass typecheck'", ",", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "1", ")", ";", "Vue", ".", "extend", "(", "{", "effector", ":", "$counter", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "state", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'should fail typecheck'", ",", "(", ")", "=>", "{", "const", "$name", "=", "createStore", "(", "'effector'", ")", ";", "Vue", ".", "extend", "(", "{", "effector", ":", "$name", ",", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "state", "*", "2", ";", "}", ",", "}", ",", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'createComponent'", ",", "(", ")", "=>", "{", "test", "(", "'should pass typecheck'", ",", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "1", ")", ";", "createComponent", "(", "{", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "$counter", "*", "2", ";", "}", ",", "}", ",", "}", ",", "{", "$counter", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'should fail typecheck'", ",", "(", ")", "=>", "{", "const", "$name", "=", "createStore", "(", "'effector'", ")", ";", "createComponent", "(", "{", "methods", ":", "{", "twice", "(", ")", "{", "return", "this", ".", "$name", "*", "2", ";", "}", ",", "}", ",", "}", ",", "{", "$name", "}", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
615
[ "import", "{", "createStore", ",", "Store", "}", "from", "'effector'", ";", "import", "{", "h", ",", "spec", ",", "list", ",", "using", ",", "remap", "}", "from", "'forest'", ";", "const", "typecheck", "=", "'{global}'", ";", "describe", "(", "'text'", ",", "(", ")", "=>", "{", "test", "(", "'correct case (should pass)'", ",", "(", ")", "=>", "{", "const", "store", "=", "createStore", "<", "{", "value", ":", "string", ";", "}", "|", "null", ">", "(", "null", ")", ";", "function", "run", "(", ")", "{", "using", "(", "document", ".", "body", ",", "(", ")", "=>", "{", "h", "(", "'div'", ",", "{", "text", ":", "store", ".", "map", "(", "data", "=>", "data", "&&", "data", ".", "value", ")", ",", "}", ")", ";", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'incorrect value (should fail)'", ",", "(", ")", "=>", "{", "const", "store", "=", "createStore", "<", "{", "value", ":", "string", ";", "}", "|", "null", ">", "(", "null", ")", ";", "function", "run", "(", ")", "{", "using", "(", "document", ".", "body", ",", "(", ")", "=>", "{", "h", "(", "'div'", ",", "{", "text", ":", "store", ".", "map", "(", "data", "=>", "data", ")", ",", "}", ")", ";", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n Overload 1 of 2, '(tag: DOMTag, spec: { attr?: PropertyMap | undefined; data?: PropertyMap | undefined; text?: DOMProperty | AttributeStoreInput | (DOMProperty | AttributeStoreInput)[] | undefined; ... 4 more ...; fn?: (() => void) | undefined; }): void', gave the following error.\n Type 'Store<{ value: string; } | null>' is not assignable to type 'DOMProperty | AttributeStoreInput | (DOMProperty | AttributeStoreInput)[] | undefined'.\n Type 'Store<{ value: string; } | null>' is not assignable to type 'AttributeStoreInput'.\n Types of property 'map' are incompatible.\n Type '{ <T>(fn: (state: { value: string; } | null, lastState?: T | undefined) => T): Store<T>; <T>(fn: (state: { value: string; } | null, lastState: T) => T, firstState: T): Store<...>; }' is not assignable to type '{ <T>(fn: (state: string | number | boolean | null, lastState?: T | undefined) => T): Store<T>; <T>(fn: (state: string | number | boolean | null, lastState: T) => T, firstState: T): Store<...>; }'.\n Types of parameters 'fn' and 'fn' are incompatible.\n Types of parameters 'state' and 'state' are incompatible.\n Type '{ value: string; } | null' is not assignable to type 'string | number | boolean | null'.\n Type '{ value: string; }' is not assignable to type 'string | number | boolean | null'.\n Type '{ value: string; }' is not assignable to type 'true'.\n Overload 2 of 2, '(tag: DOMTag, cb: () => void): void', gave the following error.\n Argument of type '{ text: Store<{ value: string; } | null>; }' is not assignable to parameter of type '() => void'.\n Object literal may only specify known properties, and 'text' does not exist in type '() => void'.\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'value subtyping (should pass)'", ",", "(", ")", "=>", "{", "const", "store", "=", "createStore", "<", "'foo'", "|", "'bar'", ">", "(", "'foo'", ")", ";", "function", "run", "(", ")", "{", "using", "(", "document", ".", "body", ",", "(", ")", "=>", "{", "h", "(", "'div'", ",", "{", "text", ":", "store", ",", "}", ")", ";", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'dom tag typecheck'", ",", "(", ")", "=>", "{", "test", "(", "'should pass'", ",", "(", ")", "=>", "{", "function", "run", "(", ")", "{", "using", "(", "document", ".", "body", ",", "(", ")", "=>", "{", "h", "(", "'div'", ",", "(", ")", "=>", "{", "}", ")", ";", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'should fail'", ",", "(", ")", "=>", "{", "function", "run", "(", ")", "{", "using", "(", "document", ".", "body", ",", "(", ")", "=>", "{", "h", "(", "'damn'", ",", "(", ")", "=>", "{", "}", ")", ";", "}", ")", ";", "}", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n No overload matches this call.\n Overload 1 of 2, '(tag: DOMTag, spec: { attr?: PropertyMap | undefined; data?: PropertyMap | undefined; text?: DOMProperty | AttributeStoreInput | (DOMProperty | AttributeStoreInput)[] | undefined; ... 4 more ...; fn?: (() => void) | undefined; }): void', gave the following error.\n Argument of type '\\\\\"damn\\\\\"' is not assignable to parameter of type 'DOMTag'.\n Overload 2 of 2, '(tag: DOMTag, cb: () => void): void', gave the following error.\n Argument of type '\\\\\"damn\\\\\"' is not assignable to parameter of type 'DOMTag'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'remap'", ",", "(", ")", "=>", "{", "test", "(", "'single key'", ",", "(", ")", "=>", "{", "const", "shape", "=", "createStore", "(", "{", "foo", ":", "'ok'", ",", "bar", ":", "0", ",", "baz", ":", "null", "}", ")", ";", "const", "foo", "=", "remap", "(", "shape", ",", "'foo'", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "describe", "(", "'array of keys'", ",", "(", ")", "=>", "{", "test", "(", "'without \"as const\" (should pass)'", ",", "(", ")", "=>", "{", "const", "shape", "=", "createStore", "(", "{", "foo", ":", "'ok'", ",", "bar", ":", "0", ",", "baz", ":", "null", "}", ")", ";", "const", "[", "foo", ",", "bar", "]", "=", "remap", "(", "shape", ",", "[", "'foo'", ",", "'bar'", ",", "]", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'with \"as const\" (should pass)'", ",", "(", ")", "=>", "{", "const", "shape", "=", "createStore", "(", "{", "foo", ":", "'ok'", ",", "bar", ":", "0", ",", "baz", ":", "null", "}", ")", ";", "const", "[", "foo", ",", "bar", "]", "=", "remap", "(", "shape", ",", "[", "'foo'", ",", "'bar'", ",", "]", "as", "const", ")", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n no errors\n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'incorrect types (should fail)'", ",", "(", ")", "=>", "{", "const", "shape", "=", "createStore", "(", "{", "foo", ":", "'ok'", ",", "bar", ":", "0", ",", "baz", ":", "null", "}", ")", ";", "const", "[", "foo", ",", "bar", "]", "=", "remap", "(", "shape", ",", "[", "'foo'", ",", "'bar'", "]", ")", ";", "const", "foo1", "=", "foo", ";", "const", "foo2", "=", "foo", ";", "const", "bar1", "=", "bar", ";", "const", "bar2", "=", "bar", ";", "expect", "(", "typecheck", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n Type 'Store<string>' is not assignable to type 'Store<number>'.\n Type 'Store<number>' is not assignable to type 'Store<string>'.\n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
616
[ "import", "*", "as", "ts", "from", "'typescript'", ";", "import", "{", "promises", "as", "fs", "}", "from", "'fs'", ";", "import", "{", "resolve", ",", "relative", "}", "from", "'path'", ";", "function", "createCompilerHost", "(", "{", "options", ",", "testFiles", ",", "declarations", ",", "}", ")", "{", "const", "testFileNames", "=", "testFiles", ".", "map", "(", "(", "{", "name", "}", ")", "=>", "name", ")", ";", "const", "testFileNamesRelative", "=", "testFileNames", ".", "map", "(", "name", "=>", "name", ".", "replace", "(", "'../__tests__/'", ",", "''", ")", ".", "replace", "(", "/\\.(j|t)sx?$/gi", ",", "''", ")", ")", ";", "const", "tests", "=", "testFiles", ".", "map", "(", "(", "{", "code", "}", ")", "=>", "code", ")", ";", "const", "declNames", "=", "declarations", ".", "map", "(", "(", "{", "name", "}", ")", "=>", "name", ")", ";", "const", "declFileNames", "=", "declarations", ".", "map", "(", "(", "{", "fileName", "}", ")", "=>", "fileName", ")", ";", "const", "decls", "=", "declarations", ".", "map", "(", "(", "{", "code", "}", ")", "=>", "code", ")", ";", "function", "withFile", "<", "T", ">", "(", "fileName", ",", "{", "virtual", ",", "real", "}", ")", "{", "if", "(", "testFileNames", ".", "includes", "(", "fileName", ")", ")", "return", "virtual", "(", "tests", "[", "testFileNames", ".", "indexOf", "(", "fileName", ")", "]", ")", ";", "if", "(", "declFileNames", ".", "includes", "(", "fileName", ")", ")", "return", "virtual", "(", "decls", "[", "declFileNames", ".", "indexOf", "(", "fileName", ")", "]", ")", ";", "return", "real", "(", ")", ";", "}", "const", "resolutionHost", "=", "{", "fileExists", "(", "fileName", ")", "{", "return", "withFile", "(", "fileName", ",", "{", "virtual", ":", "(", ")", "=>", "true", ",", "real", ":", "(", ")", "=>", "ts", ".", "sys", ".", "fileExists", "(", "fileName", ")", ",", "}", ")", ";", "}", ",", "readFile", "(", "fileName", ")", "{", "return", "withFile", "(", "fileName", ",", "{", "virtual", ":", "code", "=>", "code", ",", "real", ":", "(", ")", "=>", "ts", ".", "sys", ".", "readFile", "(", "fileName", ")", ",", "}", ")", ";", "}", ",", "}", ";", "return", "{", "...", "resolutionHost", ",", "getSourceFile", "(", "fileName", ",", "languageVersion", ")", "{", "const", "sourceText", "=", "resolutionHost", ".", "readFile", "(", "fileName", ")", ";", "if", "(", "sourceText", "!==", "undefined", ")", "return", "ts", ".", "createSourceFile", "(", "fileName", ",", "sourceText", ",", "languageVersion", ")", ";", "}", ",", "getDefaultLibFileName", ":", "(", ")", "=>", "'lib.d.ts'", ",", "getDefaultLibLocation", ":", "(", ")", "=>", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'node_modules'", ",", "'typescript'", ",", "'lib'", ")", ",", "writeFile", "(", "fileName", ",", "content", ")", "{", "throw", "Error", "(", "'not implemented'", ")", ";", "}", ",", "getCurrentDirectory", ":", "(", ")", "=>", "ts", ".", "sys", ".", "getCurrentDirectory", "(", ")", ",", "getDirectories", ":", "path", "=>", "ts", ".", "sys", ".", "getDirectories", "(", "path", ")", ",", "getCanonicalFileName", ":", "fileName", "=>", "ts", ".", "sys", ".", "useCaseSensitiveFileNames", "?", "fileName", ":", "fileName", ".", "toLowerCase", "(", ")", ",", "getNewLine", ":", "(", ")", "=>", "ts", ".", "sys", ".", "newLine", ",", "useCaseSensitiveFileNames", ":", "(", ")", "=>", "ts", ".", "sys", ".", "useCaseSensitiveFileNames", ",", "resolveModuleNames", "(", "moduleNames", ",", "containingFile", ")", "{", "const", "resolvedModules", "=", "[", "]", ";", "for", "(", "const", "moduleName", "of", "moduleNames", ")", "{", "if", "(", "declNames", ".", "includes", "(", "moduleName", ")", ")", "{", "resolvedModules", ".", "push", "(", "{", "resolvedFileName", ":", "declFileNames", "[", "declNames", ".", "indexOf", "(", "moduleName", ")", "]", ",", "}", ")", ";", "}", "else", "if", "(", "testFileNamesRelative", ".", "includes", "(", "moduleName", ")", ")", "{", "resolvedModules", ".", "push", "(", "{", "resolvedFileName", ":", "testFileNames", "[", "testFileNamesRelative", ".", "indexOf", "(", "moduleName", ")", "]", ",", "}", ")", ";", "}", "else", "{", "const", "result", "=", "ts", ".", "resolveModuleName", "(", "moduleName", ",", "containingFile", ",", "options", ",", "resolutionHost", ")", ";", "if", "(", "result", ".", "resolvedModule", ")", "{", "resolvedModules", ".", "push", "(", "result", ".", "resolvedModule", ")", ";", "}", "else", "{", "console", ".", "error", "(", "`module '${", "moduleName", "}' is not found`", ")", ";", "console", ".", "log", "(", "{", "testFileNames", ",", "testFileNamesRelative", "}", ")", ";", "}", "}", "}", "return", "resolvedModules", ";", "}", ",", "}", ";", "}", "export", "async", "function", "compile", "(", "{", "fullTestFileNames", ",", "testsRoot", ",", "paths", ",", "typings", ",", "tsConfig", ",", "}", ")", "{", "const", "[", "declarations", ",", "filesContents", "]", "=", "await", "Promise", ".", "all", "(", "[", "Promise", ".", "all", "(", "Object", ".", "entries", "(", "paths", ")", ".", "map", "(", "async", "(", "[", "name", ",", "path", "]", ")", "=>", "{", "const", "fileName", "=", "resolve", "(", "__dirname", ",", "...", "path", ".", "split", "(", "/\\//gi", ")", ")", ";", "return", "{", "name", ",", "fileName", ",", "code", ":", "await", "fs", ".", "readFile", "(", "fileName", ",", "'utf8'", ")", ",", "}", ";", "}", ")", ")", ",", "Promise", ".", "all", "(", "fullTestFileNames", ".", "map", "(", "async", "(", "name", ")", "=>", "(", "{", "name", ":", "relative", "(", "__dirname", ",", "name", ")", ",", "code", ":", "await", "fs", ".", "readFile", "(", "name", ",", "'utf8'", ")", ".", "then", "(", "code", "=>", "code", ".", "replace", "(", "/\\@ts\\-expect\\-error/gm", ",", "''", ")", ")", ",", "}", ")", ")", ")", ",", "]", ")", ";", "const", "options", "=", "ts", ".", "convertCompilerOptionsFromJson", "(", "tsConfig", ",", "'../../..'", ")", ".", "options", ";", "const", "rootFileFullPath", "=", "resolve", "(", "testsRoot", ",", "'index.ts'", ")", ";", "const", "rootFileRelativePath", "=", "relative", "(", "__dirname", ",", "rootFileFullPath", ")", ";", "const", "host", "=", "createCompilerHost", "(", "{", "options", ",", "testFiles", ":", "[", "{", "name", ":", "rootFileRelativePath", ",", "code", ":", "fullTestFileNames", ".", "map", "(", "file", "=>", "{", "const", "relativeImport", "=", "relative", "(", "testsRoot", ",", "file", ")", ";", "const", "noExt", "=", "relativeImport", ".", "replace", "(", "/\\.(j|t)sx?$/gi", ",", "''", ")", ";", "return", "`import '${", "noExt", "}'`", ";", "}", ")", ".", "join", "(", "`\\n`", ")", ",", "}", ",", "...", "filesContents", ",", "]", ",", "declarations", ":", "declarations", ",", "}", ")", ";", "const", "program", "=", "ts", ".", "createProgram", "(", "[", "...", "typings", ".", "map", "(", "typing", "=>", "`./node_modules/${", "typing", "}`", ")", ",", "rootFileRelativePath", ",", "]", ",", "options", ",", "host", ")", ";", "const", "allDiagnostics", "=", "program", ".", "getOptionsDiagnostics", "(", ")", ".", "concat", "(", "program", ".", "getSyntacticDiagnostics", "(", ")", ")", ".", "concat", "(", "program", ".", "getSemanticDiagnostics", "(", ")", ")", ".", "concat", "(", "program", ".", "getDeclarationDiagnostics", "(", ")", ")", ";", "return", "createReport", "(", "allDiagnostics", ")", ";", "function", "createReport", "(", "allDiagnostics", ")", "{", "const", "messages", "=", "[", "]", ";", "for", "(", "const", "diagnostic", "of", "allDiagnostics", ")", "{", "const", "message", "=", "ts", ".", "flattenDiagnosticMessageText", "(", "diagnostic", ".", "messageText", ",", "'\\n'", ")", ";", "if", "(", "diagnostic", ".", "file", ")", "{", "let", "{", "line", ",", "character", "}", "=", "diagnostic", ".", "file", ".", "getLineAndCharacterOfPosition", "(", "diagnostic", ".", "start", "!", ")", ";", "messages", ".", "push", "(", "`Error ${", "diagnostic", ".", "file", ".", "fileName", "} (${", "line", "+", "1", "},${", "character", "+", "1", "}): ${", "message", "}`", ")", ";", "}", "else", "{", "messages", ".", "push", "(", "`Error: ${", "message", "}`", ")", ";", "}", "}", "return", "messages", ".", "join", "(", "`\\n`", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4520, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
617
[ "import", "{", "resolve", ",", "relative", ",", "extname", "}", "from", "'path'", ";", "import", "{", "promises", "as", "fs", "}", "from", "'fs'", ";", "import", "{", "compile", "}", "from", "'./tsRunner'", ";", "const", "WRITE_RAW_REPORTS", "=", "false", ";", "const", "TESTS_DIR", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'__tests__'", ")", ";", "const", "FULL_REPORT_PATH", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'.reports'", ",", "'type-report-full.json'", ")", ";", "const", "RAW_REPORT_PATH", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'.reports'", ",", "'type-report-ts-raw'", ")", ";", "export", "default", "async", "function", "(", ")", "{", "const", "testFiles", "=", "await", "readTypeDir", "(", "TESTS_DIR", ",", "TESTS_DIR", ")", ";", "const", "tsReport", "=", "await", "runTypeScript", "(", "testFiles", ")", ";", "const", "fileNames", "=", "testFiles", ".", "map", "(", "fullPath", "=>", "relative", "(", "TESTS_DIR", ",", "fullPath", ")", ")", ";", "await", "fs", ".", "writeFile", "(", "FULL_REPORT_PATH", ",", "JSON", ".", "stringify", "(", "{", "tsReport", ",", "fileNames", "}", ")", ",", "'utf8'", ")", ";", "}", "async", "function", "readTypeDir", "(", "dir", ",", "base", ")", "{", "const", "dirents", "=", "await", "fs", ".", "readdir", "(", "dir", ",", "{", "withFileTypes", ":", "true", "}", ")", ";", "const", "files", "=", "[", "]", ";", "const", "reqs", "=", "[", "]", ";", "for", "(", "const", "dirent", "of", "dirents", ")", "{", "const", "name", "=", "dirent", ".", "name", ";", "if", "(", "dirent", ".", "isFile", "(", ")", ")", "{", "const", "fullPath", "=", "resolve", "(", "dir", ",", "name", ")", ";", "const", "ext", "=", "extname", "(", "name", ")", ";", "if", "(", "ext", "!==", "'.ts'", "&&", "ext", "!==", "'.tsx'", ")", "continue", ";", "files", ".", "push", "(", "fullPath", ")", ";", "}", "else", "{", "reqs", ".", "push", "(", "readTypeDir", "(", "resolve", "(", "dir", ",", "name", ")", ",", "base", ")", ")", ";", "}", "}", "const", "subdirs", "=", "await", "Promise", ".", "all", "(", "reqs", ")", ";", "for", "(", "const", "subdir", "of", "subdirs", ")", "{", "files", ".", "push", "(", "...", "subdir", ")", ";", "}", "return", "files", ";", "}", "async", "function", "runTypeScript", "(", "testFiles", ")", "{", "try", "{", "const", "report", "=", "await", "compile", "(", "{", "fullTestFileNames", ":", "testFiles", ",", "testsRoot", ":", "TESTS_DIR", ",", "paths", ":", "{", "'effector/fork'", ":", "'../../../packages/effector/fork.d.ts'", ",", "effector", ":", "'../../../packages/effector/index.d.ts'", ",", "'effector-react/scope'", ":", "'../../../packages/effector-react/scope.d.ts'", ",", "'effector-react'", ":", "'../../../packages/effector-react/index.d.ts'", ",", "'effector-vue'", ":", "'../../../packages/effector-vue/index.d.ts'", ",", "'forest/server'", ":", "'../../../packages/forest/server.d.ts'", ",", "forest", ":", "'../../../packages/forest/index.d.ts'", ",", "react", ":", "'../../../node_modules/@types/react/index.d.ts'", ",", "vue", ":", "'../../../node_modules/vue/types/index.d.ts'", ",", "}", ",", "typings", ":", "[", "'@types/jest/index.d.ts'", "]", ",", "tsConfig", ":", "{", "strictNullChecks", ":", "true", ",", "module", ":", "'CommonJS'", ",", "target", ":", "'esnext'", ",", "jsx", ":", "'react'", ",", "allowJs", ":", "true", ",", "strict", ":", "true", ",", "allowSyntheticDefaultImports", ":", "true", ",", "moduleResolution", ":", "'node'", ",", "resolveJsonModule", ":", "false", ",", "lib", ":", "[", "'esnext'", ",", "'es2019'", ",", "'dom'", "]", ",", "noEmit", ":", "true", ",", "}", ",", "}", ")", ";", "if", "(", "report", "===", "''", ")", "{", "console", ".", "warn", "(", "'no errors found by typescript typecheck'", ")", ";", "return", "[", "]", ";", "}", "const", "cleanedMessage", "=", "report", ".", "replace", "(", "/error TS\\d+: /gm", ",", "''", ")", ";", "if", "(", "WRITE_RAW_REPORTS", ")", "{", "await", "fs", ".", "writeFile", "(", "RAW_REPORT_PATH", ",", "cleanedMessage", ",", "'utf8'", ")", ";", "}", "return", "normalizeTSReport", "(", "cleanedMessage", ")", ";", "}", "catch", "(", "error", ")", "{", "console", ".", "error", "(", "'compilation failed'", ")", ";", "console", ".", "error", "(", "error", ")", ";", "return", "[", "]", ";", "}", "function", "normalizeTSReport", "(", "report", ")", "{", "let", "current", "=", "{", "pos", ":", "{", "line", ":", "-", "1", ",", "col", ":", "-", "1", "}", ",", "lines", ":", "[", "]", "as", "string", "[", "]", ",", "file", ":", "''", ",", "}", ";", "const", "tsProcessed", "=", "[", "]", ";", "for", "(", "const", "line", "of", "report", ".", "split", "(", "/\\n/", ")", ")", "{", "if", "(", "line", ".", "startsWith", "(", "' '", ")", ")", "{", "current", ".", "lines", ".", "push", "(", "line", ")", ";", "}", "else", "{", "const", "match", "=", "line", ".", "match", "(", "/\\.\\.\\/__tests__\\/(.+)\\((\\d+),(\\d+)\\): (.+)/", ")", ";", "if", "(", "match", ")", "{", "const", "file", "=", "match", "[", "1", "]", ".", "trim", "(", ")", ";", "const", "x", "=", "+", "match", "[", "3", "]", ";", "const", "y", "=", "+", "match", "[", "2", "]", ";", "const", "message", "=", "match", "[", "4", "]", ";", "tsProcessed", ".", "push", "(", "current", ")", ";", "current", "=", "{", "pos", ":", "{", "line", ":", "y", ",", "col", ":", "x", "}", ",", "lines", ":", "[", "message", "]", ",", "file", ",", "}", ";", "}", "else", "{", "current", ".", "lines", ".", "push", "(", "line", ")", ";", "}", "}", "}", "tsProcessed", ".", "push", "(", "current", ")", ";", "return", "tsProcessed", ".", "map", "(", "(", "{", "pos", ",", "lines", ",", "file", "}", ")", "=>", "(", "{", "pos", ",", "message", ":", "lines", ".", "join", "(", "`\\n`", ")", ",", "file", ",", "}", ")", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, 2, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, 5, null, null, null, null, null, null, null, 747, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 5, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 63, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
618
[ "import", "{", "resolve", "}", "from", "'path'", ";", "import", "{", "promises", "as", "fs", "}", "from", "'fs'", ";", "const", "REMOVE_REPORT", "=", "true", ";", "export", "default", "async", "(", ")", "=>", "{", "const", "reportDir", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'.reports'", ")", ";", "if", "(", "REMOVE_REPORT", ")", "{", "await", "Promise", ".", "all", "(", "[", "fs", ".", "rm", "(", "resolve", "(", "reportDir", ",", "'type-report-full.json'", ")", ",", "{", "force", ":", "true", "}", ")", ",", "fs", ".", "rm", "(", "resolve", "(", "reportDir", ",", "'type-report-ts-raw'", ")", ",", "{", "force", ":", "true", "}", ")", ",", "]", ")", ";", "}", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
619
[ "export", "type", "Tuple", "<", "T", "=", "unknown", ">", "=", "readonly", "[", "T", "]", "|", "readonly", "[", "T", ",", "...", "(", "readonly", "T", "[", "]", ")", "]", ";", "export", "type", "SourceRec", "=", "Record", "<", "string", ",", "Declarator", ">", ";", "export", "type", "Matcher", "<", "Src", "extends", "SourceRec", ">", "=", "Partial", "<", "{", "[", "K", "in", "keyof", "Src", "]", ":", "Src", "[", "K", "]", "extends", "Ref", "<", "infer", "S", ",", "unknown", ">", "?", "S", ":", "never", ";", "}", ">", ";", "export", "type", "SingleVariant", "<", "Src", "extends", "SourceRec", ">", "=", "Tuple", "<", "Matcher", "<", "Src", ">", ">", "|", "Matcher", "<", "Src", ">", ";", "export", "type", "VariantLevel", "<", "Src", "extends", "SourceRec", ">", "=", "Record", "<", "string", ",", "SingleVariant", "<", "Src", ">", ">", ";", "export", "type", "VariantLevelRec", "<", "Src", "extends", "SourceRec", ">", "=", "Record", "<", "string", ",", "VariantLevel", "<", "Src", ">", ">", ";", "export", "type", "Ref", "<", "T", ",", "K", ">", "=", "{", "id", ":", "string", ";", "name", ":", "string", ";", "kind", ":", "K", ";", "__t", ":", "T", ";", "prepared", ":", "object", ";", "}", ";", "export", "type", "Declarator", "=", "Union", "|", "UnionAny", "<", "unknown", ">", "|", "Value", "<", "unknown", ">", "|", "Fn", "<", "unknown", ">", "|", "Raw", "<", "unknown", ">", "|", "ComputeVariant", "<", "unknown", ">", "|", "Bool", "|", "Separate", "<", "unknown", ">", "|", "Flag", "|", "Permute", "<", "unknown", ">", ";", "export", "type", "DataDecl", "<", "T", ">", "=", "UnionAny", "<", "T", ">", "|", "Value", "<", "T", ">", "|", "Fn", "<", "T", ">", "|", "Raw", "<", "T", ">", "|", "ComputeVariant", "<", "T", ">", "|", "Separate", "<", "T", ">", "|", "Permute", "<", "T", ">", ";", "export", "type", "BoolDecl", "=", "Flag", "|", "Bool", "|", "UnionAny", "<", "boolean", ">", "|", "Value", "<", "boolean", ">", "|", "Fn", "<", "boolean", ">", "|", "Raw", "<", "boolean", ">", "|", "ComputeVariant", "<", "boolean", ">", "|", "Separate", "<", "boolean", ">", ";", "export", "type", "Permute", "<", "T", ">", "=", "Ref", "<", "T", "[", "]", ",", "'permute'", ">", "&", "{", "permute", ":", "{", "items", ":", "T", "[", "]", ";", "noReorder", "?", ":", "boolean", ";", "amount", "?", ":", "{", "min", ":", "number", ";", "max", ":", "number", ";", "}", ";", "}", ";", "}", ";", "export", "type", "Flag", "=", "Ref", "<", "boolean", ",", "'flag'", ">", "&", "{", "needs", ":", "string", "[", "]", ";", "avoid", ":", "string", "[", "]", ";", "decls", ":", "{", "true", ":", "Value", "<", "boolean", ">", ";", "false", ":", "Value", "<", "boolean", ">", ";", "}", ";", "}", ";", "export", "type", "Separate", "<", "T", ">", "=", "Ref", "<", "T", ",", "'separate'", ">", "&", "{", "variant", ":", "Record", "<", "string", ",", "Record", "<", "string", ",", "any", ">", ">", ";", "cases", ":", "Record", "<", "string", ",", "Ref", "<", "unknown", ",", "unknown", ">", "|", "Record", "<", "string", ",", "unknown", ">", ">", ";", "}", ";", "type", "UnionAny", "<", "Cases", ">", "=", "Ref", "<", "Cases", ",", "'union'", ">", "&", "{", "variants", ":", "Tuple", "<", "Cases", ">", ";", "}", ";", "export", "type", "Union", "<", "Cases", "extends", "string", "=", "string", ">", "=", "Ref", "<", "Cases", ",", "'union'", ">", "&", "{", "variants", ":", "Tuple", "<", "Cases", ">", ";", "}", ";", "export", "type", "Value", "<", "T", ">", "=", "Ref", "<", "T", ",", "'value'", ">", "&", "{", "value", ":", "T", ";", "}", ";", "export", "type", "Fn", "<", "T", ">", "=", "Ref", "<", "T", ",", "'fn'", ">", "&", "{", "fn", "(", "args", ")", ":", "T", "|", "void", ";", "}", ";", "export", "type", "ComputeVariant", "<", "T", ">", "=", "Ref", "<", "T", ",", "'computeVariant'", ">", "&", "{", "variant", ":", "Record", "<", "string", ",", "Record", "<", "string", ",", "any", ">", ">", ";", "cases", ":", "Record", "<", "string", ",", "Ref", "<", "unknown", ",", "unknown", ">", "|", "Record", "<", "string", ",", "unknown", ">", ">", ";", "}", ";", "export", "type", "Bool", "=", "Ref", "<", "boolean", ",", "'bool'", ">", "&", "{", "bool", ":", "{", "true", ":", "Record", "<", "string", ",", "any", ">", "|", "void", ";", "false", ":", "Record", "<", "string", ",", "any", ">", "|", "void", ";", "}", ";", "decls", ":", "{", "true", ":", "Value", "<", "boolean", ">", ";", "false", ":", "Value", "<", "boolean", ">", ";", "}", ";", "}", ";", "export", "type", "RawCase", "=", "{", "compute", ":", "object", ";", "}", "|", "{", "split", ":", "object", ";", "}", ";", "export", "type", "Raw", "<", "T", "=", "unknown", ">", "=", "Ref", "<", "T", ",", "'raw'", ">", "&", "{", "value", ":", "RawCase", ";", "}", ";", "type", "BuiltInObject", "=", "Error", "|", "Date", "|", "RegExp", "|", "Int8Array", "|", "Uint8Array", "|", "Uint8ClampedArray", "|", "Int16Array", "|", "Uint16Array", "|", "Int32Array", "|", "Uint32Array", "|", "Float32Array", "|", "Float64Array", "|", "ReadonlyMap", "<", "unknown", ",", "unknown", ">", "|", "ReadonlySet", "<", "unknown", ">", "|", "WeakMap", "<", "object", ",", "unknown", ">", "|", "WeakSet", "<", "object", ">", "|", "ArrayBuffer", "|", "DataView", "|", "Function", "|", "Promise", "<", "unknown", ">", "|", "Generator", ";", "/**\n * Force typescript to print real type instead of geneic types\n *\n * It's better to see {a: string; b: number}\n * instead of GetCombinedValue<{a: Store<string>; b: Store<number>}>\n * */", "type", "Show", "<", "A", "extends", "any", ">", "=", "A", "extends", "BuiltInObject", "?", "A", ":", "{", "[", "K", "in", "keyof", "A", "]", ":", "A", "[", "K", "]", ";", "}", ";", "type", "UnionToIntersection", "<", "Union", ">", "=", "(", "Union", "extends", "unknown", "?", "(", "distributedUnion", ":", "Union", ")", "=>", "void", ":", "never", ")", "extends", "(", "mergedIntersection", ":", "infer", "Intersection", ")", "=>", "void", "?", "Intersection", ":", "never", ";", "type", "UnionToTuple", "<", "Union", ">", "=", "UnionToIntersection", "<", "Union", "extends", "unknown", "?", "(", "distributed", ":", "Union", ")", "=>", "void", ":", "never", ">", "extends", "(", "merged", ":", "infer", "Intersection", ")", "=>", "void", "?", "readonly", "[", "...", "UnionToTuple", "<", "Exclude", "<", "Union", ",", "Intersection", ">", ">", ",", "Intersection", "]", ":", "readonly", "[", "]", ";", "type", "CaseLayerLast", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "CurrentCase", "extends", "keyof", "Variants", ">", "=", "{", "[", "K", "in", "keyof", "Variants", "[", "CurrentCase", "]", "]", ":", "unknown", ";", "}", ";", "type", "CaseLayerMiddle", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "CurrentCase", "extends", "keyof", "Variants", ",", "CaseNames", "extends", "Tuple", "<", "keyof", "Variants", ">", ">", "=", "CaseNames", "extends", "readonly", "[", "infer", "NextCase", ",", "...", "infer", "NextCaseNames", "]", "?", "NextCase", "extends", "string", "?", "{", "[", "VariantName", "in", "keyof", "Variants", "[", "CurrentCase", "]", "]", ":", "NextCaseNames", "extends", "readonly", "[", "]", "?", "CaseLayerLast", "<", "Src", ",", "Variants", ",", "NextCase", ">", "|", "unknown", ":", "NextCaseNames", "extends", "Tuple", "<", "string", ">", "?", "CaseLayerMiddle", "<", "Src", ",", "Variants", ",", "NextCase", ",", "NextCaseNames", ">", ":", "'NextCaseNames not a string[]'", ";", "}", ":", "'NextCase not a string'", ":", "'CaseLayerMiddle never'", ";", "export", "type", "CaseLayer", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ">", "=", "UnionToTuple", "<", "keyof", "Variants", ">", "extends", "readonly", "[", "infer", "CurrentCase", ",", "...", "infer", "CaseNames", "]", "?", "CurrentCase", "extends", "string", "?", "CaseNames", "extends", "readonly", "[", "]", "?", "CaseLayerLast", "<", "Src", ",", "Variants", ",", "CurrentCase", ">", ":", "CaseNames", "extends", "Tuple", "<", "string", ">", "?", "CaseLayerMiddle", "<", "Src", ",", "Variants", ",", "CurrentCase", ",", "CaseNames", ">", ":", "'CaseNames not a string[]'", ":", "'CurrentCase not a string'", ":", "'CaseLayer never'", ";", "type", "ValueOf", "<", "Obj", "extends", "Record", "<", "string", ",", "unknown", ">", ">", "=", "Show", "<", "{", "[", "K", "in", "keyof", "Obj", "]", ":", "Obj", "[", "K", "]", "extends", "infer", "T", "?", "T", ":", "never", ";", "}", "[", "keyof", "Obj", "]", ">", ";", "type", "TypeOfCaseLayerLast", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "CurrentCase", "extends", "keyof", "Variants", ",", "Layer", "extends", "CaseLayerLast", "<", "Src", ",", "Variants", ",", "CurrentCase", ">", ">", "=", "ValueOf", "<", "Layer", ">", ";", "type", "TypeOfCaseLayerMiddle", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "CurrentCase", "extends", "keyof", "Variants", ",", "CaseNames", "extends", "Tuple", "<", "keyof", "Variants", ">", ",", "Layer", "extends", "CaseLayerMiddle", "<", "Src", ",", "Variants", ",", "CurrentCase", ",", "CaseNames", ">", ">", "=", "CaseNames", "extends", "readonly", "[", "infer", "NextCase", ",", "...", "infer", "NextCaseNames", "]", "?", "NextCase", "extends", "string", "?", "NextCaseNames", "extends", "readonly", "[", "]", "?", "ValueOf", "<", "{", "[", "K", "in", "keyof", "Layer", "]", ":", "Layer", "[", "K", "]", "extends", "CaseLayerLast", "<", "Src", ",", "Variants", ",", "NextCase", ">", "?", "TypeOfCaseLayerLast", "<", "Src", ",", "Variants", ",", "NextCase", ",", "Layer", "[", "K", "]", ">", ":", "'TypeOf CaseLayerMiddle A'", ";", "}", ">", ":", "NextCaseNames", "extends", "Tuple", "<", "string", ">", "?", "ValueOf", "<", "{", "[", "K", "in", "keyof", "Layer", "]", ":", "Layer", "[", "K", "]", "extends", "CaseLayerMiddle", "<", "Src", ",", "Variants", ",", "NextCase", ",", "NextCaseNames", ">", "?", "TypeOfCaseLayerMiddle", "<", "Src", ",", "Variants", ",", "NextCase", ",", "NextCaseNames", ",", "Layer", "[", "K", "]", ">", ":", "'TypeOf CaseLayerMiddle B'", ";", "}", ">", ":", "'NextCaseNames not a string[]'", ":", "'NextCase not a string'", ":", "'TypeOf CaseLayerMiddle never'", ";", "type", "IsEq", "<", "A", ",", "B", ">", "=", "A", "extends", "B", "?", "(", "B", "extends", "A", "?", "1", ":", "0", ")", ":", "0", ";", "export", "type", "TypeOfCaseLayer", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "Layer", "extends", "CaseLayer", "<", "Src", ",", "Variants", ">", ">", "=", "UnionToTuple", "<", "keyof", "Variants", ">", "extends", "readonly", "[", "infer", "CurrentCase", ",", "...", "infer", "CaseNames", "]", "?", "CurrentCase", "extends", "string", "?", "CaseNames", "extends", "readonly", "[", "]", "?", "ValueOf", "<", "{", "[", "K", "in", "keyof", "Layer", "]", ":", "Layer", "[", "K", "]", "extends", "CaseLayerLast", "<", "Src", ",", "Variants", ",", "CurrentCase", ">", "?", "TypeOfCaseLayerLast", "<", "Src", ",", "Variants", ",", "CurrentCase", ",", "Layer", "[", "K", "]", ">", ":", "LayerValue", "<", "Src", ",", "Variants", ",", "CurrentCase", ",", "Layer", ",", "K", ">", ";", "}", ">", ":", "CaseNames", "extends", "Tuple", "<", "string", ">", "?", "CaseNames", "extends", "readonly", "[", "infer", "NextCase", ",", "...", "infer", "NextCaseNames", "]", "?", "NextCase", "extends", "string", "?", "NextCaseNames", "extends", "readonly", "[", "]", "?", "ValueOf", "<", "{", "[", "K", "in", "keyof", "Layer", "]", ":", "Layer", "[", "K", "]", "extends", "CaseLayerLast", "<", "Src", ",", "Variants", ",", "NextCase", ">", "?", "TypeOfCaseLayerLast", "<", "Src", ",", "Variants", ",", "NextCase", ",", "Layer", "[", "K", "]", ">", ":", "LayerValue", "<", "Src", ",", "Variants", ",", "NextCase", ",", "Layer", ",", "K", ">", ";", "}", ">", ":", "NextCaseNames", "extends", "Tuple", "<", "string", ">", "?", "ValueOf", "<", "{", "[", "K", "in", "keyof", "Layer", "]", ":", "Layer", "[", "K", "]", "extends", "CaseLayerMiddle", "<", "Src", ",", "Variants", ",", "NextCase", ",", "NextCaseNames", ">", "?", "TypeOfCaseLayerMiddle", "<", "Src", ",", "Variants", ",", "NextCase", ",", "NextCaseNames", ",", "Layer", "[", "K", "]", ">", ":", "LayerValue", "<", "Src", ",", "Variants", ",", "NextCase", ",", "Layer", ",", "K", ">", ";", "}", ">", ":", "'NextCaseNames not a string[]'", ":", "'NextCase not a string'", ":", "'wrong CaseNames'", ":", "'CaseNames not a string[]'", ":", "'CurrentCase not a string'", ":", "'TypeOf CaseLayer never'", ";", "type", "LayerValue", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "Case", "extends", "keyof", "Variants", ",", "Layer", "extends", "CaseLayer", "<", "Src", ",", "Variants", ">", ",", "K", "extends", "keyof", "Layer", ">", "=", "Layer", "[", "K", "]", "extends", "object", "?", "IsEq", "<", "keyof", "Layer", "[", "K", "]", ",", "keyof", "Variants", "[", "Case", "]", ">", "extends", "1", "?", "ValueOf", "<", "{", "[", "L", "in", "keyof", "Layer", "[", "K", "]", "]", ":", "Layer", "[", "K", "]", "[", "L", "]", ";", "}", ">", ":", "Layer", "[", "K", "]", ":", "Layer", "[", "K", "]", ";", "type", "SepCases_", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "AllCases", "extends", "Tuple", "<", "keyof", "Variants", ">", ">", "=", "AllCases", "extends", "readonly", "[", "infer", "CurrentCase", ",", "...", "infer", "CaseNames", "]", "?", "CurrentCase", "extends", "string", "?", "CaseNames", "extends", "readonly", "[", "]", "?", "Partial", "<", "{", "[", "K", "in", "keyof", "Variants", "[", "CurrentCase", "]", "]", ":", "Declarator", ";", "}", "&", "{", "__", ":", "Declarator", ";", "}", ">", ":", "CaseNames", "extends", "Tuple", "<", "string", ">", "?", "Partial", "<", "{", "[", "K", "in", "keyof", "Variants", "[", "CurrentCase", "]", "]", ":", "SepCases_", "<", "Src", ",", "Variants", ",", "CaseNames", ">", "|", "Declarator", ";", "}", "&", "(", "CaseNames", "extends", "readonly", "[", "infer", "CurrentCaseA", ",", "...", "infer", "CaseNamesA", "]", "?", "CurrentCaseA", "extends", "string", "?", "CaseNamesA", "extends", "readonly", "[", "]", "?", "{", "__", ":", "Declarator", ";", "}", ":", "CaseNamesA", "extends", "Tuple", "<", "string", ">", "?", "{", "__", ":", "Declarator", "|", "Partial", "<", "{", "[", "K", "in", "keyof", "Variants", "[", "CurrentCaseA", "]", "]", ":", "Declarator", "|", "SepCases_", "<", "Src", ",", "Variants", ",", "CaseNamesA", ">", ";", "}", ">", ";", "}", ":", "'SepCases_ CaseNamesA not a string[]'", ":", "'SepCases_ CaseNames not a string[] 2'", ":", "'SepCases_ CurrentCaseA not a string'", ")", ">", ":", "'CaseNames not a string[]'", ":", "'CurrentCase not a string'", ":", "'TypeOf CaseLayer never'", ";", "export", "type", "SepCases", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ">", "=", "UnionToTuple", "<", "keyof", "Variants", ">", "extends", "readonly", "[", "...", "infer", "Keys", "]", "?", "Keys", "extends", "Tuple", "<", "keyof", "Variants", ">", "?", "SepCases_", "<", "Src", ",", "Variants", ",", "Keys", ">", ":", "never", ":", "never", ";", "type", "TypeofSepCases_", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "Cases", "extends", "SepCases", "<", "Src", ",", "Variants", ">", ",", "AllCases", "extends", "Tuple", "<", "keyof", "Variants", ">", ">", "=", "AllCases", "extends", "readonly", "[", "infer", "CurrentCase", ",", "...", "infer", "CaseNames", "]", "?", "CurrentCase", "extends", "string", "?", "CaseNames", "extends", "readonly", "[", "]", "?", "ValueOf", "<", "{", "[", "K", "in", "keyof", "Variants", "[", "CurrentCase", "]", "]", ":", "Cases", "[", "K", "]", "extends", "Ref", "<", "infer", "T", ",", "unknown", ">", "?", "T", ":", "'never'", ";", "}", "&", "(", "'__'", "extends", "keyof", "Cases", "?", "{", "__", ":", "Cases", "[", "'__'", "]", "extends", "Ref", "<", "infer", "T", ",", "unknown", ">", "?", "T", ":", "'never 2'", ";", "}", ":", "{", "}", ")", ">", ":", "CaseNames", "extends", "Tuple", "<", "string", ">", "?", "ValueOf", "<", "{", "[", "K", "in", "keyof", "Variants", "[", "CurrentCase", "]", "]", ":", "Cases", "[", "K", "]", "extends", "SepCases_", "<", "Src", ",", "Variants", ",", "CaseNames", ">", "?", "TypeofSepCases_", "<", "Src", ",", "Variants", ",", "Cases", "[", "K", "]", ",", "CaseNames", ">", ":", "Cases", "[", "K", "]", "extends", "Ref", "<", "infer", "T", ",", "unknown", ">", "?", "T", ":", "unknown", ";", "}", "&", "(", "'__'", "extends", "keyof", "Cases", "?", "{", "__", ":", "Cases", "[", "'__'", "]", "extends", "SepCases_", "<", "Src", ",", "Variants", ",", "CaseNames", ">", "?", "TypeofSepCases_", "<", "Src", ",", "Variants", ",", "Cases", "[", "'__'", "]", ",", "CaseNames", ">", ":", "Cases", "[", "'__'", "]", "extends", "Ref", "<", "infer", "T", ",", "unknown", ">", "?", "T", ":", "unknown", ";", "}", ":", "{", "}", ")", ">", ":", "'CaseNames not a string[]'", ":", "'CurrentCase not a string'", ":", "'TypeOf CaseLayer never'", ";", "export", "type", "TypeofSepCases", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "Cases", "extends", "SepCases", "<", "Src", ",", "Variants", ">", ">", "=", "UnionToTuple", "<", "keyof", "Variants", ">", "extends", "readonly", "[", "...", "infer", "Keys", "]", "?", "Keys", "extends", "Tuple", "<", "keyof", "Variants", ">", "?", "TypeofSepCases_", "<", "Src", ",", "Variants", ",", "Cases", ",", "Keys", ">", ":", "'never'", ":", "'never'", ";", "export", "type", "WordValue", "=", "string", "|", "number", "|", "void", "|", "null", "|", "boolean", ";", "export", "type", "WordDecl", "=", "DataDecl", "<", "WordValue", ">", ";", "export", "type", "Word", "=", "WordValue", "|", "WordDecl", ";", "export", "type", "Grouping", "<", "T", "extends", "Record", "<", "string", ",", "any", ">", ">", "=", "{", "filter", "?", ":", "(", "obj", ":", "T", ")", "=>", "boolean", ";", "getHash", ":", "DataDecl", "<", "string", ">", "|", "Record", "<", "string", ",", "Declarator", ">", "|", "Declarator", "[", "]", ";", "describeGroup", ":", "DataDecl", "<", "string", ">", "|", "DataDecl", "<", "{", "description", ":", "string", ";", "noGroup", "?", ":", "boolean", ";", "largeGroup", "?", ":", "string", "|", "null", ";", "}", ">", ";", "createTestLines", ":", "(", "(", "obj", ":", "T", ")", "=>", "any", "[", "]", ")", "|", "{", "type", ":", "'table'", ";", "fields", ":", "Array", "<", "Declarator", ">", "|", "Record", "<", "string", ",", "Declarator", ">", ";", "}", "|", "{", "type", ":", "'text'", ";", "value", ":", "DataDecl", "<", "WordValue", "|", "WordValue", "[", "]", ">", ";", "}", "|", "{", "method", ":", "string", ";", "shape", ":", "Record", "<", "string", ",", "Declarator", "|", "{", "field", ":", "Declarator", ";", "when", ":", "Declarator", ";", "}", ">", ";", "addExpectError", "?", ":", "boolean", "|", "BoolDecl", ";", "}", ";", "sortByFields", "?", ":", "{", "[", "K", "in", "keyof", "T", "]", ":", "Array", "<", "T", "[", "K", "]", ">", "|", "'string'", ";", "}", ";", "pass", "?", ":", "boolean", "|", "BoolDecl", "|", "(", "(", "obj", ":", "T", ")", "=>", "boolean", ")", ";", "tags", "?", ":", "Record", "<", "string", ",", "Declarator", ">", ";", "}", ";", "export", "type", "ExecutionPlan", "=", "{", "shape", ":", "Record", "<", "string", ",", "any", ">", ";", "configReferencedIds", ":", "string", "[", "]", ";", "/**\n * array of references FROM id\n *\n * separate({source: {_: sourceReference}}): referencedBy\n *\n * {[sourceReference]: referencedBy[]}\n *\n * sourceReference -> referencedBy\n **/", "sourceFor", ":", "Record", "<", "string", ",", "string", "[", "]", ">", ";", "/**\n * sources OF id\n *\n * separate({source: {_: sourceReference}}): referencedBy\n *\n * {[referencedBy]: sourceReference[]}\n *\n * sourceReference -> referencedBy\n **/", "sourcesOf", ":", "Record", "<", "string", ",", "string", "[", "]", ">", ";", "sortedIds", ":", "string", "[", "]", ";", "}", ";", "export", "type", "CtxConfig", "=", "{", "header", "?", ":", "string", ";", "grouping", ":", "Grouping", "<", "any", ">", ";", "file", "?", ":", "string", ";", "usedMethods", "?", ":", "string", "[", "]", ";", "}", ";", "export", "type", "PartialCtxConfig", "=", "{", "header", "?", ":", "string", ";", "grouping", "?", ":", "Partial", "<", "Grouping", "<", "any", ">", ">", ";", "file", "?", ":", "string", ";", "usedMethods", "?", ":", "string", "[", "]", ";", "}", ";", "export", "type", "ConfigStructShape", "=", "{", "type", ":", "'shape'", ";", "required", ":", "boolean", ";", "shape", ":", "Record", "<", "string", ",", "ConfigStruct", ">", ";", "}", ";", "export", "type", "ConfigStructKV", "=", "{", "type", ":", "'kv'", ";", "required", ":", "boolean", ";", "}", ";", "export", "type", "ConfigStruct", "=", "{", "type", ":", "'value'", ";", "required", ":", "boolean", ";", "}", "|", "ConfigStructShape", "|", "ConfigStructKV", ";", "export", "type", "Ctx", "=", "{", "shape", ":", "Record", "<", "string", ",", "any", ">", ";", "configUsed", ":", "boolean", ";", "items", ":", "Record", "<", "string", ",", "Declarator", ">", ";", "/**\n * references TO id\n *\n * bool({source: {sourceReference}}): referencedBy\n *\n * {[sourceReference]: referencedBy[]}\n * sourceReference -> referencedBy\n * */", "references", ":", "Record", "<", "string", ",", "string", "[", "]", ">", ";", "/**\n * inline references FROM id\n *\n * separate({cases: {_: targetReference}}): referencedBy\n *\n * {[referencedBy]: targetReference[]}\n * referencedBy -> targetReference\n **/", "targets", ":", "Record", "<", "string", ",", "string", "[", "]", ">", ";", "config", ":", "PartialCtxConfig", ";", "configValidator", ":", "ConfigStructShape", ";", "}", ";", "export", "type", "CaseItem", "<", "T", ">", "=", "{", "value", ":", "T", ";", "text", ":", "string", ";", "pass", ":", "boolean", ";", "description", ":", "string", ";", "}", ";", "export", "type", "JsonOutput", "=", "{", "usedMethods", ":", "string", "[", "]", ";", "header", ":", "string", "[", "]", ";", "groups", ":", "Array", "<", "{", "/** non-unique tag */", "file", ":", "string", ";", "header", ":", "string", ";", "caseItems", ":", "Array", "<", "CaseItem", "<", "any", ">", ">", ";", "}", ">", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
620
[ "import", "{", "Ref", ",", "Declarator", ",", "DataDecl", ",", "BoolDecl", "}", "from", "'./types'", ";", "export", "function", "isRef", "(", "value", ")", "{", "return", "typeof", "value", "===", "'object'", "&&", "value", "!==", "null", "&&", "'__t'", "in", "value", ";", "}", "export", "function", "assertRef", "(", "value", ")", "{", "if", "(", "!", "isRef", "(", "value", ")", ")", "throw", "Error", "(", "`value should be Ref`", ")", ";", "}", "const", "declarators", "=", "[", "'bool'", ",", "'computeVariant'", ",", "'flag'", ",", "'fn'", ",", "'permute'", ",", "'raw'", ",", "'separate'", ",", "'union'", ",", "'value'", ",", "]", ";", "const", "dataDecls", "=", "[", "'computeVariant'", ",", "'fn'", ",", "'permute'", ",", "'raw'", ",", "'separate'", ",", "'value'", ",", "'union'", ",", "]", ";", "const", "boolDecls", "=", "[", "'bool'", ",", "'computeVariant'", ",", "'flag'", ",", "'fn'", ",", "'raw'", ",", "'separate'", ",", "'union'", ",", "'value'", ",", "]", ";", "export", "function", "isDeclarator", "(", "value", ")", "{", "return", "isRef", "(", "value", ")", "&&", "declarators", ".", "includes", "(", "value", ".", "kind", "as", "any", ")", ";", "}", "export", "function", "isDataDecl", "<", "T", ">", "(", "value", ")", ";", "export", "function", "isDataDecl", "(", "value", ")", ";", "export", "function", "isDataDecl", "(", "value", ")", "{", "return", "isRef", "(", "value", ")", "&&", "dataDecls", ".", "includes", "(", "value", ".", "kind", "as", "any", ")", ";", "}", "export", "function", "isBoolDecl", "(", "value", ")", "{", "return", "isRef", "(", "value", ")", "&&", "boolDecls", ".", "includes", "(", "value", ".", "kind", "as", "any", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
621
[ "export", "function", "forIn", "<", "Obj", "extends", "Record", "<", "string", ",", "unknown", ">", ">", "(", "value", ",", "fn", ")", "{", "for", "(", "const", "key", "in", "value", ")", "{", "const", "fnResult", "=", "fn", "(", "value", "[", "key", "]", ",", "key", ",", "value", ")", ";", "if", "(", "fnResult", "!==", "undefined", ")", "return", "fnResult", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1360, null, null, null, null, null, null, null, 506, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
622
[ "import", "{", "Ctx", "}", "from", "'./types'", ";", "export", "let", "ctx", ";", "export", "function", "ctxWrap", "<", "T", ">", "(", "val", ",", "fn", ")", "{", "const", "prevCtx", "=", "ctx", ";", "ctx", "=", "val", ";", "try", "{", "return", "fn", "(", "val", ")", ";", "}", "finally", "{", "ctx", "=", "prevCtx", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, 1154, null, null, null, 11, null, null, null, null, 1154, null, 11, null, null, null, 1154, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
623
[ "import", "{", "forIn", "}", "from", "'../forIn'", ";", "import", "{", "ctx", "}", "from", "'./ctx'", ";", "import", "{", "isRef", "}", "from", "'./isRef'", ";", "import", "{", "Ref", ",", "ExecutionPlan", "}", "from", "'./types'", ";", "function", "getDeclsReferencedByConfig", "(", ")", "{", "const", "results", "=", "[", "]", ";", "const", "grouping", "=", "ctx", ".", "config", ".", "grouping", "!", ";", "const", "{", "pass", ",", "getHash", ",", "describeGroup", ",", "createTestLines", ",", "tags", "}", "=", "grouping", ";", "if", "(", "isRef", "(", "pass", ")", ")", "{", "results", ".", "push", "(", "pass", ")", ";", "}", "if", "(", "isRef", "(", "getHash", ")", ")", "{", "results", ".", "push", "(", "getHash", ")", ";", "}", "else", "if", "(", "typeof", "getHash", "===", "'object'", "&&", "getHash", "!==", "null", ")", "{", "results", ".", "push", "(", "...", "Object", ".", "values", "(", "getHash", ")", ")", ";", "}", "if", "(", "isRef", "(", "describeGroup", ")", ")", "{", "results", ".", "push", "(", "describeGroup", ")", ";", "}", "if", "(", "tags", ")", "{", "results", ".", "push", "(", "...", "Object", ".", "values", "(", "tags", ")", ")", ";", "}", "if", "(", "createTestLines", "&&", "'type'", "in", "createTestLines", ")", "{", "switch", "(", "createTestLines", ".", "type", ")", "{", "case", "'table'", ":", "results", ".", "push", "(", "...", "Object", ".", "values", "(", "createTestLines", ".", "fields", ")", ")", ";", "break", ";", "case", "'text'", ":", "results", ".", "push", "(", "createTestLines", ".", "value", ")", ";", "break", ";", "default", ":", "createTestLines", ".", "type", ";", "}", "}", "else", "if", "(", "createTestLines", "&&", "'method'", "in", "createTestLines", ")", "{", "forIn", "(", "createTestLines", ".", "shape", ",", "value", "=>", "{", "if", "(", "isRef", "(", "value", ")", ")", "results", ".", "push", "(", "value", ")", ";", "else", "results", ".", "push", "(", "value", ".", "field", ",", "value", ".", "when", ")", ";", "}", ")", ";", "if", "(", "isRef", "(", "createTestLines", ".", "addExpectError", ")", ")", "{", "results", ".", "push", "(", "createTestLines", ".", "addExpectError", ")", ";", "}", "}", "return", "[", "...", "new", "Set", "(", "results", ")", "]", ".", "map", "(", "decl", "=>", "decl", ".", "id", ")", ";", "}", "/** {[reference]: referencedBy[]} */", "function", "toposort", "(", "rawGraph", ")", "{", "const", "graph", "=", "{", "}", "as", "Record", "<", "string", ",", "string", "[", "]", ">", ";", "for", "(", "const", "id", "in", "rawGraph", ")", "{", "graph", "[", "id", "]", "=", "[", "...", "new", "Set", "(", "rawGraph", "[", "id", "]", ")", "]", ";", "}", "const", "result", "=", "[", "]", "as", "string", "[", "]", ";", "const", "visited", "=", "{", "}", "as", "Record", "<", "string", ",", "boolean", ">", ";", "const", "temp", "=", "{", "}", "as", "Record", "<", "string", ",", "boolean", ">", ";", "for", "(", "const", "node", "in", "graph", ")", "{", "if", "(", "!", "visited", "[", "node", "]", "&&", "!", "temp", "[", "node", "]", ")", "{", "topologicalSortHelper", "(", "node", ")", ";", "}", "}", "result", ".", "reverse", "(", ")", ";", "return", "result", ";", "function", "topologicalSortHelper", "(", "node", ")", "{", "temp", "[", "node", "]", "=", "true", ";", "const", "neighbors", "=", "graph", "[", "node", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "neighbors", ".", "length", ";", "i", "++", ")", "{", "const", "n", "=", "neighbors", "[", "i", "]", ";", "if", "(", "temp", "[", "n", "]", ")", "{", "throw", "Error", "(", "'found cycle in DAG'", ")", ";", "}", "if", "(", "!", "visited", "[", "n", "]", ")", "{", "topologicalSortHelper", "(", "n", ")", ";", "}", "}", "temp", "[", "node", "]", "=", "false", ";", "visited", "[", "node", "]", "=", "true", ";", "result", ".", "push", "(", "node", ")", ";", "}", "}", "/**\n * foo bar\n *\n *\n * const a = value('inline')\n * const b = value('root', 'b')\n * const c = flag({source: {a}})\n * const d = flag({source: {b}, name: 'd'})\n * const e = value('inline')\n * const f = value('root', 'f')\n * const g = separate({source: {a}, cases: {e}})\n * const h = separate({source: {a}, cases: {f}})\n * //\n * const i = value('inline')\n * const j = separate({source: {a}, cases: {i}})\n * const k = value('root', 'k')\n * const l = separate({source: {a}, cases: {k}})\n * const m = value('inline')\n * const n = separate({source: {a}, cases: {m}})\n * //\n * const o = value('inline')\n * const p = separate({source: {a}, cases: {o}, name: 'p'})\n * const q = value('root', 'q')\n * const r = separate({source: {a}, cases: {q}, name: 'r'})\n * const s = value('inline')\n * const t = separate({source: {a}, cases: {s}, name: 't'})\n *\n * named roots\n *\n *\n *\n * [b, d, f, k, p, q, r, t]\n *\n *\n * inline targets\n *\n * g ~> e\n * h ~> f\n * j ~> i\n * l ~> k\n * n ~> m\n * p ~> o\n * r ~> q\n * t ~> s\n *\n * non-inline targets\n *\n * a -> [c, g, h, j, l, n, p, r, t]\n * b -> d\n *\n *\n * source -> target chains\n *\n * a -> [c, g, h, j, l, n, p, r, t]\n * b -> d\n * c -> []\n * d -> []\n * e -> []\n * f -> []\n * g -> e\n * h -> f\n * i -> []\n * j -> i\n * k -> []\n * l -> k\n * m -> []\n * n -> m\n * o -> []\n * p -> o\n * q -> []\n * r -> q\n * s -> []\n * t -> s\n *\n *\n * target <- source chains\n *\n * a <- []\n * b <- []\n * c <- a\n * d <- []\n * e <- g\n * f <- h\n * g <- a\n * h <- a\n * i <- j\n * j <- a\n * k <- l\n * l <- a\n * m <- n\n * n <- a\n * o <- p\n * p <- a\n * q <- r\n * r <- a\n * s <- t\n * t <- a\n *\n *\n * node -> source / target chains\n *\n * a -> [] / [c, g, h, j, l, n, p, r, t]\n * b -> [] / d\n * c -> a / []\n * d -> [] / []\n * e -> g / []\n * f -> h / []\n * g -> a / e\n * h -> a / f\n * i -> j / []\n * j -> a / i\n * k -> l / []\n * l -> a / k\n * m -> n / []\n * n -> a / m\n * o -> p / []\n * p -> a / o\n * q -> r / []\n * r -> a / q\n * s -> t / []\n * t -> a / s\n */", "export", "function", "processDeclaratorsToShape", "(", ")", "{", "const", "configReferencedIds", "=", "getDeclsReferencedByConfig", "(", ")", ";", "/** graph roots */", "const", "named", "=", "new", "Set", "<", "string", ">", "(", "configReferencedIds", ")", ";", "const", "appearAsInlineTarget", "=", "new", "Set", "<", "string", ">", "(", ")", ";", "/**\n * inline references FROM id\n *\n * separate({cases: {_: targetReference}}): referencedBy\n *\n * {[referencedBy]: targetReference[]}\n *\n * referencedBy -> targetReference\n **/", "const", "inlineRefs", "=", "{", "}", ";", "/**\n * inline references TO id\n *\n * separate({cases: {_: targetReference}}): referencedBy\n *\n * {[targetReference]: referencedBy[]}\n *\n * referencedBy -> targetReference\n **/", "const", "inlineRefsBack", "=", "{", "}", ";", "/**\n * array of references FROM id\n *\n * separate({source: {_: sourceReference}}): referencedBy\n *\n * {[sourceReference]: referencedBy[]}\n *\n * sourceReference -> referencedBy\n **/", "const", "sourceFor", "=", "{", "}", ";", "/**\n * sources OF id\n *\n * separate({source: {_: sourceReference}}): referencedBy\n *\n * {[referencedBy]: sourceReference[]}\n *\n * sourceReference -> referencedBy\n **/", "const", "sourcesOf", "=", "{", "}", ";", "const", "graph", "=", "{", "}", ";", "for", "(", "const", "id", "in", "ctx", ".", "items", ")", "{", "const", "val", "=", "ctx", ".", "items", "[", "id", "]", ";", "const", "refs", "=", "ctx", ".", "references", "[", "id", "]", ";", "const", "targets", "=", "ctx", ".", "targets", "[", "id", "]", ";", "const", "hasName", "=", "val", ".", "name", "!==", "val", ".", "id", ";", "if", "(", "hasName", ")", "{", "named", ".", "add", "(", "id", ")", ";", "}", "if", "(", "!", "sourceFor", "[", "id", "]", ")", "sourceFor", "[", "id", "]", "=", "[", "]", ";", "if", "(", "!", "inlineRefsBack", "[", "id", "]", ")", "inlineRefsBack", "[", "id", "]", "=", "[", "]", ";", "sourcesOf", "[", "id", "]", "=", "[", "]", ";", "inlineRefs", "[", "id", "]", "=", "[", "]", ";", "graph", "[", "id", "]", "=", "[", "]", ";", "if", "(", "refs", ")", "for", "(", "const", "refID", "of", "refs", ")", "{", "sourceFor", "[", "refID", "]", "=", "sourceFor", "[", "refID", "]", "??", "[", "]", ";", "sourceFor", "[", "refID", "]", ".", "push", "(", "id", ")", ";", "sourcesOf", "[", "id", "]", ".", "push", "(", "refID", ")", ";", "}", "if", "(", "targets", ")", "{", "for", "(", "const", "target", "of", "targets", ")", "{", "appearAsInlineTarget", ".", "add", "(", "target", ")", ";", "inlineRefs", "[", "id", "]", ".", "push", "(", "target", ")", ";", "inlineRefsBack", "[", "target", "]", "=", "inlineRefsBack", "[", "target", "]", "??", "[", "]", ";", "inlineRefsBack", "[", "target", "]", ".", "push", "(", "id", ")", ";", "}", "}", "}", "const", "visited", "=", "new", "Set", "<", "string", ">", "(", ")", ";", "const", "only", "=", "new", "Set", "<", "string", ">", "(", ")", ";", "const", "stack", "=", "[", "]", ";", "for", "(", "const", "rootId", "of", "named", ")", "{", "only", ".", "add", "(", "rootId", ")", ";", "visitDecl", "(", "rootId", ")", ";", "}", "for", "(", "const", "id", "in", "graph", ")", "{", "graph", "[", "id", "]", ".", "sort", "(", "(", "a", ",", "b", ")", "=>", "{", "const", "an", "=", "parseInt", "(", "a", ",", "36", ")", ";", "const", "bn", "=", "parseInt", "(", "b", ",", "36", ")", ";", "return", "an", "-", "bn", ";", "}", ")", ";", "}", "const", "sortedIds", "=", "toposort", "(", "graph", ")", ";", "const", "resultShape", "=", "{", "}", ";", "for", "(", "const", "id", "of", "sortedIds", ")", "{", "if", "(", "!", "only", ".", "has", "(", "id", ")", ")", "continue", ";", "const", "item", "=", "ctx", ".", "items", "[", "id", "]", ";", "resultShape", "[", "item", ".", "name", "]", "=", "item", ";", "}", "return", "{", "configReferencedIds", ",", "shape", ":", "resultShape", ",", "sourceFor", ",", "sourcesOf", ",", "sortedIds", ",", "}", ";", "function", "visitDecl", "(", "id", ",", "mode", "=", "'up'", ")", "{", "const", "item", "=", "ctx", ".", "items", "[", "id", "]", ";", "if", "(", "named", ".", "has", "(", "id", ")", "||", "!", "appearAsInlineTarget", ".", "has", "(", "id", ")", "||", "sourcesOf", "[", "id", "]", ".", "length", ">", "0", "||", "inlineRefsBack", "[", "id", "]", ".", "length", ">", "1", "||", "mode", "===", "'up'", ")", "only", ".", "add", "(", "id", ")", ";", "if", "(", "visited", ".", "has", "(", "id", ")", ")", "return", ";", "visited", ".", "add", "(", "id", ")", ";", "stack", ".", "push", "(", "[", "item", ".", "name", "===", "item", ".", "id", "?", "`${", "item", ".", "kind", "}#${", "item", ".", "name", "}`", ":", "item", ".", "name", ",", "mode", ",", "]", ")", ";", "sourceFor", "[", "id", "]", ".", "forEach", "(", "sourceID", "=>", "{", "graph", "[", "sourceID", "]", ".", "push", "(", "id", ")", ";", "visitDecl", "(", "sourceID", ",", "'up'", ")", ";", "}", ")", ";", "inlineRefs", "[", "id", "]", ".", "forEach", "(", "targetID", "=>", "{", "graph", "[", "targetID", "]", ".", "push", "(", "id", ")", ";", "visitDecl", "(", "targetID", ",", "'target'", ")", ";", "}", ")", ";", "stack", ".", "pop", "(", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, 5, null, null, null, null, null, 20, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, 5, null, 17, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, 5, null, null, null, null, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, null, 17, null, null, null, null, null, null, 17, null, null, null, null, null, null, 17, null, null, null, null, null, 17, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, 11945, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 17, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11945, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, 2, null, null, null, null, null, 11945, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
624
[ "import", "{", "ConfigStruct", ",", "ConfigStructShape", ",", "PartialCtxConfig", ",", "CtxConfig", ",", "}", "from", "'./types'", ";", "import", "{", "forIn", "}", "from", "'../forIn'", ";", "const", "Conf", "=", "{", "val", ":", "(", "required", "=", "false", ")", ":", "ConfigStruct", "=>", "(", "{", "type", ":", "'value'", ",", "required", ",", "}", ")", ",", "kv", ":", "(", "required", "=", "false", ")", ":", "ConfigStruct", "=>", "(", "{", "type", ":", "'kv'", ",", "required", ",", "}", ")", ",", "shape", ":", "(", "shape", ")", ":", "ConfigStructShape", "=>", "(", "{", "type", ":", "'shape'", ",", "shape", ",", "required", ":", "isRequiredConfShape", "(", "shape", ")", ",", "}", ")", ",", "}", ";", "export", "const", "confStruct", "=", "Conf", ".", "shape", "(", "{", "header", ":", "Conf", ".", "val", "(", ")", ",", "file", ":", "Conf", ".", "val", "(", ")", ",", "grouping", ":", "Conf", ".", "shape", "(", "{", "filter", ":", "Conf", ".", "val", "(", ")", ",", "getHash", ":", "Conf", ".", "val", "(", "true", ")", ",", "describeGroup", ":", "Conf", ".", "val", "(", "true", ")", ",", "createTestLines", ":", "Conf", ".", "val", "(", "true", ")", ",", "sortByFields", ":", "Conf", ".", "kv", "(", ")", ",", "pass", ":", "Conf", ".", "val", "(", ")", ",", "}", ")", ",", "}", ")", ";", "export", "const", "fileGeneratorConfStruct", "=", "Conf", ".", "shape", "(", "{", "header", ":", "Conf", ".", "val", "(", "true", ")", ",", "file", ":", "Conf", ".", "val", "(", "true", ")", ",", "usedMethods", ":", "Conf", ".", "val", "(", "true", ")", ",", "grouping", ":", "Conf", ".", "shape", "(", "{", "filter", ":", "Conf", ".", "val", "(", ")", ",", "getHash", ":", "Conf", ".", "val", "(", "true", ")", ",", "describeGroup", ":", "Conf", ".", "val", "(", "true", ")", ",", "createTestLines", ":", "Conf", ".", "val", "(", "true", ")", ",", "sortByFields", ":", "Conf", ".", "kv", "(", ")", ",", "pass", ":", "Conf", ".", "val", "(", ")", ",", "tags", ":", "Conf", ".", "kv", "(", ")", ",", "}", ")", ",", "}", ")", ";", "export", "function", "validateRequiredFields", "(", "cfg", ",", "value", ",", "path", ",", "isNested", ")", ";", "export", "function", "validateRequiredFields", "(", "cfg", ",", "value", ")", ";", "export", "function", "validateRequiredFields", "(", "cfg", ",", "value", ",", "path", "=", "[", "]", ",", "isNested", "=", "false", ")", "{", "if", "(", "!", "cfg", ".", "required", ")", "return", "[", "]", ";", "if", "(", "typeof", "value", "!==", "'object'", "||", "value", "===", "null", ")", "{", "const", "results", "=", "collectRequiredFields", "(", "cfg", ".", "shape", ",", "path", ")", ";", "if", "(", "!", "isNested", ")", "{", "const", "paths", "=", "results", ".", "map", "(", "path", "=>", "path", ".", "join", "(", "'.'", ")", ")", ".", "join", "(", "`\\n`", ")", ";", "throw", "Error", "(", "`required config items are missed:\\n${", "paths", "}`", ")", ";", "}", "return", "results", ";", "}", "const", "missedPaths", "=", "[", "]", ";", "forIn", "(", "cfg", ".", "shape", ",", "(", "cfgItem", ",", "field", ")", "=>", "{", "switch", "(", "cfgItem", ".", "type", ")", "{", "case", "'kv'", ":", "case", "'value'", ":", "{", "if", "(", "!", "(", "field", "in", "value", ")", "&&", "cfgItem", ".", "required", ")", "{", "missedPaths", ".", "push", "(", "[", "...", "path", ",", "field", "]", ")", ";", "}", "break", ";", "}", "case", "'shape'", ":", "{", "missedPaths", ".", "push", "(", "...", "validateRequiredFields", "(", "cfgItem", ",", "value", "[", "field", "]", ",", "[", "...", "path", ",", "field", "]", ",", "true", ")", ")", ";", "break", ";", "}", "}", "}", ")", ";", "if", "(", "!", "isNested", "&&", "missedPaths", ".", "length", ">", "0", ")", "{", "const", "paths", "=", "missedPaths", ".", "map", "(", "path", "=>", "path", ".", "join", "(", "'.'", ")", ")", ".", "join", "(", "`\\n`", ")", ";", "throw", "Error", "(", "`required config items are missed:\\n${", "paths", "}`", ")", ";", "}", "return", "missedPaths", ";", "}", "function", "collectRequiredFields", "(", "shape", ",", "path", ")", "{", "const", "results", "=", "[", "]", ";", "forIn", "(", "shape", ",", "(", "item", ",", "field", ")", "=>", "{", "switch", "(", "item", ".", "type", ")", "{", "case", "'kv'", ":", "case", "'value'", ":", "if", "(", "item", ".", "required", ")", "results", ".", "push", "(", "[", "...", "path", ",", "field", "]", ")", ";", "break", ";", "case", "'shape'", ":", "results", ".", "push", "(", "...", "collectRequiredFields", "(", "item", ".", "shape", ",", "[", "...", "path", ",", "field", "]", ")", ")", ";", "break", ";", "}", "}", ")", ";", "return", "results", ";", "}", "function", "isRequiredConfShape", "(", "shape", ")", "{", "for", "(", "const", "field", "in", "shape", ")", "{", "const", "value", "=", "shape", "[", "field", "]", ";", "switch", "(", "value", ".", "type", ")", "{", "case", "'kv'", ":", "case", "'value'", ":", "{", "if", "(", "value", ".", "required", ")", "return", "true", ";", "break", ";", "}", "case", "'shape'", ":", "{", "if", "(", "isRequiredConfShape", "(", "value", ".", "shape", ")", ")", "return", "true", ";", "break", ";", "}", "}", "}", "return", "false", ";", "}", "export", "function", "applyConfigStruct", "(", "cfg", ",", "target", ",", "source", ")", "{", "let", "isApplied", "=", "false", ";", "for", "(", "const", "field", "in", "cfg", ")", "{", "const", "cfgRecord", "=", "cfg", "[", "field", "]", ";", "if", "(", "field", "in", "source", ")", "{", "switch", "(", "cfgRecord", ".", "type", ")", "{", "case", "'value'", ":", "{", "isApplied", "=", "true", ";", "target", "[", "field", "]", "=", "source", "[", "field", "]", ";", "break", ";", "}", "case", "'kv'", ":", "{", "const", "isNewObject", "=", "!", "(", "field", "in", "target", ")", ";", "const", "nestedTarget", "=", "isNewObject", "?", "{", "}", ":", "target", "[", "field", "]", ";", "let", "isNestedApplied", "=", "false", ";", "for", "(", "const", "k", "in", "source", "[", "field", "]", ")", "{", "isNestedApplied", "=", "true", ";", "nestedTarget", "[", "k", "]", "=", "source", "[", "field", "]", "[", "k", "]", ";", "}", "if", "(", "isNestedApplied", ")", "{", "isApplied", "=", "true", ";", "if", "(", "isNewObject", ")", "target", "[", "field", "]", "=", "nestedTarget", ";", "}", "break", ";", "}", "case", "'shape'", ":", "{", "const", "isNewObject", "=", "!", "(", "field", "in", "target", ")", ";", "const", "nestedTarget", "=", "isNewObject", "?", "{", "}", ":", "target", "[", "field", "]", ";", "const", "isNestedApplied", "=", "applyConfigStruct", "(", "cfgRecord", ".", "shape", ",", "nestedTarget", ",", "source", "[", "field", "]", ")", ";", "if", "(", "isNestedApplied", ")", "{", "isApplied", "=", "true", ";", "if", "(", "isNewObject", ")", "target", "[", "field", "]", "=", "nestedTarget", ";", "}", "break", ";", "}", "}", "}", "}", "return", "isApplied", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 31902, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 31902, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 31902, null, null, null, 5, null, 8, null, null, null, null, 8, null, 31902, null, 0, null, null, null, null, 6, null, 31902, null, null, null, 5, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, 46480, null, 68, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 17, null, 5, null, null, null, 5, null, null, null, null, null, null, null, null, null, 46480, null, 68, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 17, null, null, null, null, null, 2, null, null, null, null, null, 46480, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 17, null, 17, null, 17, null, null, null, 8, null, null, null, null, null, null, 2, null, null, null, null, null, 46480, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
625
[ "export", "function", "assert", "(", "condition", ",", "message", "?", ")", "{", "if", "(", "!", "condition", ")", "{", "let", "finalMessage", ";", "if", "(", "typeof", "message", "===", "'function'", ")", "{", "try", "{", "finalMessage", "=", "message", "(", ")", ";", "}", "catch", "(", "err", ")", "{", "console", ".", "error", "(", "err", ")", ";", "}", "}", "else", "finalMessage", "=", "message", ";", "throw", "Error", "(", "finalMessage", "as", "string", ")", ";", "}", "}" ]
[ null, null, 8, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
626
[ "import", "{", "Ref", ",", "SourceRec", ",", "SepCases", ",", "VariantLevel", ",", "Declarator", ",", "Union", ",", "Value", ",", "Fn", ",", "Raw", ",", "ComputeVariant", ",", "Bool", ",", "Separate", ",", "Flag", ",", "Permute", ",", "RawCase", ",", "TypeofSepCases", ",", "Tuple", ",", "SingleVariant", ",", "VariantLevelRec", ",", "CaseLayer", ",", "TypeOfCaseLayer", ",", "Matcher", ",", "Grouping", ",", "ConfigStructShape", ",", "Word", ",", "WordValue", ",", "WordDecl", ",", "}", "from", "'./types'", ";", "import", "{", "isRef", "}", "from", "'./isRef'", ";", "import", "{", "processDeclaratorsToShape", "}", "from", "'./processDeclaratorsToShape'", ";", "import", "{", "ctx", ",", "ctxWrap", "}", "from", "'./ctx'", ";", "import", "{", "applyConfigStruct", ",", "confStruct", ",", "validateRequiredFields", "}", "from", "'./config'", ";", "import", "{", "assert", "}", "from", "'./assert'", ";", "const", "nextID", "=", "(", "(", ")", "=>", "{", "let", "id", "=", "0", ";", "return", "(", ")", "=>", "`__${", "(", "++", "id", ")", ".", "toString", "(", "36", ")", "}`", ";", "}", ")", "(", ")", ";", "function", "getName", "(", "id", ",", "name", "?", ")", "{", "let", "result", "=", "name", "??", "id", ";", "if", "(", "result", "in", "ctx", ".", "shape", ")", "result", "=", "`${", "id", "}_${", "result", "}`", ";", "return", "result", ";", "}", "export", "function", "separate", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "Record", "<", "string", ",", "VariantLevel", "<", "Src", ">", ">", ",", "Cases", "extends", "SepCases", "<", "Src", ",", "Variants", ">", ">", "(", "{", "name", ",", "variant", ",", "cases", ",", "source", ",", "sort", ",", "}", ")", "{", "const", "id", "=", "nextID", "(", ")", ";", "const", "sources", "=", "Object", ".", "values", "(", "source", ")", ";", "const", "variants", "=", "{", "}", "as", "any", ";", "for", "(", "const", "variantName", "in", "variant", ")", "{", "const", "variantRec", "=", "variant", "[", "variantName", "]", ";", "if", "(", "typeof", "variantRec", "!==", "'object'", "||", "variantRec", "===", "null", "||", "Array", ".", "isArray", "(", "variantRec", ")", ")", "{", "throw", "Error", "(", "`variant \"${", "variantName", "}\" should be an object with cases-objects`", ")", ";", "}", "for", "(", "const", "singleMatchName", "in", "variantRec", ")", "{", "const", "singleMatch", "=", "variantRec", "[", "singleMatchName", "]", ";", "if", "(", "typeof", "singleMatch", "!==", "'object'", "||", "singleMatch", "===", "null", ")", "{", "throw", "Error", "(", "`variant \"${", "variantName", "}/${", "singleMatchName", "}\" should be an object with cases-objects`", ")", ";", "}", "for", "(", "const", "singleMatchItem", "of", "Array", ".", "isArray", "(", "singleMatch", ")", "?", "singleMatch", ":", "[", "singleMatch", "]", ")", "{", "for", "(", "const", "field", "in", "singleMatchItem", ")", "{", "if", "(", "!", "(", "field", "in", "source", ")", ")", "{", "throw", "Error", "(", "`variant \"${", "variantName", "}/${", "singleMatchName", "}\" has field \"${", "field", "}\" without source`", ")", ";", "}", "}", "}", "}", "}", "for", "(", "const", "variantName", "in", "variant", ")", "{", "variants", "[", "variantName", "]", "=", "matcher", "(", "source", ",", "variant", "[", "variantName", "]", ")", ";", "}", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'separate'", ",", "__t", ":", "null", "as", "any", ",", "prepared", ":", "{", "}", ",", "variant", ":", "variants", ",", "cases", ":", "traverseCases", "(", "id", ",", "variant", ",", "cases", ")", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ",", "sources", ")", ";", "if", "(", "sort", ")", "config", "(", "{", "grouping", ":", "{", "sortByFields", ":", "{", "[", "val", ".", "name", "]", ":", "sort", "}", "}", "}", ")", ";", "return", "val", ";", "}", "function", "traverseCases", "(", "id", ",", "variants", ",", "cases", ")", "{", "const", "variantNames", "=", "Object", ".", "keys", "(", "variants", ")", ";", "if", "(", "variantNames", ".", "length", "===", "0", ")", "{", "console", ".", "warn", "(", "`empty variants for cases`", ",", "cases", ")", ";", "return", "{", "}", ";", "}", "const", "[", "first", ",", "...", "rest", "]", "=", "variantNames", ";", "return", "traverseCases_", "(", "first", ",", "rest", ",", "variants", ",", "cases", ")", ";", "function", "traverseCases_", "(", "currentVariantName", ",", "nextVariants", ",", "variants", ",", "cases", ")", "{", "const", "resultCases", "=", "{", "}", ";", "const", "variant", "=", "variants", "[", "currentVariantName", "]", ";", "const", "branchNames", "=", "[", "...", "new", "Set", "(", "Array", ".", "isArray", "(", "variant", ")", "?", "variant", ".", "flatMap", "(", "e", "=>", "Object", ".", "keys", "(", "e", ")", ")", ":", "Object", ".", "keys", "(", "variant", ")", ")", ",", "'__'", ",", "]", ";", "for", "(", "const", "branchName", "of", "branchNames", ")", "{", "if", "(", "!", "(", "branchName", "in", "cases", ")", ")", "continue", ";", "const", "caseValue", "=", "cases", "[", "branchName", "]", ";", "if", "(", "isRef", "(", "caseValue", ")", ")", "{", "resultCases", "[", "branchName", "]", "=", "caseValue", ";", "addCasesRefs", "(", "id", ",", "[", "caseValue", "]", ")", ";", "}", "else", "if", "(", "typeof", "caseValue", "===", "'object'", "&&", "caseValue", "!==", "null", ")", "{", "if", "(", "nextVariants", ".", "length", ">", "0", ")", "{", "const", "[", "first", ",", "...", "rest", "]", "=", "nextVariants", ";", "resultCases", "[", "branchName", "]", "=", "traverseCases_", "(", "first", ",", "rest", ",", "variants", ",", "caseValue", "as", "Record", "<", "string", ",", "Declarator", "|", "Record", "<", "string", ",", "unknown", ">", ">", ")", "as", "Record", "<", "string", ",", "Declarator", ">", ";", "}", "else", "{", "const", "val", "=", "value", "(", "caseValue", ")", ";", "resultCases", "[", "branchName", "]", "=", "val", ";", "addCasesRefs", "(", "id", ",", "[", "val", "]", ")", ";", "}", "}", "else", "{", "const", "val", "=", "value", "(", "caseValue", ")", ";", "resultCases", "[", "branchName", "]", "=", "val", ";", "addCasesRefs", "(", "id", ",", "[", "val", "]", ")", ";", "}", "}", "return", "resultCases", ";", "}", "}", "export", "function", "permute", "<", "T", ">", "(", "{", "name", ",", "items", ",", "noReorder", ",", "amount", ",", "sort", ",", "}", ")", "{", "const", "id", "=", "nextID", "(", ")", ";", "const", "permute", "=", "{", "items", "}", ";", "if", "(", "typeof", "noReorder", "===", "'boolean'", ")", "{", "permute", ".", "noReorder", "=", "noReorder", ";", "}", "if", "(", "amount", ")", "permute", ".", "amount", "=", "amount", ";", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'permute'", ",", "__t", ":", "null", "as", "any", ",", "prepared", ":", "{", "}", ",", "permute", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ")", ";", "if", "(", "sort", ")", "config", "(", "{", "grouping", ":", "{", "sortByFields", ":", "{", "[", "val", ".", "name", "]", ":", "sort", "}", "}", "}", ")", ";", "return", "val", ";", "}", "export", "function", "flag", "(", "{", "name", ",", "needs", ",", "avoid", ",", "sort", ",", "}", "=", "{", "}", ")", "{", "const", "id", "=", "nextID", "(", ")", ";", "const", "source", "=", "[", "]", ";", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'flag'", ",", "__t", ":", "null", "as", "any", ",", "prepared", ":", "{", "}", ",", "needs", ":", "needs", "?", "Array", ".", "isArray", "(", "needs", ")", "?", "needs", ".", "map", "(", "processDeclarator", ")", ":", "[", "processDeclarator", "(", "needs", "as", "Declarator", ")", "]", ":", "[", "]", ",", "avoid", ":", "avoid", "?", "Array", ".", "isArray", "(", "avoid", ")", "?", "avoid", ".", "map", "(", "processDeclarator", ")", ":", "[", "processDeclarator", "(", "avoid", "as", "Declarator", ")", "]", ":", "[", "]", ",", "decls", ":", "{", "true", ":", "value", "(", "true", ")", ",", "false", ":", "value", "(", "false", ")", ",", "}", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ",", "source", ")", ";", "addCasesRefs", "(", "val", ".", "id", ",", "[", "val", ".", "decls", ".", "true", ",", "val", ".", "decls", ".", "false", "]", ")", ";", "if", "(", "sort", ")", "config", "(", "{", "grouping", ":", "{", "sortByFields", ":", "{", "[", "val", ".", "name", "]", ":", "sort", "}", "}", "}", ")", ";", "return", "val", ";", "function", "processDeclarator", "(", "decl", ")", "{", "source", ".", "push", "(", "decl", ")", ";", "return", "decl", ".", "id", ";", "}", "}", "export", "function", "bool", "<", "Src", "extends", "SourceRec", ">", "(", "{", "source", ",", "name", ",", "true", ":", "onTrue", ",", "false", ":", "onFalse", ",", "sort", ",", "}", ")", "{", "assert", "(", "(", "!", "onTrue", "&&", "onFalse", ")", "||", "(", "onTrue", "&&", "!", "onFalse", ")", ",", "'either true or false should be defined but not both'", ")", ";", "const", "id", "=", "nextID", "(", ")", ";", "let", "boolDef", ";", "let", "decls", ";", "if", "(", "onFalse", "&&", "!", "onTrue", ")", "{", "boolDef", "=", "{", "true", ":", "singleMatcher", "(", "source", ",", "onFalse", ")", ",", "false", ":", "undefined", ",", "}", ";", "decls", "=", "{", "true", ":", "value", "(", "false", ")", ",", "false", ":", "value", "(", "true", ")", ",", "}", ";", "}", "else", "{", "boolDef", "=", "{", "true", ":", "onTrue", "&&", "singleMatcher", "(", "source", ",", "onTrue", ")", ",", "false", ":", "onFalse", "&&", "singleMatcher", "(", "source", ",", "onFalse", ")", ",", "}", ";", "decls", "=", "{", "true", ":", "value", "(", "true", ")", ",", "false", ":", "value", "(", "false", ")", ",", "}", ";", "}", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'bool'", ",", "__t", ":", "false", ",", "prepared", ":", "{", "}", ",", "bool", ":", "boolDef", ",", "decls", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ",", "source", ")", ";", "addCasesRefs", "(", "val", ".", "id", ",", "[", "val", ".", "decls", ".", "true", ",", "val", ".", "decls", ".", "false", "]", ")", ";", "if", "(", "sort", ")", "config", "(", "{", "grouping", ":", "{", "sortByFields", ":", "{", "[", "val", ".", "name", "]", ":", "sort", "}", "}", "}", ")", ";", "return", "val", ";", "}", "export", "function", "value", "<", "T", ">", "(", "value", ",", "name", "?", ")", "{", "const", "id", "=", "nextID", "(", ")", ";", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'value'", ",", "__t", ":", "value", ",", "prepared", ":", "{", "}", ",", "value", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ")", ";", "return", "val", ";", "}", "export", "function", "union", "<", "OneOf", "extends", "string", ">", "(", "oneOf", ",", "name", "?", ")", ";", "export", "function", "union", "<", "OneOf", "extends", "string", ">", "(", "config", ")", ";", "export", "function", "union", "<", "OneOf", "extends", "string", ">", "(", "oneOf", ",", "name", "?", ")", "{", "const", "items", "=", "Array", ".", "isArray", "(", "oneOf", ")", "?", "oneOf", ":", "oneOf", ".", "oneOf", ";", "const", "id", "=", "nextID", "(", ")", ";", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'union'", ",", "variants", ":", "items", ",", "__t", ":", "null", "as", "any", ",", "prepared", ":", "{", "}", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ")", ";", "if", "(", "!", "Array", ".", "isArray", "(", "oneOf", ")", "&&", "'sort'", "in", "oneOf", ")", "{", "config", "(", "{", "grouping", ":", "{", "sortByFields", ":", "{", "[", "val", ".", "name", "]", ":", "oneOf", ".", "sort", "!", "}", "}", "}", ")", ";", "}", "return", "val", ";", "}", "export", "function", "computeFn", "<", "Src", "extends", "Tuple", "<", "Declarator", ">", "|", "SourceRec", ",", "T", ">", "(", "{", "source", ",", "fn", ",", "name", ",", "sort", ",", "}", ")", "{", "const", "id", "=", "nextID", "(", ")", ";", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'fn'", ",", "__t", ":", "null", "as", "any", ",", "prepared", ":", "{", "}", ",", "fn", "(", "args", ")", "{", "try", "{", "const", "mapped", "=", "argsToSource", "(", "{", "source", ",", "args", ",", "}", ")", ";", "return", "fn", "(", "mapped", ")", ";", "}", "catch", "(", "err", ")", "{", "console", ".", "error", "(", "err", ")", ";", "console", ".", "log", "(", "{", "source", ",", "val", ",", "args", "}", ")", ";", "}", "}", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ",", "source", ")", ";", "if", "(", "sort", ")", "config", "(", "{", "grouping", ":", "{", "sortByFields", ":", "{", "[", "val", ".", "name", "]", ":", "sort", "}", "}", "}", ")", ";", "return", "val", ";", "}", "export", "function", "computeVariants", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevelRec", "<", "Src", ">", ",", "Cases", "extends", "CaseLayer", "<", "Src", ",", "Variants", ">", ">", "(", "{", "source", ",", "variant", ",", "cases", ",", "name", ",", "sort", ",", "}", ")", "{", "const", "id", "=", "nextID", "(", ")", ";", "const", "variants", "=", "{", "}", "as", "any", ";", "for", "(", "const", "variantName", "in", "variant", ")", "{", "variants", "[", "variantName", "]", "=", "matcher", "(", "source", ",", "variant", "[", "variantName", "]", ")", ";", "}", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'computeVariant'", ",", "variant", ":", "variants", ",", "cases", ":", "traverseCases", "(", "id", ",", "variant", ",", "cases", ")", ",", "__t", ":", "null", "as", "any", ",", "prepared", ":", "{", "}", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ",", "source", ")", ";", "if", "(", "sort", ")", "config", "(", "{", "grouping", ":", "{", "sortByFields", ":", "{", "[", "val", ".", "name", "]", ":", "sort", "}", "}", "}", ")", ";", "return", "val", ";", "}", "export", "function", "computeVariant", "<", "Src", "extends", "SourceRec", ",", "Variant", "extends", "VariantLevel", "<", "Src", ">", ",", "Cases", "extends", "{", "[", "K", "in", "keyof", "Variant", "]", ":", "unknown", ";", "}", ">", "(", "{", "source", ",", "variant", ",", "cases", ",", "name", ",", "sort", ",", "}", ")", "{", "return", "computeVariants", "(", "{", "source", ",", "variant", ":", "{", "_", ":", "variant", "}", ",", "cases", ",", "name", ",", "sort", ",", "}", ")", ";", "}", "export", "function", "sortOrder", "(", "decls", ")", "{", "const", "sortByFields", "=", "ctx", ".", "config", ".", "grouping", "!", ".", "sortByFields", "!", ";", "const", "keys", "=", "Object", ".", "keys", "(", "sortByFields", ")", ";", "const", "declNames", "=", "decls", ".", "map", "(", "decl", "=>", "decl", ".", "name", ")", ";", "assert", "(", "declNames", ".", "every", "(", "name", "=>", "keys", ".", "includes", "(", "name", ")", ")", ",", "(", ")", "=>", "{", "const", "missedDecls", "=", "declNames", ".", "filter", "(", "name", "=>", "!", "keys", ".", "includes", "(", "name", ")", ")", ".", "join", "(", "','", ")", ";", "return", "`decls ${", "missedDecls", "} are not sorted`", ";", "}", ")", ";", "const", "declNamesOrdered", "=", "[", "...", "declNames", ",", "...", "keys", ".", "filter", "(", "key", "=>", "!", "declNames", ".", "includes", "(", "key", ")", ")", ",", "]", ";", "const", "result", "=", "{", "}", ";", "for", "(", "const", "name", "of", "declNamesOrdered", ")", "result", "[", "name", "]", "=", "sortByFields", "[", "name", "]", ";", "ctx", ".", "config", ".", "grouping", "!", ".", "sortByFields", "=", "result", ";", "}", "function", "createWordsArray", "(", "x", ",", "args", ")", "{", "if", "(", "args", ".", "length", "===", "0", ")", "return", "x", "as", "any", ";", "const", "words", "=", "[", "x", "[", "0", "]", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "args", ".", "length", ";", "i", "++", ")", "{", "words", ".", "push", "(", "args", "[", "i", "]", ",", "x", "[", "i", "+", "1", "]", ")", ";", "}", "return", "words", ";", "}", "export", "function", "fmt", "(", "x", ",", "...", "args", ")", "{", "const", "decls", "=", "[", "...", "args", ".", "entries", "(", ")", "]", ".", "filter", "(", "(", "[", ",", "e", "]", ")", "=>", "isRef", "(", "e", ")", ")", ".", "map", "(", "(", "[", "idx", ",", "decl", "]", ")", "=>", "{", "return", "{", "decl", ":", "decl", "as", "WordDecl", ",", "position", ":", "idx", ",", "key", ":", "`__${", "idx", "}`", ",", "}", ";", "}", ")", ";", "const", "blueprint", "=", "args", ".", "map", "(", "e", "=>", "(", "isRef", "(", "e", ")", "?", "null", ":", "e", ")", ")", ";", "const", "sources", "=", "{", "}", ";", "for", "(", "const", "{", "key", ",", "decl", "}", "of", "decls", ")", "{", "sources", "[", "key", "]", "=", "decl", ";", "}", "return", "computeFn", "(", "{", "source", ":", "sources", ",", "fn", "(", "values", ")", "{", "const", "resultValues", "=", "[", "...", "blueprint", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "decls", ".", "length", ";", "i", "++", ")", "{", "const", "decl", "=", "decls", "[", "i", "]", ";", "resultValues", "[", "decl", ".", "position", "]", "=", "String", "(", "values", "[", "decl", ".", "key", "]", ")", ";", "}", "return", "createWordsArray", "(", "x", ",", "resultValues", ")", ".", "join", "(", "''", ")", ";", "}", ",", "}", ")", ";", "}", "/** convert internal variable map to object with human-readable fields\n *\n * args = {foo_1: 0, bar_2: 'ok'}\n * source = {foo: foo_1, bar: bar_2}\n * return = {foo: 0, bar: 'ok'}\n * source = [bar_2, foo_1]\n * return = ['ok', 0]\n */", "function", "argsToSource", "<", "Src", "extends", "Tuple", "<", "Declarator", ">", "|", "SourceRec", ">", "(", "{", "source", ",", "args", ",", "}", ")", "{", "let", "namedArgs", ";", "if", "(", "Array", ".", "isArray", "(", "source", ")", ")", "{", "namedArgs", "=", "source", ".", "map", "(", "item", "=>", "{", "const", "{", "name", "}", "=", "item", ";", "return", "name", ";", "}", ")", ";", "}", "else", "{", "const", "argsMap", "=", "{", "}", ";", "for", "(", "const", "key", "in", "source", ")", "{", "const", "item", "=", "(", "source", "as", "SourceRec", ")", "[", "key", "]", ";", "argsMap", "[", "key", "]", "=", "args", "[", "item", ".", "name", "]", ";", "}", "namedArgs", "=", "argsMap", ";", "}", "return", "namedArgs", ";", "}", "/** convert object with human-readable fields to internal variable map\n *\n * caseItem = {foo: 0, bar: 'ok'}\n * source = {foo: foo_1, bar: bar_2}\n * return = {foo_1: 0, bar_2: 'ok'}\n */", "function", "sourceToArgs", "<", "Src", "extends", "SourceRec", ",", "Case", "extends", "Partial", "<", "{", "[", "K", "in", "keyof", "Src", "]", ":", "Src", "[", "K", "]", "extends", "Ref", "<", "infer", "S", ",", "unknown", ">", "?", "S", ":", "never", ";", "}", ">", ">", "(", "source", ",", "caseItem", ")", "{", "const", "realMatchMap", "=", "{", "}", "as", "Record", "<", "string", ",", "any", ">", ";", "for", "(", "const", "alias", "in", "caseItem", ")", "{", "if", "(", "alias", "in", "source", ")", "{", "const", "resolvedName", "=", "source", "[", "alias", "]", ".", "name", ";", "realMatchMap", "[", "resolvedName", "]", "=", "caseItem", "[", "alias", "]", ";", "}", "else", "{", "console", ".", "warn", "(", "`no alias \"${", "alias", "}\" in caseItem`", ",", "caseItem", ")", ";", "console", ".", "trace", "(", "'no alias'", ")", ";", "}", "}", "return", "realMatchMap", ";", "}", "export", "function", "matcher", "<", "Src", "extends", "SourceRec", ",", "Variant", "extends", "VariantLevel", "<", "Src", ">", ">", "(", "source", ",", "cases", ")", ";", "export", "function", "matcher", "<", "Src", "extends", "SourceRec", ",", "Variants", "extends", "VariantLevel", "<", "Src", ">", "[", "]", ">", "(", "source", ",", "cases", ")", ";", "export", "function", "matcher", "<", "Src", "extends", "SourceRec", ",", "Variant", "extends", "VariantLevel", "<", "Src", ">", "|", "VariantLevel", "<", "Src", ">", "[", "]", ">", "(", "source", ",", "cases", ")", "{", "const", "result", "=", "{", "}", "as", "any", ";", "for", "(", "const", "key", "in", "cases", ")", "{", "result", "[", "key", "]", "=", "singleMatcher", "(", "source", ",", "cases", "[", "key", "]", ")", "as", "any", ";", "}", "return", "result", ";", "}", "function", "singleMatcher", "<", "Src", "extends", "SourceRec", ",", "VariantField", "extends", "SingleVariant", "<", "Src", ">", ">", "(", "source", ",", "caseItem", ")", "{", "if", "(", "Array", ".", "isArray", "(", "caseItem", ")", ")", "{", "return", "caseItem", ".", "map", "(", "caseItem", "=>", "sourceToArgs", "(", "source", ",", "caseItem", ")", ")", ";", "}", "return", "sourceToArgs", "(", "source", ",", "caseItem", "as", "Exclude", "<", "VariantField", ",", "Tuple", "<", "Matcher", "<", "Src", ">", ">", ">", ")", ";", "}", "export", "function", "insert", "<", "T", "=", "unknown", ">", "(", "name", ",", "shape", ")", ";", "export", "function", "insert", "<", "T", "=", "unknown", ">", "(", "shape", ")", ";", "export", "function", "insert", "<", "T", "=", "unknown", ">", "(", "...", "args", ")", "{", "const", "id", "=", "nextID", "(", ")", ";", "let", "name", ";", "let", "shape", ";", "if", "(", "typeof", "args", "[", "0", "]", "===", "'string'", "&&", "args", "[", "1", "]", ")", "{", ";", "[", "name", ",", "shape", "]", "=", "args", ";", "}", "else", "{", ";", "[", "shape", "]", "=", "args", ";", "name", "=", "id", ";", "}", "const", "val", "=", "{", "id", ",", "name", ":", "getName", "(", "id", ",", "name", ")", ",", "kind", ":", "'raw'", ",", "value", ":", "shape", ",", "__t", ":", "null", "as", "any", ",", "prepared", ":", "shape", ",", "}", ";", "ctx", ".", "shape", "[", "val", ".", "name", "]", "=", "val", ".", "prepared", ";", "ctx", ".", "items", "[", "val", ".", "id", "]", "=", "val", ";", "addSourceRefs", "(", "val", ".", "id", ")", ";", "return", "val", ";", "}", "export", "function", "config", "(", "data", ")", ";", "export", "function", "config", "<", "T", ">", "(", "data", ")", ";", "export", "function", "config", "(", "data", ")", "{", "const", "configUpdated", "=", "applyConfigStruct", "(", "ctx", ".", "configValidator", ".", "shape", ",", "ctx", ".", "config", ",", "data", ")", ";", "if", "(", "configUpdated", ")", "ctx", ".", "configUsed", "=", "true", ";", "}", "function", "addSourceRefs", "(", "id", ",", "source", "?", ")", "{", "ctx", ".", "references", "[", "id", "]", "=", "[", "]", ";", "if", "(", "source", ")", "{", "if", "(", "Array", ".", "isArray", "(", "source", ")", ")", "{", "for", "(", "const", "sourceItem", "of", "source", ")", "{", "ctx", ".", "references", "[", "sourceItem", ".", "id", "]", "=", "ctx", ".", "references", "[", "sourceItem", ".", "id", "]", "??", "[", "]", ";", "ctx", ".", "references", "[", "sourceItem", ".", "id", "]", ".", "push", "(", "id", ")", ";", "}", "}", "else", "{", "for", "(", "const", "field", "in", "source", ")", "{", "const", "sourceId", "=", "(", "source", "as", "Record", "<", "string", ",", "Declarator", ">", ")", "[", "field", "]", ".", "id", ";", "ctx", ".", "references", "[", "sourceId", "]", "=", "ctx", ".", "references", "[", "sourceId", "]", "??", "[", "]", ";", "ctx", ".", "references", "[", "sourceId", "]", ".", "push", "(", "id", ")", ";", "}", "}", "}", "}", "/** add inline references FROM id */", "function", "addCasesRefs", "(", "id", ",", "targets", ")", "{", "ctx", ".", "targets", "[", "id", "]", "=", "ctx", ".", "targets", "[", "id", "]", "??", "[", "]", ";", "ctx", ".", "targets", "[", "id", "]", ".", "push", "(", "...", "targets", ".", "map", "(", "e", "=>", "e", ".", "id", ")", ")", ";", "}", "export", "function", "exec", "(", "fn", ",", "struct", "=", "confStruct", ")", "{", "return", "ctxWrap", "(", "{", "shape", ":", "{", "}", ",", "configUsed", ":", "false", ",", "items", ":", "{", "}", ",", "references", ":", "{", "}", ",", "targets", ":", "{", "}", ",", "config", ":", "{", "}", ",", "configValidator", ":", "struct", ",", "}", ",", "currCtx", "=>", "{", "fn", "(", ")", ";", "if", "(", "!", "currCtx", ".", "configUsed", ")", "throw", "Error", "(", "'no config() used'", ")", ";", "validateRequiredFields", "(", "currCtx", ".", "configValidator", ",", "currCtx", ".", "config", ")", ";", "const", "plan", "=", "processDeclaratorsToShape", "(", ")", ";", "return", "{", "plan", ",", "items", ":", "currCtx", ".", "items", ",", "grouping", ":", "currCtx", ".", "config", ".", "grouping", ",", "header", ":", "currCtx", ".", "config", ".", "header", "??", "null", ",", "file", ":", "currCtx", ".", "config", ".", "file", "??", "null", ",", "config", ":", "currCtx", ".", "config", ",", "usedMethods", ":", "currCtx", ".", "config", ".", "usedMethods", "??", "null", ",", "}", ";", "}", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 27928, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
627
[ "import", "{", "forIn", "}", "from", "'./forIn'", ";", "type", "Text", "=", "Array", "<", "string", "|", "null", "|", "undefined", "|", "false", ">", ";", "export", "function", "printArray", "(", "array", ")", "{", "return", "`[${", "array", ".", "join", "(", "','", ")", "}]`", ";", "}", "export", "function", "leftPad", "(", "lines", ")", "{", "return", "lines", ".", "join", "(", "`\\n`", ")", ".", "split", "(", "`\\n`", ")", ".", "map", "(", "line", "=>", "` ${", "line", "}`", ")", ";", "}", "export", "function", "wrapText", "(", "firstLine", ",", "lines", ")", "{", "return", "[", "firstLine", ",", "...", "leftPad", "(", "lines", ")", ",", "'})'", "]", ".", "join", "(", "`\\n`", ")", ";", "}", "export", "function", "createDescribe", "(", "description", ",", "lines", ")", "{", "return", "wrapText", "(", "`describe('${", "description", ".", "replace", "(", "/\\'/gi", ",", "'\"'", ")", "}', () => {`", ",", "lines", ".", "filter", "(", "Boolean", ")", "as", "any", ")", ";", "}", "export", "function", "createTest", "(", "description", ",", "lines", ")", "{", "return", "wrapText", "(", "`test('${", "description", ".", "replace", "(", "/\\'/gi", ",", "'\"'", ")", "}', () => {`", ",", "lines", ".", "filter", "(", "Boolean", ")", "as", "any", "[", "]", ")", ";", "}", "export", "function", "printMethod", "(", "{", "method", ",", "value", ",", "shape", ",", "addExpectError", "=", "true", ",", "}", ")", "{", "const", "parts", "=", "[", "method", ",", "'({'", "]", ";", "let", "isFirstField", "=", "true", ";", "forIn", "(", "shape", ",", "(", "schemaRecord", ",", "methodField", ")", "=>", "{", "const", "objectField", "=", "typeof", "schemaRecord", "===", "'string'", "?", "schemaRecord", ":", "schemaRecord", ".", "field", ";", "const", "when", "=", "typeof", "schemaRecord", "===", "'string'", "?", "null", ":", "schemaRecord", ".", "when", ";", "const", "objectFieldValue", "=", "value", "[", "objectField", "]", ";", "if", "(", "when", "&&", "!", "value", "[", "when", "]", ")", "return", ";", "if", "(", "!", "when", "&&", "(", "objectFieldValue", "===", "undefined", "||", "objectFieldValue", "===", "null", ")", ")", "return", ";", "const", "content", "=", "Array", ".", "isArray", "(", "objectFieldValue", ")", "?", "printArray", "(", "objectFieldValue", ")", ":", "`${", "objectFieldValue", "}`", ";", "if", "(", "isFirstField", ")", "{", "parts", ".", "push", "(", "`${", "methodField", "}:${", "content", "}`", ")", ";", "}", "else", "{", "parts", ".", "push", "(", "`, ${", "methodField", "}:${", "content", "}`", ")", ";", "}", "isFirstField", "=", "false", ";", "}", ")", ";", "parts", ".", "push", "(", "'})'", ")", ";", "const", "methodBody", "=", "parts", ".", "join", "(", "''", ")", ";", "if", "(", "addExpectError", ")", "{", "if", "(", "!", "value", ".", "pass", ")", "return", "[", "'//@ts-expect-error'", ",", "methodBody", "]", ".", "join", "(", "`\\n`", ")", ";", "}", "return", "methodBody", ";", "}", "export", "function", "printTable", "(", "{", "values", ",", "only", ":", "fieldSet", ",", "header", ",", "}", ")", "{", "const", "fieldsValues", "=", "{", "}", ";", "fieldSet", ".", "forEach", "(", "(", "field", ",", "idx", ")", "=>", "{", "const", "title", "=", "header", "?", "header", "[", "idx", "]", ":", "field", ";", "fieldsValues", "[", "field", "]", "=", "{", "values", ":", "[", "]", ",", "maxSize", ":", "title", ".", "length", "}", ";", "}", ")", ";", "const", "resultLines", "=", "[", "]", ";", "for", "(", "const", "value", "of", "values", ")", "{", "resultLines", ".", "push", "(", "'| '", ")", ";", "for", "(", "const", "field", "of", "fieldSet", ")", "{", "const", "fieldItem", "=", "fieldsValues", "[", "field", "]", ";", "if", "(", "!", "(", "field", "in", "value", ")", ")", "{", "fieldItem", ".", "values", ".", "push", "(", "''", ")", ";", "}", "else", "{", "const", "result", "=", "String", "(", "value", "[", "field", "]", ")", ";", "fieldItem", ".", "values", ".", "push", "(", "result", ")", ";", "fieldItem", ".", "maxSize", "=", "Math", ".", "max", "(", "fieldItem", ".", "maxSize", ",", "result", ".", "length", ")", ";", "}", "}", "}", "for", "(", "let", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "let", "resultLine", "=", "resultLines", "[", "i", "]", ";", "for", "(", "const", "field", "of", "fieldSet", ")", "{", "const", "fieldItem", "=", "fieldsValues", "[", "field", "]", ";", "const", "textValue", "=", "fieldItem", ".", "values", "[", "i", "]", ";", "resultLine", "+=", "textValue", ";", "if", "(", "textValue", ".", "length", "<", "fieldItem", ".", "maxSize", ")", "{", "resultLine", "+=", "' '", ".", "repeat", "(", "fieldItem", ".", "maxSize", "-", "textValue", ".", "length", ")", ";", "}", "resultLine", "+=", "' | '", ";", "}", "resultLines", "[", "i", "]", "=", "resultLine", ";", "}", "let", "titleLine", "=", "'* '", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "fieldSet", ".", "length", ";", "i", "++", ")", "{", "const", "field", "=", "fieldSet", "[", "i", "]", ";", "const", "fieldItem", "=", "fieldsValues", "[", "field", "]", ";", "const", "title", "=", "header", "?", "header", "[", "i", "]", ":", "field", ";", "titleLine", "+=", "title", ";", "if", "(", "title", ".", "length", "<", "fieldItem", ".", "maxSize", ")", "{", "titleLine", "+=", "' '", ".", "repeat", "(", "fieldItem", ".", "maxSize", "-", "title", ".", "length", ")", ";", "}", "titleLine", "+=", "' * '", ";", "}", "resultLines", ".", "unshift", "(", "titleLine", ")", ";", "return", "resultLines", ";", "}", "export", "function", "printMethodValues", "(", "{", "method", ",", "values", ",", "shape", ",", "addExpectError", ",", "}", ")", "{", "const", "parts", "=", "Array", ".", "from", "(", "values", ",", "(", ")", "=>", "[", "method", ",", "'({'", "]", ")", ";", "const", "isFirstField", "=", "Array", ".", "from", "(", "values", ",", "(", ")", "=>", "true", ")", ";", "forIn", "(", "shape", ",", "(", "schemaRecord", ",", "methodField", ")", "=>", "{", "const", "objectField", "=", "typeof", "schemaRecord", "===", "'string'", "?", "schemaRecord", ":", "schemaRecord", ".", "field", ";", "const", "when", "=", "typeof", "schemaRecord", "===", "'string'", "?", "null", ":", "schemaRecord", ".", "when", ";", "let", "max", "=", "0", ";", "for", "(", "const", "value", "of", "values", ")", "{", "const", "objectFieldValue", "=", "value", "[", "objectField", "]", ";", "if", "(", "when", "&&", "!", "value", "[", "when", "]", ")", "continue", ";", "if", "(", "!", "when", "&&", "(", "objectFieldValue", "===", "undefined", "||", "objectFieldValue", "===", "null", ")", ")", "continue", ";", "const", "content", "=", "Array", ".", "isArray", "(", "objectFieldValue", ")", "?", "printArray", "(", "objectFieldValue", ")", ":", "`${", "objectFieldValue", "}`", ";", "max", "=", "Math", ".", "max", "(", "max", ",", "content", ".", "length", ")", ";", "}", "for", "(", "let", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "const", "value", "=", "values", "[", "i", "]", ";", "const", "objectFieldValue", "=", "value", "[", "objectField", "]", ";", "if", "(", "when", "&&", "!", "value", "[", "when", "]", ")", "continue", ";", "if", "(", "!", "when", "&&", "(", "objectFieldValue", "===", "undefined", "||", "objectFieldValue", "===", "null", ")", ")", "continue", ";", "const", "content", "=", "Array", ".", "isArray", "(", "objectFieldValue", ")", "?", "printArray", "(", "objectFieldValue", ")", ":", "`${", "objectFieldValue", "}`", ";", "const", "alignPad", "=", "' '", ".", "repeat", "(", "max", "-", "content", ".", "length", ")", ";", "if", "(", "isFirstField", "[", "i", "]", ")", "{", "parts", "[", "i", "]", ".", "push", "(", "`${", "methodField", "}:${", "content", "}`", ",", "alignPad", ")", ";", "}", "else", "{", "parts", "[", "i", "]", ".", "push", "(", "`, ${", "methodField", "}:${", "content", "}`", ",", "alignPad", ")", ";", "}", "isFirstField", "[", "i", "]", "=", "false", ";", "}", "}", ")", ";", "parts", ".", "forEach", "(", "part", "=>", "{", "part", ".", "push", "(", "'})'", ")", ";", "}", ")", ";", "values", ".", "forEach", "(", "(", "value", ",", "i", ")", "=>", "{", "if", "(", "addExpectError", "(", "value", ")", ")", "parts", "[", "i", "]", ".", "unshift", "(", "'//'", "+", "`@ts-expect-error\\n`", ")", ";", "}", ")", ";", "return", "parts", ".", "map", "(", "part", "=>", "part", ".", "join", "(", "''", ")", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 549, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 549, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
628
[ "import", "{", "leftPad", ",", "createDescribe", ",", "createTest", ",", "printMethodValues", ",", "printTable", ",", "}", "from", "'../text'", ";", "import", "{", "forIn", "}", "from", "'../forIn'", ";", "import", "{", "DataDecl", ",", "BoolDecl", ",", "Grouping", ",", "Declarator", ",", "WordValue", ",", "CaseItem", ",", "}", "from", "'./types'", ";", "import", "{", "isDataDecl", ",", "isBoolDecl", ",", "assertRef", ",", "isRef", "}", "from", "'./isRef'", ";", "import", "{", "assert", "}", "from", "'./assert'", ";", "type", "Obj", "=", "Record", "<", "string", ",", "any", ">", ";", "function", "createReader", "<", "T", ",", "O", "extends", "Obj", ">", "(", "item", ",", "config", "?", ")", ";", "function", "createReader", "<", "O", "extends", "Obj", ">", "(", "item", ",", "config", "?", ")", ";", "function", "createReader", "<", "T", ",", "O", "extends", "Obj", ">", "(", "item", ",", "{", "defaultVal", ",", "isBool", "=", "false", "}", "=", "{", "}", ")", "{", "if", "(", "typeof", "item", "===", "'function'", ")", "return", "item", "as", "Exclude", "<", "typeof", "item", ",", "T", "&", "Function", ">", ";", "if", "(", "(", "isBool", "&&", "!", "isBoolDecl", "(", "item", ")", ")", "||", "(", "!", "isBool", "&&", "!", "isDataDecl", "(", "item", ")", ")", ")", "{", "return", "(", "obj", ")", "=>", "{", "return", "item", ";", "}", ";", "}", "assertRef", "(", "item", ")", ";", "return", "(", "obj", ")", "=>", "{", "const", "result", "=", "obj", "[", "item", ".", "name", "]", ";", "if", "(", "result", "===", "undefined", ")", "{", "if", "(", "defaultVal", "!==", "undefined", ")", "return", "defaultVal", ";", "throw", "Error", "(", "`no field \"${", "item", ".", "name", "}\"`", ")", ";", "}", "return", "result", ";", "}", ";", "}", "function", "createHashReader", "<", "T", "extends", "Obj", ">", "(", "getHash", ")", "{", "if", "(", "isDataDecl", "(", "getHash", ")", ")", "return", "createReader", "(", "getHash", ")", ";", "const", "declList", "=", "Array", ".", "isArray", "(", "getHash", ")", "?", "getHash", ":", "Object", ".", "values", "(", "getHash", ")", ";", "declList", ".", "forEach", "(", "value", "=>", "{", "assertRef", "(", "value", ")", ";", "}", ")", ";", "return", "(", "obj", ")", "=>", "{", "const", "values", "=", "[", "]", ";", "declList", ".", "forEach", "(", "decl", "=>", "{", "const", "value", "=", "obj", "[", "decl", ".", "name", "]", ";", "assert", "(", "value", "!==", "undefined", ",", "`undefined getHash for ${", "decl", ".", "name", "}`", ")", ";", "values", ".", "push", "(", "String", "(", "value", ")", ")", ";", "}", ")", ";", "return", "values", ".", "join", "(", "' '", ")", ";", "}", ";", "}", "function", "createDedupeReader", "<", "T", "extends", "Obj", ">", "(", "objectToLines", ")", "{", "return", "(", "value", ")", "=>", "{", "const", "linesRaw", "=", "objectToLines", "(", "value", ")", ";", "const", "textLines", "=", "Array", ".", "isArray", "(", "linesRaw", ")", "?", "linesRaw", ":", "[", "linesRaw", "]", ";", "return", "textLines", ".", "filter", "(", "(", "line", ")", ":", "line", "is", "string", "=>", "typeof", "line", "===", "'string'", ")", ".", "map", "(", "line", "=>", "line", ".", "replace", "(", "/ /gim", ",", "''", ")", ")", ".", "filter", "(", "line", "=>", "!", "line", ".", "includes", "(", "`@ts-expect-error`", ")", ")", ".", "join", "(", "`\\n`", ")", ";", "}", ";", "}", "export", "function", "createGroupedCases", "<", "T", "extends", "Obj", ">", "(", "casesDefs", ",", "{", "createTestLines", ",", "getHash", ",", "describeGroup", ",", "sortByFields", ",", "filter", ",", "pass", ",", "tags", ",", "}", ")", "{", "let", "caseSerializer", "=", "value", "=>", "(", "{", "}", ")", ";", "if", "(", "tags", ")", "{", "caseSerializer", "=", "value", "=>", "{", "const", "result", "=", "{", "}", ";", "forIn", "(", "tags", ",", "(", "decl", ",", "field", ")", "=>", "{", "result", "[", "field", "]", "=", "value", "[", "decl", ".", "id", "]", ";", "}", ")", ";", "return", "result", ";", "}", ";", "}", "let", "dedupeGetter", ";", "const", "hashGetter", "=", "createHashReader", "(", "getHash", ")", ";", "const", "groupDescriber", "=", "createReader", "(", "describeGroup", "as", "DataDecl", "<", "string", "|", "{", "description", ":", "string", ";", "noGroup", "?", ":", "boolean", "|", "undefined", ";", "largeGroup", "?", ":", "string", "|", "null", "|", "undefined", ";", "}", ">", ")", ";", "const", "passGetter", "=", "createReader", "(", "pass", "!", ",", "{", "isBool", ":", "true", ",", "defaultVal", ":", "true", ",", "}", ")", ";", "if", "(", "filter", ")", "{", "casesDefs", "=", "casesDefs", ".", "filter", "(", "filter", ")", ";", "}", "let", "renderMode", "=", "'method'", ";", "let", "createLinesForTestList", ";", "let", "mode", ";", "const", "testLinesSet", "=", "new", "Map", "<", "string", ",", "any", ">", "(", ")", ";", "if", "(", "typeof", "createTestLines", "===", "'object'", "&&", "createTestLines", "!==", "null", ")", "{", "if", "(", "'type'", "in", "createTestLines", ")", "{", "switch", "(", "createTestLines", ".", "type", ")", "{", "case", "'table'", ":", "{", "mode", "=", "{", "type", ":", "'table'", "}", ";", "renderMode", "=", "'table'", ";", "let", "header", ";", "let", "fields", ";", "if", "(", "!", "Array", ".", "isArray", "(", "createTestLines", ".", "fields", ")", ")", "{", "header", "=", "Object", ".", "keys", "(", "createTestLines", ".", "fields", ")", ";", "fields", "=", "Object", ".", "values", "(", "createTestLines", ".", "fields", ")", ";", "}", "else", "{", "fields", "=", "createTestLines", ".", "fields", ";", "}", "const", "only", "=", "fields", ".", "map", "(", "e", "=>", "e", ".", "name", ")", ";", "createLinesForTestList", "=", "(", "values", ")", "=>", "(", "{", "items", ":", "[", "]", ",", "textLines", ":", "printTable", "(", "{", "values", ",", "only", ",", "header", ",", "}", ")", ",", "}", ")", ";", "break", ";", "}", "case", "'text'", ":", "{", "renderMode", "=", "'text'", ";", "const", "renderer", "=", "mode", "=", "{", "type", ":", "'text'", ",", "textValueReader", ":", "createReader", "(", "createTestLines", ".", "value", ")", "}", ";", "const", "renderVisibleValues", "=", "(", "values", ",", "isPass", ")", "=>", "{", "const", "lines", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "const", "value", "=", "values", "[", "i", "]", ";", "if", "(", "value", "===", "null", "||", "value", "===", "undefined", ")", "continue", ";", "lines", ".", "push", "(", "String", "(", "value", ")", ")", ";", "}", "if", "(", "lines", ".", "length", "===", "0", ")", "return", "[", "]", ";", "if", "(", "!", "isPass", ")", "lines", ".", "push", "(", "'//'", "+", "'@ts-expect-error'", ")", ";", "return", "lines", ";", "}", ";", "function", "createLineBlock", "(", "value", ")", "{", "const", "linesRaw", "=", "renderer", ".", "textValueReader", "(", "value", ")", ";", "return", "renderVisibleValues", "(", "Array", ".", "isArray", "(", "linesRaw", ")", "?", "linesRaw", ":", "[", "linesRaw", "]", ",", "true", ")", ";", "}", "if", "(", "!", "dedupeGetter", ")", "{", "dedupeGetter", "=", "createDedupeReader", "(", "createLineBlock", ")", ";", "}", "createLinesForTestList", "=", "(", "values", ",", "pass", ",", "description", ")", "=>", "{", "const", "lineBlocks", "=", "values", ".", "map", "(", "createLineBlock", ")", ";", "const", "items", "=", "values", ".", "map", "(", "(", "value", ",", "i", ")", "=>", "{", "const", "lines", "=", "lineBlocks", "[", "i", "]", ";", "return", "{", "value", ":", "caseSerializer", "(", "value", ")", ",", "pass", ",", "text", ":", "lines", ".", "join", "(", "`\\n`", ")", ",", "description", ",", "}", ";", "}", ")", ";", "return", "{", "items", ",", "textLines", ":", "lineBlocks", ".", "flat", "(", ")", ",", "}", ";", "}", ";", "break", ";", "}", "default", ":", "createTestLines", ".", "type", ";", "}", "}", "else", "{", "mode", "=", "{", "type", ":", "'method'", "}", ";", "renderMode", "=", "'method'", ";", "const", "{", "method", ",", "shape", ",", "addExpectError", "=", "(", "obj", ")", "=>", "!", "passGetter", "(", "obj", ")", ",", "}", "=", "createTestLines", ";", "const", "readExpectError", "=", "createReader", "(", "addExpectError", ",", "{", "isBool", ":", "true", "}", ")", ";", "const", "printShape", "=", "{", "}", ";", "forIn", "(", "shape", ",", "(", "value", ",", "key", ")", "=>", "{", "printShape", "[", "key", "]", "=", "isRef", "(", "value", ")", "?", "value", ".", "name", ":", "{", "field", ":", "value", ".", "field", ".", "name", ",", "when", ":", "value", ".", "when", ".", "name", "}", ";", "}", ")", ";", "if", "(", "!", "dedupeGetter", ")", "{", "dedupeGetter", "=", "createDedupeReader", "(", "value", "=>", "printMethodValues", "(", "{", "method", ",", "values", ":", "[", "value", "]", ",", "shape", ":", "printShape", ",", "addExpectError", ":", "(", ")", "=>", "false", ",", "}", ")", ")", ";", "}", "createLinesForTestList", "=", "(", "values", ",", "pass", ",", "description", ")", "=>", "{", "const", "textLines", "=", "printMethodValues", "(", "{", "method", ",", "values", ",", "shape", ":", "printShape", ",", "addExpectError", ":", "readExpectError", ",", "}", ")", ";", "return", "{", "textLines", ",", "items", ":", "values", ".", "map", "(", "(", "value", ",", "i", ")", "=>", "(", "{", "value", ":", "caseSerializer", "(", "value", ")", ",", "text", ":", "textLines", "[", "i", "]", ",", "pass", ",", "description", ",", "}", ")", ")", ",", "}", ";", "}", ";", "}", "}", "else", "{", "if", "(", "!", "dedupeGetter", ")", "{", "dedupeGetter", "=", "createDedupeReader", "(", "createTestLines", ")", ";", "}", "createLinesForTestList", "=", "(", "values", ",", "pass", ",", "description", ")", "=>", "{", "const", "lineBlocks", "=", "values", ".", "map", "(", "value", "=>", "createTestLines", "(", "value", ")", ".", "filter", "(", "line", "=>", "typeof", "line", "===", "'string'", ")", ")", ";", "const", "items", "=", "values", ".", "map", "(", "(", "value", ",", "i", ")", "=>", "{", "const", "lines", "=", "lineBlocks", "[", "i", "]", ";", "return", "{", "value", ":", "caseSerializer", "(", "value", ")", ",", "pass", ",", "text", ":", "lines", ".", "join", "(", "`\\n`", ")", ",", "description", ",", "}", ";", "}", ")", ";", "return", "{", "items", ",", "textLines", ":", "lineBlocks", ".", "flat", "(", ")", ",", "}", ";", "}", ";", "}", "const", "isAafterB", "=", "(", "sortByFields", "&&", "skewHeapSortFieldsComparator", "(", "sortByFields", ")", ")", "!", ";", "function", "sortList", "<", "T", ">", "(", "list", ")", "{", "if", "(", "!", "sortByFields", ")", "return", "[", "...", "list", "]", ";", "return", "[", "...", "list", "]", ".", "sort", "(", "(", "a", ",", "b", ")", "=>", "{", "const", "ab", "=", "isAafterB", "(", "a", ",", "b", ")", ";", "const", "ba", "=", "isAafterB", "(", "b", ",", "a", ")", ";", "if", "(", "!", "ab", "&&", "!", "ba", ")", "return", "0", ";", "if", "(", "ab", "&&", "ba", ")", "return", "0", ";", "return", "ab", "?", "-", "1", ":", "1", ";", "}", ")", ";", "}", "const", "casesDefsPending", "=", "sortList", "(", "[", "...", "casesDefs", "]", ")", ";", "if", "(", "sortByFields", ")", "{", "casesDefsPending", ".", "forEach", "(", "(", "e", ",", "id", ")", "=>", "{", "e", ".", "__casesDefsID", "=", "id", ";", "}", ")", ";", "}", "type", "Group", "=", "{", "itemsPass", ":", "T", "[", "]", ";", "itemsFail", ":", "T", "[", "]", ";", "description", ":", "string", ";", "largeGroup", ":", "string", "|", "null", ";", "noGroup", ":", "boolean", ";", "}", ";", "const", "defsGroups", "=", "new", "Map", "<", "string", ",", "Group", ">", "(", ")", ";", "let", "cur", ";", "while", "(", "(", "cur", "=", "casesDefsPending", ".", "shift", "(", ")", ")", ")", "{", "if", "(", "dedupeGetter", ")", "{", "const", "caseDefHash", "=", "dedupeGetter", "(", "cur", ")", ";", "if", "(", "testLinesSet", ".", "has", "(", "caseDefHash", ")", ")", "continue", ";", "testLinesSet", ".", "set", "(", "caseDefHash", ",", "cur", ")", ";", "}", "const", "hash", "=", "hashGetter", "(", "cur", ")", ";", "let", "set", "=", "defsGroups", ".", "get", "(", "hash", ")", ";", "if", "(", "!", "set", ")", "{", "set", "=", "{", "itemsPass", ":", "[", "]", ",", "itemsFail", ":", "[", "]", ",", "description", ":", "''", ",", "largeGroup", ":", "null", ",", "noGroup", ":", "false", ",", "}", ";", "defsGroups", ".", "set", "(", "hash", ",", "set", ")", ";", "}", ";", "(", "passGetter", "(", "cur", ")", "?", "set", ".", "itemsPass", ":", "set", ".", "itemsFail", ")", ".", "push", "(", "cur", ")", ";", "const", "description", "=", "groupDescriber", "(", "cur", ")", ";", "if", "(", "typeof", "description", "===", "'string'", ")", "{", "set", ".", "description", "=", "description", ";", "}", "else", "{", "set", ".", "noGroup", "=", "description", ".", "noGroup", "??", "false", ";", "set", ".", "description", "=", "description", ".", "description", ";", "set", ".", "largeGroup", "=", "description", ".", "largeGroup", "||", "null", ";", "}", "}", "const", "descriptions", "=", "{", "}", "as", "Record", "<", "string", ",", "Group", ">", ";", "for", "(", "const", "[", "hash", ",", "group", "]", "of", "[", "...", "defsGroups", "]", ")", "{", "const", "text", "=", "`${", "group", ".", "largeGroup", "||", "''", "} ${", "group", ".", "description", "}`", ";", "if", "(", "text", "in", "descriptions", ")", "{", "defsGroups", ".", "delete", "(", "hash", ")", ";", "const", "{", "itemsPass", ",", "itemsFail", "}", "=", "descriptions", "[", "text", "]", ";", "itemsPass", ".", "splice", "(", "itemsPass", ".", "length", ",", "0", ",", "...", "group", ".", "itemsPass", ")", ";", "itemsFail", ".", "splice", "(", "itemsFail", ".", "length", ",", "0", ",", "...", "group", ".", "itemsFail", ")", ";", "continue", ";", "}", "descriptions", "[", "text", "]", "=", "group", ";", "}", "const", "largeGroups", "=", "{", "}", "as", "Record", "<", "string", ",", "string", "[", "]", ">", ";", "const", "resultCases", "=", "[", "]", "as", "string", "[", "]", ";", "const", "resultCasesItems", "=", "[", "]", "as", "Array", "<", "CaseItem", "<", "T", ">", ">", ";", "const", "createTestSuiteItem", "=", "(", "{", "pass", ",", "items", ",", "description", ",", "textLinesFlat", ",", "}", ")", "=>", "{", "switch", "(", "renderMode", ")", "{", "case", "'table'", ":", "{", "const", "passText", "=", "description", "?", "pass", "?", "' (pass)'", ":", "' (fail)'", ":", "pass", "?", "'pass'", ":", "'fail'", ";", "return", "[", "`\\n## ${", "description", "}${", "passText", "}`", ",", "...", "textLinesFlat", "]", ".", "join", "(", "`\\n`", ")", ";", "}", "case", "'text'", ":", "case", "'method'", ":", "{", "const", "passText", "=", "pass", "?", "'(should pass)'", ":", "'(should fail)'", ";", "const", "blockOpen", "=", "items", ".", "length", "===", "1", "?", "null", ":", "'{'", ";", "const", "blockClose", "=", "items", ".", "length", "===", "1", "?", "null", ":", "'}'", ";", "const", "itemsLines", "=", "items", ".", "length", "===", "1", "?", "textLinesFlat", ":", "leftPad", "(", "textLinesFlat", ")", ";", "return", "createTest", "(", "`${", "description", "} ${", "passText", "}`", ",", "[", "'//prettier-ignore'", ",", "blockOpen", ",", "...", "itemsLines", ",", "blockClose", ",", "'expect(typecheck).toMatchInlineSnapshot()'", ",", "]", ")", ";", "}", "}", "}", ";", "for", "(", "let", "{", "description", ",", "itemsPass", ",", "itemsFail", ",", "noGroup", ",", "largeGroup", ",", "}", "of", "defsGroups", ".", "values", "(", ")", ")", "{", "if", "(", "itemsPass", ".", "length", "===", "0", "&&", "itemsFail", ".", "length", "===", "0", ")", "continue", ";", "const", "testSuiteItems", "=", "[", "]", "as", "string", "[", "]", ";", "if", "(", "itemsPass", ".", "length", ">", "0", ")", "{", "const", "itemsFull", "=", "createLinesForTestList", "!", "(", "itemsPass", ",", "true", ",", "description", ")", ";", "testSuiteItems", ".", "push", "(", "createTestSuiteItem", "(", "{", "items", ":", "itemsPass", ",", "pass", ":", "true", ",", "description", ",", "textLinesFlat", ":", "itemsFull", ".", "textLines", ",", "}", ")", ")", ";", "resultCasesItems", ".", "push", "(", "...", "itemsFull", ".", "items", ")", ";", "}", "if", "(", "itemsFail", ".", "length", ">", "0", ")", "{", "const", "itemsFull", "=", "createLinesForTestList", "!", "(", "itemsFail", ",", "false", ",", "description", ")", ";", "testSuiteItems", ".", "push", "(", "createTestSuiteItem", "(", "{", "items", ":", "itemsFail", ",", "pass", ":", "false", ",", "description", ",", "textLinesFlat", ":", "itemsFull", ".", "textLines", ",", "}", ")", ")", ";", "resultCasesItems", ".", "push", "(", "...", "itemsFull", ".", "items", ")", ";", "}", "const", "lines", "=", "[", "]", "as", "string", "[", "]", ";", "if", "(", "noGroup", "||", "testSuiteItems", ".", "length", "===", "1", ")", "{", "lines", ".", "push", "(", "...", "testSuiteItems", ")", ";", "}", "else", "{", "let", "line", ";", "switch", "(", "renderMode", ")", "{", "case", "'table'", ":", "line", "=", "[", "`# ${", "description", "}`", ",", "...", "leftPad", "(", "testSuiteItems", ")", "]", ".", "join", "(", "`\\n`", ")", ";", "break", ";", "case", "'method'", ":", "case", "'text'", ":", "line", "=", "createDescribe", "(", "description", ",", "testSuiteItems", ")", ";", "break", ";", "}", "lines", ".", "push", "(", "line", ")", ";", "}", "if", "(", "largeGroup", "!==", "null", ")", "{", "if", "(", "!", "(", "largeGroup", "in", "largeGroups", ")", ")", "{", "largeGroups", "[", "largeGroup", "]", "=", "[", "]", ";", "}", "largeGroups", "[", "largeGroup", "]", ".", "push", "(", "...", "lines", ")", ";", "}", "else", "{", "resultCases", ".", "push", "(", "...", "lines", ")", ";", "}", "}", "if", "(", "renderMode", "===", "'table'", ")", "resultCases", ".", "push", "(", "``", ")", ";", "const", "largeGroupsContent", "=", "Object", ".", "entries", "(", "largeGroups", ")", ".", "map", "(", "(", "[", "text", ",", "items", "]", ")", "=>", "{", "switch", "(", "renderMode", ")", "{", "case", "'table'", ":", "return", "[", "`# ${", "text", "}`", ",", "...", "leftPad", "(", "items", ")", "]", ".", "join", "(", "`\\n`", ")", ";", "case", "'text'", ":", "case", "'method'", ":", "return", "createDescribe", "(", "text", ",", "items", ")", ";", "}", "}", ")", ";", "const", "finalLines", "=", "[", "...", "largeGroupsContent", ",", "...", "resultCases", "]", ";", "return", "{", "finalLines", ",", "resultCasesItems", ",", "}", ";", "}", "const", "collator", "=", "new", "Intl", ".", "Collator", "(", "'en'", ",", "{", "caseFirst", ":", "'upper'", ",", "usage", ":", "'sort'", ",", "sensitivity", ":", "'variant'", ",", "numeric", ":", "true", ",", "}", ")", ";", "function", "skewHeapSortFieldsComparator", "<", "Obj", "extends", "Record", "<", "string", ",", "ReadonlyArray", "<", "any", ">", "|", "'string'", ">", ">", "(", "sortByFields", ")", "{", "const", "fields", "=", "[", "]", "as", "Array", "<", "{", "field", ":", "keyof", "Obj", ";", "isVoidFalse", ":", "boolean", ";", "type", ":", "'prioritySet'", ";", "prioritySet", ":", "ReadonlyArray", "<", "any", ">", ";", "}", "|", "{", "field", ":", "keyof", "Obj", ";", "isVoidFalse", ":", "boolean", ";", "type", ":", "'string'", ";", "}", ">", ";", "forIn", "(", "sortByFields", ",", "(", "prioritySet", ",", "field", ")", "=>", "{", "if", "(", "prioritySet", "===", "'string'", ")", "{", "fields", ".", "push", "(", "{", "field", ",", "isVoidFalse", ":", "false", ",", "type", ":", "'string'", ",", "}", ")", ";", "}", "else", "{", "const", "isVoidFalse", "=", "prioritySet", ".", "includes", "(", "false", ")", "&&", "!", "prioritySet", ".", "includes", "(", "undefined", ")", ";", "fields", ".", "push", "(", "{", "field", ",", "isVoidFalse", ",", "type", ":", "'prioritySet'", ",", "prioritySet", ":", "[", "...", "prioritySet", "]", ".", "reverse", "(", ")", ",", "}", ")", ";", "}", "}", ")", ";", "return", "function", "isAafterB", "(", "a", ",", "b", ")", "{", "for", "(", "let", "i", "=", "0", ";", "i", "<", "fields", ".", "length", ";", "i", "++", ")", "{", "const", "item", "=", "fields", "[", "i", "]", ";", "const", "{", "field", ",", "isVoidFalse", "}", "=", "item", ";", "let", "aVal", "=", "a", "[", "field", "]", ";", "let", "bVal", "=", "b", "[", "field", "]", ";", "if", "(", "isVoidFalse", ")", "{", "if", "(", "aVal", "===", "undefined", ")", "aVal", "=", "false", ";", "if", "(", "bVal", "===", "undefined", ")", "bVal", "=", "false", ";", "}", "if", "(", "aVal", "===", "bVal", ")", "continue", ";", "switch", "(", "item", ".", "type", ")", "{", "case", "'prioritySet'", ":", "{", "const", "{", "prioritySet", "}", "=", "item", ";", "const", "ai", "=", "prioritySet", ".", "indexOf", "(", "aVal", ")", ";", "const", "bi", "=", "prioritySet", ".", "indexOf", "(", "bVal", ")", ";", "const", "hasA", "=", "ai", "!==", "-", "1", ";", "const", "hasB", "=", "bi", "!==", "-", "1", ";", "if", "(", "hasA", "&&", "!", "hasB", ")", "return", "false", ";", "if", "(", "!", "hasA", "&&", "hasB", ")", "return", "true", ";", "if", "(", "!", "hasA", "&&", "!", "hasB", ")", "continue", ";", "return", "ai", ">", "bi", ";", "}", "case", "'string'", ":", "{", "return", "collator", ".", "compare", "(", "aVal", ",", "bVal", ")", ">", "0", ";", "}", "}", "}", "const", "idDiff", "=", "a", ".", "__casesDefsID", "-", "b", ".", "__casesDefsID", ";", "if", "(", "idDiff", "!==", "0", ")", "return", "idDiff", ">", "0", ";", "console", ".", "count", "(", "'indifferentiated elements'", ")", ";", "console", ".", "log", "(", "a", ",", "b", ")", ";", "return", "false", ";", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, 8, null, null, null, null, null, null, null, null, 6, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
629
[ "import", "{", "printArray", "}", "from", "'../text'", ";", "import", "{", "assert", "}", "from", "'./assert'", ";", "import", "{", "CtxConfig", ",", "Declarator", ",", "ExecutionPlan", "}", "from", "'./types'", ";", "import", "{", "isDeclarator", "}", "from", "'./isRef'", ";", "type", "ValueCtx", "=", "{", "value", ":", "Record", "<", "string", ",", "any", ">", ";", "executedIds", ":", "string", "[", "]", ";", "}", ";", "type", "VariantGroupCfg", "=", "{", "type", ":", "'variantGroup'", ";", "name", ":", "string", ";", "group", ":", "VariantCfg", "[", "]", ";", "}", ";", "type", "VariantCfg", "=", "{", "type", ":", "'variant'", ";", "name", ":", "string", ";", "acceptableShapes", ":", "Record", "<", "string", ",", "any", ">", "[", "]", ";", "}", ";", "function", "normalizeSplitConfig", "(", "def", ")", "{", "const", "{", "cases", ",", "variant", ":", "variants", "}", "=", "def", ";", "const", "variantsSeq", "=", "Object", ".", "entries", "(", "variants", ")", ".", "map", "(", "(", "[", "variantGroupName", ",", "variantGroup", "]", ")", ":", "VariantGroupCfg", "=>", "(", "{", "type", ":", "'variantGroup'", ",", "name", ":", "variantGroupName", ",", "group", ":", "Object", ".", "entries", "(", "variantGroup", ")", ".", "map", "(", "(", "[", "variantName", ",", "variant", "]", ")", ":", "VariantCfg", "=>", "(", "{", "type", ":", "'variant'", ",", "name", ":", "variantName", ",", "acceptableShapes", ":", "Array", ".", "isArray", "(", "variant", ")", "?", "variant", ":", "[", "variant", "]", ",", "}", ")", ")", ",", "}", ")", ")", ";", "variantsSeq", ".", "forEach", "(", "group", "=>", "{", "if", "(", "group", ".", "group", ".", "every", "(", "e", "=>", "e", ".", "name", "!==", "'__'", ")", ")", "{", "group", ".", "group", ".", "push", "(", "{", "type", ":", "'variant'", ",", "name", ":", "'__'", ",", "acceptableShapes", ":", "[", "{", "}", "]", ",", "}", ")", ";", "}", "}", ")", ";", "function", "processSubcase", "(", "path", ",", "caseValue", ")", "{", "const", "usedVariantsGroups", "=", "variantsSeq", ".", "slice", "(", "0", ",", "path", ".", "length", ")", ";", "const", "isLastVariantGroup", "=", "variantsSeq", ".", "length", "<=", "path", ".", "length", ";", "const", "matchedVariants", "=", "[", "...", "path", ".", "entries", "(", ")", "]", ".", "map", "(", "(", "[", "idx", ",", "variantName", "]", ")", "=>", "{", "const", "variantGroupSeq", "=", "usedVariantsGroups", "[", "idx", "]", ";", "const", "variant", "=", "variantGroupSeq", ".", "group", ".", "find", "(", "e", "=>", "e", ".", "name", "===", "variantName", ")", ";", "assert", "(", "variant", "!==", "undefined", ",", "(", ")", "=>", "`no variant \"${", "[", "...", "path", ",", "variantName", "]", ".", "join", "(", "' | '", ")", "}\"`", ")", ";", "return", "variant", ";", "}", ")", ";", "assert", "(", "!", "isLastVariantGroup", "||", "isDeclarator", "(", "caseValue", ")", ",", "'deepest case should contain only declarators'", ")", ";", "/** if current case is plain value then it assumed to be constant */", "if", "(", "isDeclarator", "(", "caseValue", ")", ")", "return", "[", "{", "usedVariantsGroups", ",", "matchedVariants", ",", "operation", ":", "caseValue", ",", "}", ",", "]", ";", "if", "(", "typeof", "caseValue", "===", "'object'", "&&", "caseValue", "!==", "null", ")", "{", "const", "caseKeys", "=", "Object", ".", "keys", "(", "caseValue", ")", ";", "assert", "(", "!", "Array", ".", "isArray", "(", "caseValue", ")", ",", "'not implemented'", ")", ";", "const", "validBranchNames", "=", "variantsSeq", "[", "usedVariantsGroups", ".", "length", "]", ".", "group", ".", "map", "(", "e", "=>", "e", ".", "name", ")", ";", "if", "(", "caseKeys", ".", "every", "(", "key", "=>", "validBranchNames", ".", "includes", "(", "key", ")", ")", ")", "{", "/** if current case contains only valid branch names then it is branch selector */", "return", "caseKeys", ".", "flatMap", "(", "key", "=>", "processSubcase", "(", "[", "...", "path", ",", "key", "]", ",", "caseValue", "[", "key", "]", "as", "Record", "<", "string", ",", "Declarator", "|", "Record", "<", "string", ",", "unknown", ">", ">", ")", ")", ";", "}", "else", "{", "/** otherwise current case is a value */", "throw", "Error", "(", "'not implemented'", ")", ";", "}", "}", "else", "{", "assert", "(", "typeof", "caseValue", "!==", "'function'", ",", "'not implemented'", ")", ";", "throw", "Error", "(", "'not implemented'", ")", ";", "}", "}", "const", "caseSeq", "=", "Object", ".", "entries", "(", "cases", ")", ".", "flatMap", "(", "(", "[", "caseName", ",", "caseValue", "]", ")", "=>", "processSubcase", "(", "[", "caseName", "]", ",", "caseValue", "as", "Declarator", "|", "Record", "<", "string", ",", "Declarator", "|", "Record", "<", "string", ",", "unknown", ">", ">", ")", ")", ";", "return", "caseSeq", ";", "}", "let", "currCfg", ";", "export", "function", "byFields", "(", "plan", ",", "config", ",", "items", ")", "{", "const", "prevCfg", "=", "currCfg", ";", "const", "shapeIds", "=", "Object", ".", "keys", "(", "items", ")", ";", "const", "namesToIds", "=", "{", "}", ";", "const", "idsToNames", "=", "{", "}", ";", "for", "(", "const", "id", "of", "shapeIds", ")", "{", "const", "item", "=", "items", "[", "id", "]", ";", "idsToNames", "[", "id", "]", "=", "item", ".", "name", ";", "namesToIds", "[", "item", ".", "name", "]", "=", "id", ";", "}", "currCfg", "=", "{", "cfg", ":", "config", ",", "plan", ",", "items", ",", "namesToIds", ",", "}", ";", "try", "{", "let", "values", "=", "[", "{", "value", ":", "{", "}", ",", "executedIds", ":", "[", "]", "}", "]", ";", "for", "(", "const", "key", "in", "plan", ".", "shape", ")", "{", "const", "def", "=", "plan", ".", "shape", "[", "key", "]", ";", "values", "=", "addFieldToValues", "(", "values", ",", "key", ",", "def", ")", ";", "}", "return", "values", ";", "}", "finally", "{", "currCfg", "=", "prevCfg", ";", "}", "}", "function", "addFieldToValues", "(", "values", ",", "key", ",", "def", ")", "{", "switch", "(", "def", ".", "kind", ")", "{", "case", "'union'", ":", "{", "values", "=", "permuteField", "(", "values", ",", "key", ",", "{", "items", ":", "def", ".", "variants", "as", "readonly", "any", "[", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "1", "}", ",", "unbox", ":", "true", ",", "}", ")", ";", "break", ";", "}", "case", "'value'", ":", "{", "values", "=", "values", ".", "map", "(", "(", "val", ")", ":", "ValueCtx", "=>", "(", "{", "executedIds", ":", "[", "...", "val", ".", "executedIds", ",", "key", "]", ",", "value", ":", "{", "...", "val", ".", "value", ",", "[", "key", "]", ":", "def", ".", "value", "}", ",", "}", ")", ")", ";", "break", ";", "}", "case", "'permute'", ":", "{", "values", "=", "permuteField", "(", "values", ",", "key", ",", "{", "items", ":", "def", ".", "permute", ".", "items", ",", "amount", ":", "def", ".", "permute", ".", "amount", ",", "noReorder", ":", "def", ".", "permute", ".", "noReorder", ",", "unbox", ":", "false", ",", "}", ")", ";", "break", ";", "}", "case", "'bool'", ":", "{", "values", "=", "processBranches", "(", "values", ",", "key", ",", "{", "variant", ":", "{", "_", ":", "def", ".", "bool", ".", "true", "?", "{", "true", ":", "def", ".", "bool", ".", "true", ",", "false", ":", "{", "}", ",", "}", ":", "{", "false", ":", "def", ".", "bool", ".", "false", "!", ",", "true", ":", "{", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "true", ":", "def", ".", "decls", ".", "true", ",", "false", ":", "def", ".", "decls", ".", "false", "}", ",", "}", ")", ";", "break", ";", "}", "case", "'fn'", ":", "{", "values", "=", "values", ".", "map", "(", "(", "val", ")", ":", "ValueCtx", "=>", "(", "{", "executedIds", ":", "[", "...", "val", ".", "executedIds", ",", "key", "]", ",", "value", ":", "{", "...", "val", ".", "value", ",", "[", "key", "]", ":", "def", ".", "fn", "(", "val", ".", "value", ")", "}", ",", "}", ")", ")", ";", "break", ";", "}", "case", "'computeVariant'", ":", "{", "values", "=", "processBranches", "(", "values", ",", "key", ",", "def", ")", ";", "break", ";", "}", "case", "'flag'", ":", "{", "values", "=", "permuteField", "(", "values", ",", "key", ",", "{", "items", "(", "val", ")", "{", "if", "(", "def", ".", "needs", ".", "every", "(", "id", "=>", "!", "!", "val", "[", "id", "]", ")", "&&", "def", ".", "avoid", ".", "every", "(", "id", "=>", "!", "val", "[", "id", "]", ")", ")", "return", "[", "false", ",", "true", "]", ";", "return", "[", "false", "]", ";", "}", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "1", "}", ",", "unbox", ":", "true", ",", "}", ")", ";", "break", ";", "}", "case", "'separate'", ":", "{", "values", "=", "processBranches", "(", "values", ",", "key", ",", "def", ")", ";", "break", ";", "}", "}", "return", "values", ";", "}", "function", "processBranches", "(", "values", ",", "key", ",", "def", ")", "{", "const", "normalizedSplit", "=", "normalizeSplitConfig", "(", "def", ")", ";", "return", "values", ".", "flatMap", "(", "value", "=>", "{", "for", "(", "const", "item", "of", "normalizedSplit", ")", "{", "const", "areAccepted", "=", "areMatchedVariantsAccepted", "(", "value", ".", "value", ",", "item", ".", "matchedVariants", ")", ";", "if", "(", "areAccepted", ")", "return", "addFieldToValues", "(", "[", "value", "]", ",", "key", ",", "item", ".", "operation", ")", ";", "}", "/** when no declaration is matched return value untouched */", "return", "[", "value", "]", ";", "}", ")", ";", "}", "function", "areMatchedVariantsAccepted", "(", "value", ",", "matchedVariants", ")", "{", "for", "(", "const", "variantItem", "of", "matchedVariants", ")", "{", "const", "isAccepted", "=", "isOneOfShapesAccepted", "(", "value", ",", "variantItem", ".", "acceptableShapes", ")", ";", "if", "(", "!", "isAccepted", ")", "return", "false", ";", "}", "return", "true", ";", "}", "function", "isOneOfShapesAccepted", "(", "value", ",", "acceptableShapes", ")", "{", "for", "(", "const", "item", "of", "acceptableShapes", ")", "{", "if", "(", "isShapeAccepted", "(", "value", ",", "item", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "function", "isShapeAccepted", "(", "value", ",", "acceptableShape", ")", "{", "for", "(", "const", "key", "in", "acceptableShape", ")", "{", "const", "acceptableValue", "=", "acceptableShape", "[", "key", "]", ";", "if", "(", "!", "(", "key", "in", "value", ")", "||", "value", "[", "key", "]", "!==", "acceptableValue", ")", "return", "false", ";", "}", "return", "true", ";", "}", "function", "permuteField", "(", "values", ",", "field", ",", "config", ")", "{", "const", "{", "items", ",", "amount", ":", "{", "min", "=", "0", ",", "max", "=", "items", ".", "length", "-", "1", "}", "=", "{", "}", ",", "ignore", ",", "unbox", ",", "noReorder", "=", "false", ",", "}", "=", "config", ";", "let", "results", ";", "if", "(", "typeof", "items", "===", "'function'", ")", "{", "results", "=", "values", ".", "flatMap", "(", "value", "=>", "{", "return", "selectFromNToM", "(", "items", "(", "value", ".", "value", ")", ",", "min", ",", "max", ",", "noReorder", ")", ".", "map", "(", "(", "combination", ")", ":", "ValueCtx", "=>", "(", "{", "executedIds", ":", "[", "...", "value", ".", "executedIds", ",", "field", "]", ",", "value", ":", "{", "...", "value", ".", "value", ",", "[", "field", "]", ":", "unbox", "?", "combination", "[", "0", "]", ":", "combination", ",", "}", ",", "}", ")", ")", ";", "}", ")", ";", "}", "else", "{", "results", "=", "selectFromNToM", "(", "items", ",", "min", ",", "max", ",", "noReorder", ")", ".", "flatMap", "(", "combination", "=>", "values", ".", "map", "(", "(", "val", ")", ":", "ValueCtx", "=>", "(", "{", "executedIds", ":", "[", "...", "val", ".", "executedIds", ",", "field", "]", ",", "value", ":", "{", "...", "val", ".", "value", ",", "[", "field", "]", ":", "unbox", "?", "combination", "[", "0", "]", ":", "combination", ",", "}", ",", "}", ")", ")", ")", ";", "}", "if", "(", "ignore", ")", "return", "results", ".", "filter", "(", "ignore", ")", ";", "return", "results", ";", "}", "function", "selectFromNToM", "<", "T", ">", "(", "items", ",", "from", ",", "to", ",", "noReorder", ")", "{", "const", "result", "=", "[", "]", "as", "T", "[", "]", "[", "]", ";", "const", "fn", "=", "noReorder", "?", "selectNNoReorder", ":", "selectN", ";", "for", "(", "let", "i", "=", "from", ";", "i", "<", "Math", ".", "min", "(", "to", "+", "1", ",", "items", ".", "length", "+", "1", ")", ";", "i", "++", ")", "{", "result", ".", "push", "(", "...", "fn", "(", "items", ",", "i", ")", ")", ";", "}", "return", "result", ";", "}", "function", "selectNNoReorder", "<", "T", ">", "(", "items", ",", "n", ")", "{", "if", "(", "n", ">", "items", ".", "length", ")", "return", "[", "[", "]", "]", ";", "if", "(", "n", "===", "0", ")", "return", "[", "[", "]", "]", ";", "if", "(", "n", "===", "1", ")", "return", "items", ".", "map", "(", "item", "=>", "[", "item", "]", ")", ";", "const", "result", "=", "[", "]", ";", "const", "subItems", "=", "[", "...", "items", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "items", ".", "length", ";", "i", "++", ")", "{", "subItems", ".", "splice", "(", "i", ",", "1", ")", ";", "result", ".", "push", "(", "...", "selectNNoReorder", "(", "subItems", ",", "n", "-", "1", ")", ".", "map", "(", "nested", "=>", "[", "items", "[", "i", "]", ",", "...", "nested", "]", ")", ".", "filter", "(", "selection", "=>", "[", "...", "new", "Set", "(", "selection", ")", "]", ".", "length", "===", "selection", ".", "length", ")", ")", ";", "}", "return", "result", ";", "}", "function", "selectN", "<", "T", ">", "(", "items", ",", "n", ")", "{", "if", "(", "n", "===", "0", ")", "return", "[", "[", "]", "]", ";", "if", "(", "n", "===", "1", ")", "return", "items", ".", "map", "(", "item", "=>", "[", "item", "]", ")", ";", "const", "result", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "items", ".", "length", ";", "i", "++", ")", "{", "const", "subItems", "=", "[", "...", "items", "]", ";", "subItems", ".", "splice", "(", "i", ",", "1", ")", ";", "result", ".", "push", "(", "...", "selectN", "(", "subItems", ",", "n", "-", "1", ")", ".", "map", "(", "nested", "=>", "[", "items", "[", "i", "]", ",", "...", "nested", "]", ")", ")", ";", "}", "return", "result", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, 37602, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 13, null, 5, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, 37602, null, null, null, null, null, null, null, 37602, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, 37602, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, 5, null, 0, null, 0, null, 17, null, null, null, 6, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, 17, null, null, null, null, null, null, null, 2, null, null, null, null, null, 11945, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, 2, null, 11945, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 27929, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 27929, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, 2, null, 6, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, 27929, null, null, null, null, null, 6, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, 5, null, null, null, null, null, 37602, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, 5, null, null, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, 17, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, 2, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 27929, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, 27929, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, 3, null, 3, null, 8, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, null, 5, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
630
[ "import", "{", "promises", "}", "from", "'fs'", ";", "import", "{", "resolve", "}", "from", "'path'", ";", "import", "{", "exec", "}", "from", "'./operators'", ";", "import", "{", "createGroupedCases", "}", "from", "'./createGroupedCases'", ";", "import", "{", "byFields", "}", "from", "'./byFields'", ";", "import", "{", "fileGeneratorConfStruct", "}", "from", "'./config'", ";", "import", "{", "leftPad", "}", "from", "'../text'", ";", "import", "{", "CaseItem", ",", "JsonOutput", "}", "from", "'./types'", ";", "export", "function", "jsonOutputToAnnotatedFile", "(", "jsonOutput", ")", "{", "/** annotations[groupIndex][caseIndex] */", "const", "annotations", "=", "[", "]", ";", "const", "file", "=", "[", "...", "resplitLines", "(", "jsonOutput", ".", "header", ")", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "jsonOutput", ".", "groups", ".", "length", ";", "i", "++", ")", "{", "const", "group", "=", "jsonOutput", ".", "groups", "[", "i", "]", ";", "file", ".", "push", "(", "';{'", ",", "...", "resplitLines", "(", "[", "group", ".", "header", "]", ")", ")", ";", "for", "(", "let", "j", "=", "0", ";", "j", "<", "group", ".", "caseItems", ".", "length", ";", "j", "++", ")", "{", "const", "caseItem", "=", "group", ".", "caseItems", "[", "j", "]", ";", "const", "lines", "=", "resplitLines", "(", "[", "caseItem", ".", "text", "]", ")", ".", "filter", "(", "line", "=>", "!", "line", ".", "includes", "(", "'ts-expect-error'", ")", ")", ";", "annotations", ".", "push", "(", "{", "fromLine", ":", "file", ".", "length", ",", "toLine", ":", "file", ".", "length", "+", "lines", ".", "length", "+", "2", ",", "group", ":", "i", ",", "caseItem", ":", "j", ",", "}", ")", ";", "file", ".", "push", "(", "';{'", ",", "...", "lines", ",", "'}'", ")", ";", "}", "file", ".", "push", "(", "'}'", ")", ";", "}", "return", "{", "file", ":", "file", ".", "join", "(", "`\\n`", ")", ",", "annotations", ",", "}", ";", "function", "resplitLines", "(", "lines", ")", "{", "return", "lines", ".", "join", "(", "`\\n`", ")", ".", "split", "(", "`\\n`", ")", ";", "}", "}", "export", "function", "generateFileData", "(", "{", "cases", "}", ")", "{", "const", "fileMap", "=", "{", "}", ";", "for", "(", "const", "caseFn", "of", "cases", ")", "{", "const", "execResult", "=", "exec", "(", "caseFn", ",", "fileGeneratorConfStruct", ")", ";", "const", "{", "finalLines", ":", "generatedLines", ",", "resultCasesItems", "}", "=", "createGroupedCases", "(", "byFields", "(", "execResult", ".", "plan", ",", "execResult", ".", "config", ",", "execResult", ".", "items", ")", ".", "map", "(", "e", "=>", "e", ".", "value", ")", ",", "execResult", ".", "grouping", ")", ";", "const", "file", "=", "execResult", ".", "file", "!", ";", "const", "header", "=", "execResult", ".", "header", "!", ".", "trim", "(", ")", ";", "const", "usedMethods", "=", "execResult", ".", "usedMethods", "!", ";", "if", "(", "!", "(", "file", "in", "fileMap", ")", ")", "fileMap", "[", "file", "]", "=", "[", "]", ";", "fileMap", "[", "file", "]", ".", "push", "(", "{", "header", ",", "usedMethods", ",", "generatedLines", ",", "caseItems", ":", "resultCasesItems", ",", "}", ")", ";", "}", "const", "jsonOutput", "=", "{", "usedMethods", ":", "[", "]", ",", "header", ":", "[", "]", ",", "groups", ":", "[", "]", ",", "}", ";", "const", "fileResults", "=", "Object", ".", "entries", "(", "fileMap", ")", ".", "map", "(", "(", "[", "file", ",", "blocks", "]", ")", "=>", "{", "const", "usedMethods", "=", "[", "...", "new", "Set", "(", "blocks", ".", "flatMap", "(", "block", "=>", "block", ".", "usedMethods", ")", ")", "]", ";", "jsonOutput", ".", "usedMethods", "=", "[", "...", "new", "Set", "(", "[", "...", "jsonOutput", ".", "usedMethods", ",", "...", "usedMethods", "]", ")", ",", "]", ";", "const", "fileLines", "=", "[", "'/* eslint-disable no-unused-vars */'", ",", "`import {${", "usedMethods", ".", "join", "(", "', '", ")", "}} from 'effector'`", ",", "`const typecheck = '{global}'`", ",", "]", ";", "for", "(", "const", "block", "of", "blocks", ")", "{", "jsonOutput", ".", "groups", ".", "push", "(", "{", "file", ",", "header", ":", "block", ".", "header", ",", "caseItems", ":", "block", ".", "caseItems", ",", "}", ")", ";", "}", "if", "(", "blocks", ".", "length", "===", "1", ")", "{", "const", "[", "block", "]", "=", "blocks", ";", "fileLines", ".", "push", "(", "block", ".", "header", ",", "...", "block", ".", "generatedLines", ")", ";", "}", "else", "{", "for", "(", "const", "block", "of", "blocks", ")", "{", "fileLines", ".", "push", "(", "'{'", ")", ";", "fileLines", ".", "push", "(", "...", "leftPad", "(", "[", "block", ".", "header", "]", ")", ")", ";", "fileLines", ".", "push", "(", "...", "leftPad", "(", "block", ".", "generatedLines", ")", ")", ";", "fileLines", ".", "push", "(", "'}'", ")", ";", "}", "}", "const", "fullFileName", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'__tests__'", ",", "'effector'", ",", "...", "`${", "file", "}.test.ts`", ".", "split", "(", "'/'", ")", ")", ";", "const", "readableFileName", "=", "`__tests__/effector/${", "file", "}.test.ts`", ";", "const", "content", "=", "fileLines", ".", "join", "(", "`\\n`", ")", ";", "return", "{", "fullFileName", ",", "content", ",", "readableFileName", "}", ";", "}", ")", ";", "jsonOutput", ".", "header", "=", "[", "'/* eslint-disable no-unused-vars */'", ",", "`import {${", "jsonOutput", ".", "usedMethods", ".", "join", "(", "', '", ")", "}} from 'effector'`", ",", "`const typecheck = '{global}'`", ",", "]", ";", "const", "jsonOutputFileName", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'jsonOutput.json'", ")", ";", "return", "{", "jsonResult", ":", "{", "fileName", ":", "jsonOutputFileName", ",", "output", ":", "jsonOutput", ",", "}", ",", "fileResults", ",", "}", ";", "}", "export", "async", "function", "generateFile", "(", "{", "cases", "}", ")", "{", "const", "{", "jsonResult", ",", "fileResults", "}", "=", "generateFileData", "(", "{", "cases", "}", ")", ";", "await", "Promise", ".", "all", "(", "fileResults", ".", "map", "(", "(", "{", "fullFileName", ",", "content", "}", ")", "=>", "promises", ".", "writeFile", "(", "fullFileName", ",", "content", ")", ")", ")", ";", "await", "promises", ".", "writeFile", "(", "jsonResult", ".", "fileName", ",", "JSON", ".", "stringify", "(", "jsonResult", ".", "output", ",", "null", ",", "2", ")", ")", ";", "const", "filesTotal", "=", "fileResults", ".", "map", "(", "(", "{", "readableFileName", "}", ")", "=>", "readableFileName", ")", ";", "console", ".", "log", "(", "`generated files:\\n${", "filesTotal", ".", "join", "(", "`\\n`", ")", "}`", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 46482, null, null, null, null, 5, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46483, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
631
[ "import", "{", "Value", "}", "from", "'../runner/manifold/types'", ";", "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "computeVariants", ",", "bool", ",", "separate", ",", "flag", ",", "config", ",", "permute", ",", "sortOrder", ",", "}", "from", "'../runner/manifold/operators'", ";", "const", "header", "=", "`\ntype AB = {a: string; b: number}\nconst voidt = createEvent()\nconst anyt = createEvent<any>()\nconst str = createEvent<string>()\nconst strClk = createEvent<string>()\nconst num = createEvent<number>()\nconst a = createStore('')\nconst b = createStore(0)\nconst aTarget = createEvent<{a: string}>()\nconst abTarget = createEvent<AB>()\nconst aclock = createEvent<{a: string; clock: any}>()\nconst abclock = createEvent<{a: string; b: number; clock: any}>()\nconst fnAbClockString = ({a,b}:AB, clock:string) => ({a,b,clock})\nconst fnAbClockAny = ({a,b}:AB, clock:any) => ({a,b,clock})\nconst fnAString = (a:string) => ({a})\nconst fnAStringClockString = (a:string, clock:string) => ({a,clock})\nconst fnAStringClockAny = (a:string, clock:any) => ({a,clock})\nconst fnAb = ({a,b}:AB) => ({a,b})\n`", ";", "export", "default", "(", ")", "=>", "{", "const", "noSource", "=", "flag", "(", "{", "sort", ":", "[", "false", ",", "true", "]", "}", ")", ";", "const", "clockArray", "=", "flag", "(", "{", "sort", ":", "[", "false", ",", "true", "]", ",", "needs", ":", "noSource", "}", ")", ";", "const", "combinable", "=", "flag", "(", "{", "sort", ":", "[", "false", ",", "true", "]", ",", "avoid", ":", "noSource", "}", ")", ";", "const", "fn", "=", "flag", "(", "{", "sort", ":", "[", "false", ",", "true", "]", "}", ")", ";", "const", "noTarget", "=", "flag", "(", "{", "sort", ":", "[", "true", ",", "false", "]", "}", ")", ";", "const", "noClock", "=", "flag", "(", "{", "sort", ":", "[", "true", ",", "false", "]", ",", "avoid", ":", "noSource", "}", ")", ";", "const", "secondArgument", "=", "flag", "(", "{", "needs", ":", "fn", ",", "avoid", ":", "[", "noClock", ",", "noSource", "]", ",", "}", ")", ";", "const", "explicitArgumentTypes", "=", "flag", "(", "{", "needs", ":", "fn", ",", "}", ")", ";", "const", "unificationToAny", "=", "flag", "(", "{", "sort", ":", "[", "false", ",", "true", "]", ",", "avoid", ":", "[", "noClock", ",", "noSource", "]", ",", "}", ")", ";", "const", "fnClockTypeAssertion", "=", "flag", "(", "{", "sort", ":", "[", "false", ",", "true", "]", ",", "needs", ":", "[", "fn", ",", "secondArgument", ",", "explicitArgumentTypes", "]", ",", "avoid", ":", "noClock", ",", "}", ")", ";", "const", "fnWithoutArgs", "=", "flag", "(", "{", "sort", ":", "[", "true", ",", "false", "]", ",", "needs", ":", "fn", ",", "avoid", ":", "[", "fnClockTypeAssertion", ",", "secondArgument", ",", "explicitArgumentTypes", "]", ",", "}", ")", ";", "const", "clock", "=", "separate", "(", "{", "source", ":", "{", "noClock", ",", "noSource", ",", "unificationToAny", ",", "fnClockTypeAssertion", "}", ",", "variant", ":", "{", "_", ":", "{", "none", ":", "{", "noClock", ":", "true", "}", ",", "only", ":", "{", "noSource", ":", "true", "}", ",", "noAnyNoFalsePositiveFnClock", ":", "{", "unificationToAny", ":", "false", ",", "fnClockTypeAssertion", ":", "true", ",", "}", ",", "noAny", ":", "{", "unificationToAny", ":", "false", "}", ",", "withAnyNoFalsePositiveFnClock", ":", "{", "unificationToAny", ":", "true", ",", "fnClockTypeAssertion", ":", "true", ",", "}", ",", "withAny", ":", "{", "unificationToAny", ":", "true", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "value", "(", "null", ")", ",", "only", ":", "separate", "(", "{", "source", ":", "{", "fnWithoutArgs", ",", "fn", ",", "clockArray", "}", ",", "variant", ":", "{", "fn", ":", "{", "noArgs", ":", "{", "fnWithoutArgs", ":", "true", "}", ",", "noFn", ":", "{", "fn", ":", "false", "}", ",", "fn", ":", "{", "}", ",", "}", ",", "amount", ":", "{", "singleClock", ":", "{", "clockArray", ":", "false", "}", ",", "manyClocks", ":", "{", "clockArray", ":", "true", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "noArgs", ":", "{", "singleClock", ":", "union", "(", "[", "'voidt'", ",", "'num'", ",", "'strClk'", ",", "'anyt'", "]", ")", ",", "manyClocks", ":", "permute", "(", "{", "items", ":", "[", "'voidt'", ",", "'num'", ",", "'strClk'", ",", "'anyt'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ",", "}", ",", "noFn", ":", "{", "singleClock", ":", "union", "(", "[", "'strClk'", ",", "'anyt'", "]", ")", ",", "manyClocks", ":", "permute", "(", "{", "items", ":", "[", "'strClk'", ",", "'anyt'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ",", "}", ",", "fn", ":", "{", "singleClock", ":", "union", "(", "[", "'strClk'", ",", "'anyt'", "]", ")", ",", "manyClocks", ":", "permute", "(", "{", "items", ":", "[", "'strClk'", ",", "'anyt'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ",", "}", ",", "}", ",", "}", ")", ",", "noAnyNoFalsePositiveFnClock", ":", "permute", "(", "{", "items", ":", "[", "'voidt'", ",", "'num'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ",", "noAny", ":", "permute", "(", "{", "items", ":", "[", "'voidt'", ",", "'str'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ",", "withAnyNoFalsePositiveFnClock", ":", "permute", "(", "{", "items", ":", "[", "'anyt'", ",", "'voidt'", ",", "'num'", "]", ",", "}", ")", ",", "withAny", ":", "permute", "(", "{", "items", ":", "[", "'anyt'", ",", "'voidt'", ",", "'str'", "]", ",", "}", ")", ",", "}", ",", "}", ")", ";", "const", "pass", "=", "bool", "(", "{", "sort", ":", "[", "true", ",", "false", "]", ",", "source", ":", "{", "noClock", ",", "noSource", ",", "fnClockTypeAssertion", ",", "unificationToAny", ",", "clockAnyOnly", ":", "computeFn", "(", "{", "source", ":", "{", "clock", "}", ",", "fn", ":", "(", "{", "clock", "}", ")", "=>", "Array", ".", "isArray", "(", "clock", ")", "&&", "clock", ".", "length", "===", "1", "&&", "clock", "[", "0", "]", "===", "'anyt'", ",", "}", ")", ",", "}", ",", "true", ":", "[", "{", "noClock", ":", "true", "}", ",", "{", "noSource", ":", "true", "}", ",", "{", "fnClockTypeAssertion", ":", "false", "}", ",", "{", "fnClockTypeAssertion", ":", "true", ",", "unificationToAny", ":", "true", ",", "clockAnyOnly", ":", "true", "}", ",", "]", ",", "}", ")", ";", "const", "target", "=", "computeVariant", "(", "{", "source", ":", "{", "noTarget", ",", "combinable", ",", "fn", ",", "secondArgument", "}", ",", "variant", ":", "{", "none", ":", "{", "noTarget", ":", "true", "}", ",", "abclock", ":", "{", "combinable", ":", "true", ",", "fn", ":", "true", ",", "secondArgument", ":", "true", "}", ",", "ab", ":", "{", "combinable", ":", "true", "}", ",", "aclock", ":", "{", "fn", ":", "true", ",", "secondArgument", ":", "true", "}", ",", "a", ":", "{", "fn", ":", "true", ",", "secondArgument", ":", "false", "}", ",", "string", ":", "{", "fn", ":", "false", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "null", ",", "abclock", ":", "'abclock'", ",", "ab", ":", "'abTarget'", ",", "aclock", ":", "'aclock'", ",", "a", ":", "'aTarget'", ",", "string", ":", "'str'", ",", "}", ",", "}", ")", ";", "const", "descriptionTokens", "=", "computeFn", "(", "{", "source", ":", "{", "fnClockTypeAssertion", ",", "combinable", ",", "noTarget", ",", "noSource", ",", "noClock", ",", "fn", ",", "secondArgument", ",", "}", ",", "fn", "(", "shape", ")", "{", "const", "res", "=", "[", "]", ";", "if", "(", "shape", ".", "fnClockTypeAssertion", ")", "{", "shape", ".", "combinable", "?", "res", ".", "push", "(", "'combinable'", ")", ":", "res", ".", "push", "(", "'plain'", ")", ";", "shape", ".", "noTarget", "&&", "res", ".", "push", "(", "'noTarget'", ")", ";", "}", "shape", ".", "noSource", "&&", "res", ".", "push", "(", "'noSource'", ")", ";", "shape", ".", "noClock", "&&", "res", ".", "push", "(", "'noClock'", ")", ";", "if", "(", "!", "shape", ".", "fnClockTypeAssertion", ")", "{", "shape", ".", "fn", "&&", "res", ".", "push", "(", "'fn'", ")", ";", "shape", ".", "secondArgument", "&&", "res", ".", "push", "(", "'fnClock'", ")", ";", "}", "return", "res", ".", "join", "(", "', '", ")", ";", "}", ",", "}", ")", ";", "const", "sourceCode", "=", "computeVariant", "(", "{", "source", ":", "{", "noSource", ",", "combinable", "}", ",", "variant", ":", "{", "none", ":", "{", "noSource", ":", "true", "}", ",", "plain", ":", "{", "combinable", ":", "false", "}", ",", "combinable", ":", "{", "combinable", ":", "true", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "null", ",", "plain", ":", "'a'", ",", "combinable", ":", "'{a,b}'", ",", "}", ",", "}", ")", ";", "const", "fnCode", "=", "separate", "(", "{", "source", ":", "{", "noSource", ",", "fn", ",", "combinable", ",", "fnWithoutArgs", ",", "secondArgument", ",", "explicitArgumentTypes", ",", "fnClockTypeAssertion", ",", "}", ",", "variant", ":", "{", "shape", ":", "{", "none", ":", "{", "noSource", ":", "true", ",", "fn", ":", "true", "}", ",", "plain", ":", "{", "combinable", ":", "false", ",", "fn", ":", "true", "}", ",", "shape", ":", "{", "combinable", ":", "true", ",", "fn", ":", "true", "}", ",", "}", ",", "fn", ":", "{", "noArgs", ":", "{", "fnWithoutArgs", ":", "true", "}", ",", "typedFnClock", ":", "{", "secondArgument", ":", "true", ",", "explicitArgumentTypes", ":", "true", "}", ",", "untypedFnClock", ":", "{", "secondArgument", ":", "true", ",", "explicitArgumentTypes", ":", "false", "}", ",", "typed", ":", "{", "explicitArgumentTypes", ":", "true", "}", ",", "untyped", ":", "{", "explicitArgumentTypes", ":", "false", "}", ",", "}", ",", "clock", ":", "{", "assert", ":", "{", "fnClockTypeAssertion", ":", "true", "}", ",", "keep", ":", "{", "fnClockTypeAssertion", ":", "false", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "{", "noArgs", ":", "value", "(", "\"()=>({a:'',b:2})\"", ")", ",", "typed", ":", "value", "(", "'fnAString'", ")", ",", "untyped", ":", "value", "(", "'(a) => ({a})'", ")", ",", "}", ",", "shape", ":", "{", "noArgs", ":", "value", "(", "\"()=>({a:'',b:2})\"", ")", ",", "typedFnClock", ":", "{", "assert", ":", "value", "(", "'fnAbClockString'", ")", ",", "keep", ":", "value", "(", "'fnAbClockAny'", ")", ",", "}", ",", "untypedFnClock", ":", "value", "(", "'({a,b}, clock) => ({a,b,clock})'", ")", ",", "typed", ":", "value", "(", "'fnAb'", ")", ",", "untyped", ":", "value", "(", "'({a,b}) => ({a,b})'", ")", ",", "}", ",", "plain", ":", "{", "noArgs", ":", "value", "(", "\"()=>({a:''})\"", ")", ",", "typedFnClock", ":", "{", "assert", ":", "value", "(", "'fnAStringClockString'", ")", ",", "keep", ":", "value", "(", "'fnAStringClockAny'", ")", ",", "}", ",", "untypedFnClock", ":", "value", "(", "'(a,clock) => ({a,clock})'", ")", ",", "typed", ":", "value", "(", "'fnAString'", ")", ",", "untyped", ":", "value", "(", "'(a) => ({a})'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "const", "noGroup", "=", "bool", "(", "{", "source", ":", "{", "noClock", ",", "noSource", ",", "unificationToAny", "}", ",", "true", ":", "[", "{", "noClock", ":", "true", "}", ",", "{", "noSource", ":", "true", "}", ",", "{", "unificationToAny", ":", "true", "}", "]", ",", "}", ")", ";", "const", "largeGroup", "=", "computeVariant", "(", "{", "source", ":", "{", "fnClockTypeAssertion", ",", "noSource", "}", ",", "variant", ":", "{", "fnAssertion", ":", "{", "fnClockTypeAssertion", ":", "true", "}", ",", "noSource", ":", "{", "noSource", ":", "true", "}", ",", "__", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "fnAssertion", ":", "'fn clock assertion'", ",", "noSource", ":", "'clock only'", ",", "__", ":", "null", ",", "}", ",", "}", ")", ";", "sortOrder", "(", "[", "pass", ",", "clockArray", ",", "combinable", ",", "noSource", ",", "fn", ",", "unificationToAny", ",", "fnClockTypeAssertion", ",", "noTarget", ",", "noClock", ",", "fnWithoutArgs", ",", "]", ")", ";", "config", "(", "{", "header", ",", "file", ":", "'generated/sampleClockArray'", ",", "usedMethods", ":", "[", "'createStore'", ",", "'createEvent'", ",", "'sample'", "]", ",", "grouping", ":", "{", "getHash", ":", "{", "descriptionTokens", ",", "noTarget", ",", "noClock", ",", "noSource", "}", ",", "pass", ",", "tags", ":", "{", "hasSource", ":", "bool", "(", "{", "source", ":", "{", "noSource", "}", ",", "true", ":", "{", "noSource", ":", "false", "}", ",", "}", ")", ",", "hasFn", ":", "fn", ",", "hasClock", ":", "bool", "(", "{", "source", ":", "{", "noClock", "}", ",", "true", ":", "{", "noClock", ":", "false", "}", ",", "}", ")", ",", "hasTarget", ":", "bool", "(", "{", "source", ":", "{", "noTarget", "}", ",", "true", ":", "{", "noTarget", ":", "false", "}", ",", "}", ")", ",", "clockArray", ",", "combinable", ",", "}", ",", "describeGroup", ":", "computeFn", "(", "{", "source", ":", "{", "descriptionTokens", ",", "noGroup", ",", "largeGroup", "}", ",", "fn", ":", "(", "{", "descriptionTokens", ",", "noGroup", ",", "largeGroup", "}", ")", "=>", "(", "{", "description", ":", "descriptionTokens", ",", "noGroup", ",", "largeGroup", ",", "}", ")", ",", "}", ")", ",", "createTestLines", ":", "{", "method", ":", "'sample'", ",", "shape", ":", "{", "source", ":", "sourceCode", ",", "clock", ",", "target", ",", "fn", ":", "fnCode", ",", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 6, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 147, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
632
[ "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "computeVariants", ",", "separate", ",", "flag", ",", "permute", ",", "config", ",", "bool", ",", "sortOrder", ",", "}", "from", "'../runner/manifold/operators'", ";", "const", "variables", "=", "{", "number", ":", "'num'", ",", "void", ":", "'voidt'", ",", "string", ":", "'str'", ",", "any", ":", "'anyt'", ",", "}", ";", "const", "fnVariants", "=", "{", "fnWithoutArgs", ":", "{", "fnWithoutArgs", ":", "true", "}", ",", "noFalsePositiveFnClock", ":", "{", "typedFn", ":", "true", ",", "fnClock", ":", "true", ",", "noFalsePositiveFnClock", ":", "true", ",", "}", ",", "noFalsePositiveFnSource_fnClock", ":", "{", "typedFn", ":", "true", ",", "fnClock", ":", "true", ",", "noFalsePositiveFnSource", ":", "true", ",", "}", ",", "typedFnClock", ":", "{", "typedFn", ":", "true", ",", "fnClock", ":", "true", "}", ",", "noFalsePositiveFnSource", ":", "{", "typedFn", ":", "true", ",", "fnClock", ":", "false", ",", "noFalsePositiveFnSource", ":", "true", ",", "}", ",", "typedNoFnClock", ":", "{", "typedFn", ":", "true", ",", "fnClock", ":", "false", "}", ",", "fnClock", ":", "{", "typedFn", ":", "false", ",", "fnClock", ":", "true", "}", ",", "noFnClock", ":", "{", "typedFn", ":", "false", ",", "fnClock", ":", "false", "}", ",", "}", ";", "const", "failCases", "=", "{", "a", ":", "[", "'a_str'", ",", "'abn'", ",", "'ab'", ",", "'a_str_b_num'", ",", "'a_str_b_str'", "]", ",", "ab", ":", "[", "'a_str'", ",", "'abn'", "]", ",", "tuple_a", ":", "[", "'l_str'", ",", "'l_num_num'", ",", "'l_num_str'", "]", ",", "tuple_aa", ":", "[", "'l_str'", ",", "'l_num_num'", "]", ",", "}", ";", "export", "default", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "{", "oneOf", ":", "[", "'a'", ",", "'ab'", ",", "'tuple_a'", ",", "'tuple_aa'", "]", ",", "sort", ":", "[", "'ab'", ",", "'a'", ",", "'tuple_aa'", ",", "'tuple_a'", "]", ",", "}", ")", ";", "const", "hasClock", "=", "flag", "(", "{", "sort", ":", "[", "false", ",", "true", "]", "}", ")", ";", "const", "sourceType", "=", "computeVariant", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "object", ":", "[", "{", "source", ":", "'a'", "}", ",", "{", "source", ":", "'ab'", "}", "]", ",", "tuple", ":", "[", "{", "source", ":", "'tuple_a'", "}", ",", "{", "source", ":", "'tuple_aa'", "}", "]", ",", "}", ",", "cases", ":", "{", "object", ":", "'object'", ",", "tuple", ":", "'tuple'", ",", "}", "as", "const", ",", "}", ")", ";", "const", "fn", "=", "flag", "(", "{", "name", ":", "'fn'", ",", "sort", ":", "[", "false", ",", "true", "]", "}", ")", ";", "const", "fnClock", "=", "flag", "(", "{", "needs", ":", "[", "fn", ",", "hasClock", "]", "}", ")", ";", "const", "typedFn", "=", "flag", "(", "{", "needs", ":", "[", "fn", "]", "}", ")", ";", "const", "noFalsePositiveFnClock", "=", "flag", "(", "{", "needs", ":", "[", "fn", ",", "typedFn", ",", "fnClock", ",", "hasClock", "]", ",", "}", ")", ";", "const", "noFalsePositiveFnSource", "=", "flag", "(", "{", "needs", ":", "[", "fn", ",", "typedFn", "]", ",", "avoid", ":", "noFalsePositiveFnClock", ",", "}", ")", ";", "const", "noFalsePositive", "=", "bool", "(", "{", "source", ":", "{", "noFalsePositiveFnSource", ",", "noFalsePositiveFnClock", "}", ",", "true", ":", "[", "{", "noFalsePositiveFnSource", ":", "true", "}", ",", "{", "noFalsePositiveFnClock", ":", "true", "}", "]", ",", "}", ")", ";", "const", "fnWithoutArgs", "=", "flag", "(", "{", "needs", ":", "fn", ",", "avoid", ":", "[", "fnClock", ",", "typedFn", ",", "noFalsePositiveFnClock", ",", "noFalsePositiveFnSource", "]", ",", "}", ")", ";", "const", "isPairOfSourceFields", "=", "bool", "(", "{", "source", ":", "{", "sourceType", ",", "source", "}", ",", "true", ":", "[", "{", "sourceType", ":", "'object'", ",", "source", ":", "'ab'", "}", ",", "{", "sourceType", ":", "'tuple'", ",", "source", ":", "'tuple_aa'", "}", ",", "]", ",", "}", ")", ";", "const", "fnText", "=", "computeVariants", "(", "{", "source", ":", "{", "fnWithoutArgs", ",", "typedFn", ",", "fnClock", ",", "noFalsePositiveFnClock", ",", "noFalsePositiveFnSource", ",", "sourceType", ",", "isPairOfSourceFields", ",", "}", ",", "variant", ":", "{", "fnVariants", ",", "source", ":", "{", "object", ":", "{", "sourceType", ":", "'object'", "}", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "sourceObject", ":", "{", "solo", ":", "{", "isPairOfSourceFields", ":", "false", "}", ",", "pair", ":", "{", "isPairOfSourceFields", ":", "true", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "fnWithoutArgs", ":", "'fn.noArgs'", ",", "noFalsePositiveFnClock", ":", "{", "object", ":", "{", "solo", ":", "'fn.assertSecond.object.solo'", ",", "pair", ":", "'fn.assertSecond.object.pair'", ",", "}", ",", "tuple", ":", "{", "solo", ":", "'fn.assertSecond.tuple.solo'", ",", "pair", ":", "'fn.assertSecond.tuple.pair'", ",", "}", ",", "}", ",", "noFalsePositiveFnSource_fnClock", ":", "{", "object", ":", "{", "solo", ":", "'fn.assertFirst.object.solo'", ",", "pair", ":", "'fn.assertFirst.object.pair'", ",", "}", ",", "tuple", ":", "{", "solo", ":", "'fn.assertFirst.tuple.solo'", ",", "pair", ":", "'fn.assertFirst.tuple.pair'", ",", "}", ",", "}", ",", "typedFnClock", ":", "{", "object", ":", "{", "solo", ":", "'fn.typedSrcClock.object.solo'", ",", "pair", ":", "'fn.typedSrcClock.object.pair'", ",", "}", ",", "tuple", ":", "{", "solo", ":", "'fn.typedSrcClock.tuple.solo'", ",", "pair", ":", "'fn.typedSrcClock.tuple.pair'", ",", "}", ",", "}", ",", "noFalsePositiveFnSource", ":", "{", "object", ":", "{", "solo", ":", "'fn.assertFirstOnly.object.solo'", ",", "pair", ":", "'fn.assertFirstOnly.object.pair'", ",", "}", ",", "tuple", ":", "{", "solo", ":", "'fn.assertFirstOnly.tuple.solo'", ",", "pair", ":", "'fn.assertFirstOnly.tuple.pair'", ",", "}", ",", "}", ",", "typedNoFnClock", ":", "{", "object", ":", "{", "solo", ":", "'fn.typedSrc.object.solo'", ",", "pair", ":", "'fn.typedSrc.object.pair'", ",", "}", ",", "tuple", ":", "{", "solo", ":", "'fn.typedSrc.tuple.solo'", ",", "pair", ":", "'fn.typedSrc.tuple.pair'", ",", "}", ",", "}", ",", "fnClock", ":", "{", "object", ":", "{", "solo", ":", "\"({a},cl) => ({a:a+cl,b:''})\"", ",", "pair", ":", "'({a,b},cl) => ({a:a+cl,b})'", ",", "}", ",", "tuple", ":", "{", "solo", ":", "\"([a],cl) => ({a:a+cl,b:''})\"", ",", "pair", ":", "'([a,b],cl) => ({a:a+cl,b})'", ",", "}", ",", "}", ",", "noFnClock", ":", "{", "object", ":", "{", "solo", ":", "\"({a}) => ({a,b:''})\"", ",", "pair", ":", "'({a,b}) => ({a,b})'", ",", "}", ",", "tuple", ":", "{", "solo", ":", "\"([a]) => ({a,b:''})\"", ",", "pair", ":", "'([a,b]) => ({a,b})'", ",", "}", ",", "}", ",", "}", ",", "sort", ":", "'string'", ",", "}", ")", ";", "const", "fnDescription", "=", "computeVariant", "(", "{", "name", ":", "'fnDescription'", ",", "source", ":", "{", "fnWithoutArgs", ",", "typedFn", ",", "fnClock", ",", "noFalsePositiveFnClock", ",", "noFalsePositiveFnSource", ",", "}", ",", "variant", ":", "fnVariants", ",", "cases", ":", "{", "fnWithoutArgs", ":", "'untyped'", ",", "noFalsePositiveFnClock", ":", "'assert'", ",", "noFalsePositiveFnSource_fnClock", ":", "'assert'", ",", "typedFnClock", ":", "'typed'", ",", "noFalsePositiveFnSource", ":", "'assert'", ",", "typedNoFnClock", ":", "'typed'", ",", "fnClock", ":", "'untyped'", ",", "noFnClock", ":", "'untyped'", ",", "}", "as", "const", ",", "sort", ":", "[", "undefined", "as", "any", ",", "'untyped'", ",", "'typed'", ",", "'assert'", "]", ",", "}", ")", ";", "const", "sourceDescription", "=", "computeVariant", "(", "{", "name", ":", "'sourceDescription'", ",", "source", ":", "{", "sourceType", ",", "source", "}", ",", "variant", ":", "{", "objectSolo", ":", "{", "sourceType", ":", "'object'", ",", "source", ":", "'a'", "}", ",", "objectPair", ":", "{", "sourceType", ":", "'object'", ",", "source", ":", "'ab'", "}", ",", "tupleSolo", ":", "{", "sourceType", ":", "'tuple'", ",", "source", ":", "'tuple_a'", "}", ",", "tuplePair", ":", "{", "sourceType", ":", "'tuple'", ",", "source", ":", "'tuple_aa'", "}", ",", "}", ",", "cases", ":", "{", "objectSolo", ":", "'same'", ",", "objectPair", ":", "'wide'", ",", "tupleSolo", ":", "'same'", ",", "tuplePair", ":", "'wide'", ",", "}", "as", "const", ",", "sort", ":", "'string'", ",", "}", ")", ";", "const", "sourceCode", "=", "computeVariant", "(", "{", "source", ":", "{", "sourceType", ",", "source", "}", ",", "variant", ":", "{", "objectSolo", ":", "{", "sourceType", ":", "'object'", ",", "source", ":", "'a'", "}", ",", "objectPair", ":", "{", "sourceType", ":", "'object'", ",", "source", ":", "'ab'", "}", ",", "tupleSolo", ":", "{", "sourceType", ":", "'tuple'", ",", "source", ":", "'tuple_a'", "}", ",", "tuplePair", ":", "{", "sourceType", ":", "'tuple'", ",", "source", ":", "'tuple_aa'", "}", ",", "}", ",", "cases", ":", "{", "objectSolo", ":", "'{a:$num}'", ",", "objectPair", ":", "'{a:$num,b:$str}'", ",", "tupleSolo", ":", "'[$num]'", ",", "tuplePair", ":", "'[$num,$str]'", ",", "}", ",", "}", ")", ";", "const", "target", "=", "separate", "(", "{", "source", ":", "{", "fn", ",", "sourceType", "}", ",", "variant", ":", "{", "_", ":", "{", "object", ":", "[", "{", "fn", ":", "true", "}", ",", "{", "sourceType", ":", "'object'", "}", "]", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "tuple", ":", "permute", "(", "{", "items", ":", "[", "'l_num'", ",", "'l_str'", ",", "'l_num_str'", ",", "'l_num_num'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ",", "object", ":", "permute", "(", "{", "items", ":", "[", "'a_num'", ",", "'a_str'", ",", "'abn'", ",", "'ab'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ",", "}", ",", "}", ")", ";", "const", "targetText", "=", "computeFn", "(", "{", "source", ":", "{", "target", "}", ",", "fn", "(", "{", "target", "}", ")", "{", "return", "target", ".", "map", "(", "(", "item", ")", "=>", "variables", "[", "item", "]", "||", "item", ")", ";", "}", ",", "}", ")", ";", "sortOrder", "(", "[", "hasClock", ",", "source", ",", "sourceDescription", ",", "fnDescription", ",", "fnText", ",", "fn", "]", ")", ";", "config", "(", "{", "header", ",", "file", ":", "'generated/sampleArrayTarget'", ",", "usedMethods", ":", "[", "'createStore'", ",", "'createEvent'", ",", "'sample'", "]", ",", "grouping", ":", "{", "pass", ":", "computeFn", "(", "{", "source", ":", "{", "target", ",", "noFalsePositive", ",", "fn", ",", "source", ",", "}", ",", "fn", "(", "{", "noFalsePositive", ",", "fn", ",", "target", ",", "source", "}", ")", "{", "if", "(", "noFalsePositive", ")", "return", "false", ";", "if", "(", "fn", ")", "return", "failCases", ".", "ab", ".", "every", "(", "failCase", "=>", "!", "target", ".", "includes", "(", "failCase", ")", ")", ";", "return", "failCases", "[", "source", "as", "keyof", "typeof", "failCases", "]", ".", "every", "(", "failCase", "=>", "!", "target", ".", "includes", "(", "failCase", ")", ")", ";", "}", ",", "}", ")", ",", "createTestLines", ":", "{", "method", ":", "'sample'", ",", "shape", ":", "{", "source", ":", "sourceCode", ",", "clock", ":", "{", "field", ":", "value", "(", "'num'", ")", ",", "when", ":", "hasClock", ",", "}", ",", "target", ":", "targetText", ",", "fn", ":", "{", "field", ":", "fnText", ",", "when", ":", "fn", ",", "}", ",", "}", ",", "}", ",", "tags", ":", "{", "sourceType", ",", "sourceWideness", ":", "sourceDescription", ",", "fn", ":", "fnDescription", ",", "hasClock", ",", "hasFn", ":", "fn", ",", "}", ",", "getHash", ":", "{", "sourceDescription", ",", "fn", ",", "fnDescription", "}", ",", "describeGroup", ":", "computeFn", "(", "{", "source", ":", "{", "sourceDescription", ",", "fn", ",", "fnDescription", "}", ",", "fn", ":", "cur", "=>", "`source:${", "cur", ".", "sourceDescription", "}${", "cur", ".", "fn", "?", "`, fn:${", "cur", ".", "fnDescription", "}`", ":", "''", "}`", ",", "}", ")", ",", "}", ",", "}", ")", ";", "}", ";", "const", "header", "=", "`\n/** used as valid source type */\ntype AN = {a: number}\n/** used as invalid source type */\ntype AS = {a: string}\n/** used as valid source type */\ntype AB = {a: number; b: string}\n/** used as invalid source type */\ntype ABN = {a: number; b: number}\nconst num = createEvent<number>()\nconst $num = createStore<number>(0)\nconst $str = createStore<string>('')\nconst a_num = createEvent<AN>()\nconst a_str = createEvent<AS>()\nconst ab = createEvent<AB>()\nconst abn = createEvent<ABN>()\nconst l_num = createEvent<[number]>()\nconst l_str = createEvent<[string]>()\nconst l_num_str = createEvent<[number, string]>()\nconst l_num_num = createEvent<[number, number]>()\n\nconst fn = {\n noArgs: () => ({a:2,b:''}),\n assertFirst: {\n object: {\n solo: ({a}:AS, cl:number) => ({a: cl, b: a}),\n pair: ({a,b}:ABN, cl:number) => ({a:b+cl,b:''})\n },\n tuple: {\n solo: ([a]:[string], cl:number) => ({a:cl,b:a}),\n pair: ([a,b]:[number,number], cl:number) => ({a:b+cl,b:''}),\n }\n },\n assertFirstOnly: {\n object: {\n solo: ({a}:AS) => ({a:0,b:a}),\n pair: ({b}:ABN) => ({a:b,b:''}),\n },\n tuple: {\n solo: ([a]:[string]) => ({a:2,b:a}),\n pair: ([,b]:[number,number]) => ({a:b,b:''}),\n }\n },\n assertSecond: {\n object: {\n solo: ({a}:AN, cl:string) => ({a,b:cl}),\n pair: ({a}:AB, cl:string) => ({a,b:cl}),\n },\n tuple: {\n solo: ([a]:[number], cl:string) => ({a,b:cl}),\n pair: ([a]:[number,string], cl:string) => ({a,b:cl}),\n }\n },\n typedSrc: {\n object: {\n solo: ({a}:AN) => ({a,b:''}),\n pair: ({a,b}:AB) => ({a,b})\n },\n tuple: {\n solo: ([a]:[number]) => ({a,b:''}),\n pair: ([a,b]:[number,string]) => ({a,b}),\n }\n },\n typedSrcClock: {\n object: {\n solo: ({a}:AN, cl:number) => ({a:a+cl,b:''}),\n pair: ({a,b}:AB, cl:number) => ({a:a+cl,b})\n },\n tuple: {\n solo: ([a]:[number], cl:number) => ({a:a+cl,b:''}),\n pair: ([a,b]:[number,string], cl:number) => ({a:a+cl,b}),\n }\n },\n}\n\n`", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null ]
633
[ "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "bool", ",", "separate", ",", "flag", ",", "config", ",", "permute", ",", "computeVariants", ",", "}", "from", "'../runner/manifold/operators'", ";", "export", "default", "(", ")", "=>", "{", "const", "mode", "=", "union", "(", "[", "'src'", ",", "'clk'", ",", "'src/clk'", "]", ")", ";", "const", "source", "=", "union", "(", "[", "'num'", ",", "'str'", "]", ")", ";", "const", "clock", "=", "union", "(", "[", "'num'", ",", "'str'", "]", ")", ";", "const", "fn", "=", "flag", "(", ")", ";", "const", "typedFn", "=", "flag", "(", "{", "needs", ":", "bool", "(", "{", "source", ":", "{", "fn", ",", "source", ",", "clock", ",", "mode", "}", ",", "true", ":", "[", "{", "fn", ":", "true", ",", "mode", ":", "'src/clk'", ",", "source", ":", "'num'", ",", "clock", ":", "'num'", "}", ",", "{", "fn", ":", "true", ",", "mode", ":", "'src/clk'", ",", "source", ":", "'str'", ",", "clock", ":", "'num'", "}", ",", "{", "fn", ":", "true", ",", "mode", ":", "'src/clk'", ",", "source", ":", "'num'", ",", "clock", ":", "'str'", "}", ",", "{", "fn", ":", "true", ",", "mode", ":", "'src'", ",", "source", ":", "'num'", "}", ",", "{", "fn", ":", "true", ",", "mode", ":", "'clk'", ",", "clock", ":", "'num'", "}", ",", "]", ",", "}", ")", ",", "}", ")", ";", "const", "targets", "=", "permute", "(", "{", "items", ":", "[", "'num'", ",", "'voidt'", ",", "'str'", ",", "'anyt'", ",", "'strBool'", ",", "'numStr'", "]", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "noReorder", ":", "true", ",", "}", ")", ";", "const", "targetAcceptString", "=", "computeFn", "(", "{", "source", ":", "{", "targets", "}", ",", "fn", "(", "{", "targets", "}", ")", "{", "return", "targets", ".", "every", "(", "target", "=>", "[", "'str'", ",", "'numStr'", ",", "'strBool'", ",", "'anyt'", ",", "'voidt'", "]", ".", "includes", "(", "target", ")", ")", ";", "}", ",", "}", ")", ";", "const", "targetAcceptNumber", "=", "computeFn", "(", "{", "source", ":", "{", "targets", "}", ",", "fn", "(", "{", "targets", "}", ")", "{", "return", "targets", ".", "every", "(", "target", "=>", "[", "'num'", ",", "'numStr'", ",", "'anyt'", ",", "'voidt'", "]", ".", "includes", "(", "target", ")", ")", ";", "}", ",", "}", ")", ";", "const", "pass", "=", "separate", "(", "{", "source", ":", "{", "mode", ",", "fn", ",", "source", ",", "clock", ",", "typedFn", ",", "targetAcceptNumber", ",", "targetAcceptString", ",", "}", ",", "variant", ":", "{", "_", ":", "{", "validWithFn", ":", "[", "{", "mode", ":", "'src/clk'", ",", "source", ":", "'num'", ",", "clock", ":", "'num'", ",", "targetAcceptNumber", ":", "true", ",", "fn", ":", "true", ",", "}", ",", "{", "mode", ":", "'src'", ",", "source", ":", "'num'", ",", "targetAcceptNumber", ":", "true", ",", "fn", ":", "true", ",", "}", ",", "{", "mode", ":", "'clk'", ",", "clock", ":", "'num'", ",", "targetAcceptNumber", ":", "true", ",", "fn", ":", "true", ",", "}", ",", "{", "mode", ":", "'src/clk'", ",", "source", ":", "'str'", ",", "targetAcceptString", ":", "true", ",", "fn", ":", "true", ",", "typedFn", ":", "false", ",", "}", ",", "{", "mode", ":", "'src'", ",", "source", ":", "'str'", ",", "targetAcceptString", ":", "true", ",", "fn", ":", "true", ",", "typedFn", ":", "false", ",", "}", ",", "{", "mode", ":", "'clk'", ",", "clock", ":", "'str'", ",", "targetAcceptString", ":", "true", ",", "fn", ":", "true", ",", "typedFn", ":", "false", ",", "}", ",", "{", "mode", ":", "'src/clk'", ",", "source", ":", "'num'", ",", "clock", ":", "'str'", ",", "targetAcceptString", ":", "true", ",", "fn", ":", "true", ",", "typedFn", ":", "false", ",", "}", ",", "]", ",", "errorWithFn", ":", "{", "fn", ":", "true", "}", ",", "validWithoutFn", ":", "[", "{", "mode", ":", "'src/clk'", ",", "source", ":", "'num'", ",", "targetAcceptNumber", ":", "true", ",", "fn", ":", "false", "}", ",", "{", "mode", ":", "'src'", ",", "source", ":", "'num'", ",", "targetAcceptNumber", ":", "true", ",", "fn", ":", "false", "}", ",", "{", "mode", ":", "'clk'", ",", "clock", ":", "'num'", ",", "targetAcceptNumber", ":", "true", ",", "fn", ":", "false", "}", ",", "{", "mode", ":", "'src/clk'", ",", "source", ":", "'str'", ",", "targetAcceptString", ":", "true", ",", "fn", ":", "false", "}", ",", "{", "mode", ":", "'src'", ",", "source", ":", "'str'", ",", "targetAcceptString", ":", "true", ",", "fn", ":", "false", "}", ",", "{", "mode", ":", "'clk'", ",", "clock", ":", "'str'", ",", "targetAcceptString", ":", "true", ",", "fn", ":", "false", "}", ",", "]", ",", "errorWithoutFn", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "validWithFn", ":", "value", "(", "true", ")", ",", "errorWithFn", ":", "value", "(", "false", ")", ",", "validWithoutFn", ":", "value", "(", "true", ")", ",", "errorWithoutFn", ":", "value", "(", "false", ")", ",", "}", ",", "}", ")", ";", "const", "fnCode", "=", "computeVariants", "(", "{", "source", ":", "{", "mode", ",", "fn", ",", "typedFn", "}", ",", "variant", ":", "{", "mode", ":", "{", "both", ":", "{", "mode", ":", "'src/clk'", "}", ",", "src", ":", "{", "mode", ":", "'src'", "}", ",", "clk", ":", "{", "mode", ":", "'clk'", "}", ",", "}", ",", "fn", ":", "{", "noFn", ":", "{", "fn", ":", "false", "}", ",", "typed", ":", "{", "typedFn", ":", "true", "}", ",", "untyped", ":", "{", "typedFn", ":", "false", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "both", ":", "{", "noFn", ":", "value", "(", "null", ")", ",", "typed", ":", "value", "(", "'(src:number,clk:number) => src+clk'", ")", ",", "untyped", ":", "value", "(", "'(src,clk) => src + clk'", ")", ",", "}", ",", "src", ":", "{", "noFn", ":", "value", "(", "null", ")", ",", "typed", ":", "value", "(", "'(src:number) => src+1'", ")", ",", "untyped", ":", "value", "(", "'(src) => src + 1'", ")", ",", "}", ",", "clk", ":", "{", "noFn", ":", "value", "(", "null", ")", ",", "typed", ":", "value", "(", "'(clk:number) => clk+1'", ")", ",", "untyped", ":", "value", "(", "'(clk) => clk + 1'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "const", "fnToken", "=", "computeVariant", "(", "{", "source", ":", "{", "fn", ",", "typedFn", "}", ",", "variant", ":", "{", "noFn", ":", "{", "fn", ":", "false", "}", ",", "typed", ":", "{", "typedFn", ":", "true", "}", ",", "untyped", ":", "{", "typedFn", ":", "false", "}", ",", "}", ",", "cases", ":", "{", "noFn", ":", "'no fn'", "as", "const", ",", "typed", ":", "'typed fn'", "as", "const", ",", "untyped", ":", "'untyped fn'", "as", "const", ",", "}", ",", "sort", ":", "[", "'no fn'", ",", "'untyped fn'", ",", "'typed fn'", "]", ",", "}", ")", ";", "const", "sourceClockToken", "=", "computeFn", "(", "{", "source", ":", "{", "mode", ",", "source", ",", "clock", "}", ",", "fn", "(", "{", "mode", ",", "source", ",", "clock", "}", ")", "{", "switch", "(", "mode", ")", "{", "case", "'src/clk'", ":", "return", "`${", "source", "}/${", "clock", "}`", ";", "case", "'src'", ":", "return", "`src ${", "source", "}`", ";", "case", "'clk'", ":", "return", "`clk ${", "clock", "}`", ";", "}", "}", ",", "}", ")", ";", "const", "targetToken", "=", "computeFn", "(", "{", "source", ":", "{", "targets", "}", ",", "fn", ":", "(", "{", "targets", "}", ")", "=>", "targets", ".", "sort", "(", ")", ".", "join", "(", "'/'", ")", ",", "}", ")", ";", "config", "(", "{", "header", ",", "file", ":", "'generated/sampleArrayTarget'", ",", "usedMethods", ":", "[", "'createStore'", ",", "'createEvent'", ",", "'sample'", "]", ",", "grouping", ":", "{", "pass", ",", "getHash", ":", "{", "mode", ",", "fn", ",", "typedFn", ",", "pass", "}", ",", "tags", ":", "{", "sourceClockToken", ",", "targetToken", ",", "fn", ":", "fnToken", ",", "}", ",", "createTestLines", ":", "{", "method", ":", "'sample'", ",", "shape", ":", "{", "source", ":", "{", "field", ":", "source", ",", "when", ":", "bool", "(", "{", "source", ":", "{", "mode", "}", ",", "true", ":", "[", "{", "mode", ":", "'src/clk'", "}", ",", "{", "mode", ":", "'src'", "}", "]", ",", "}", ")", ",", "}", ",", "clock", ":", "{", "field", ":", "clock", ",", "when", ":", "bool", "(", "{", "source", ":", "{", "mode", "}", ",", "true", ":", "[", "{", "mode", ":", "'src/clk'", "}", ",", "{", "mode", ":", "'clk'", "}", "]", ",", "}", ")", ",", "}", ",", "target", ":", "targets", ",", "fn", ":", "fnCode", ",", "}", ",", "}", ",", "describeGroup", ":", "fnToken", ",", "}", ",", "}", ")", ";", "}", ";", "const", "header", "=", "`\nconst voidt = createEvent()\nconst anyt = createEvent<any>()\nconst str = createEvent<string>()\nconst num = createEvent<number>()\nconst numStr = createEvent<number | string>()\nconst strBool = createEvent<string | boolean>()\n`", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11240, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null ]
634
[ "import", "{", "printMethod", "}", "from", "'../runner/text'", ";", "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "computeVariants", ",", "separate", ",", "flag", ",", "config", ",", "sortOrder", ",", "fmt", ",", "}", "from", "'../runner/manifold/operators'", ";", "import", "type", "{", "ComputeVariant", "}", "from", "'../runner/manifold/types'", ";", "export", "default", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "{", "oneOf", ":", "[", "'event'", ",", "'store'", ",", "'combinable'", "]", ",", "sort", ":", "[", "'event'", ",", "'store'", ",", "'combinable'", "]", ",", "}", ")", ";", "const", "clock", "=", "union", "(", "{", "oneOf", ":", "[", "'none'", ",", "'event'", ",", "'store'", ",", "'tuple'", "]", ",", "sort", ":", "[", "'none'", ",", "'event'", ",", "'store'", ",", "'tuple'", "]", ",", "}", ")", ";", "const", "target", "=", "union", "(", "{", "oneOf", ":", "[", "'none'", ",", "'event'", ",", "'store'", ",", "'tuple'", "]", "}", ")", ";", "const", "fn", "=", "separate", "(", "{", "source", ":", "{", "clock", "}", ",", "variant", ":", "{", "_", ":", "{", "noClock", ":", "{", "clock", ":", "'none'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "noClock", ":", "union", "(", "[", "'none'", ",", "'noArgs'", ",", "'arg'", "]", ")", ",", "__", ":", "union", "(", "[", "'none'", ",", "'noArgs'", ",", "'arg'", ",", "'argPair'", "]", ")", ",", "}", ",", "sort", ":", "[", "'none'", ",", "'noArgs'", ",", "'arg'", ",", "'argPair'", "]", ",", "}", ")", ";", "const", "typedFn", "=", "separate", "(", "{", "source", ":", "{", "fn", "}", ",", "variant", ":", "{", "_", ":", "{", "hasFnArgs", ":", "[", "{", "fn", ":", "'arg'", "}", ",", "{", "fn", ":", "'argPair'", "}", "]", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "hasFnArgs", ":", "flag", "(", ")", ",", "__", ":", "value", "(", "false", ")", ",", "}", ",", "sort", ":", "[", "false", ",", "true", "]", ",", "}", ")", ";", "const", "pass", "=", "value", "(", "true", ")", ";", "const", "typedFnToken", "=", "computeVariant", "(", "{", "source", ":", "{", "typedFn", "}", ",", "variant", ":", "{", "typed", ":", "{", "typedFn", ":", "true", "}", ",", "untyped", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "typed", ":", "', typed fn'", ",", "untyped", ":", "''", ",", "}", ",", "}", ")", ";", "const", "filter", "=", "separate", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "source", ":", "{", "combinable", ":", "{", "source", ":", "'combinable'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "combinable", ":", "union", "(", "[", "'none'", "]", ")", ",", "rest", ":", "union", "(", "[", "'none'", ",", "'unit'", ",", "'fn'", ",", "'infer'", ",", "'bool'", "]", ")", ",", "}", ",", "sort", ":", "[", "'none'", ",", "'unit'", ",", "'fn'", ",", "'infer'", ",", "'bool'", "]", ",", "}", ")", ";", "const", "targetToken", "=", "computeVariant", "(", "{", "source", ":", "{", "target", "}", ",", "variant", ":", "{", "unit", ":", "[", "{", "target", ":", "'event'", "}", ",", "{", "target", ":", "'store'", "}", "]", ",", "none", ":", "{", "target", ":", "'none'", "}", ",", "tuple", ":", "{", "target", ":", "'tuple'", "}", ",", "}", ",", "cases", ":", "{", "unit", ":", "'unit target'", ",", "none", ":", "'no target'", ",", "tuple", ":", "'tuple target'", ",", "}", ",", "sort", ":", "[", "'no target'", ",", "'unit target'", ",", "'tuple target'", "]", ",", "}", ")", ";", "const", "fields", "=", "{", "source", ":", "computeVariants", "(", "{", "source", ":", "{", "source", ",", "filter", "}", ",", "variant", ":", "{", "source", ":", "{", "event", ":", "{", "source", ":", "'event'", "}", ",", "store", ":", "{", "source", ":", "'store'", "}", ",", "combinable", ":", "{", "source", ":", "'combinable'", "}", ",", "}", ",", "filter", ":", "{", "inferFilter", ":", "[", "{", "filter", ":", "'infer'", "}", ",", "{", "filter", ":", "'bool'", "}", "]", ",", "plainFilter", ":", "{", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "event", ":", "{", "inferFilter", ":", "'aNumNull'", ",", "plainFilter", ":", "'aNum '", ",", "}", ",", "store", ":", "{", "inferFilter", ":", "'$aNull '", ",", "plainFilter", ":", "'a '", ",", "}", ",", "combinable", ":", "'{a:$num}'", ",", "}", ",", "}", ")", ",", "clock", ":", "computeVariant", "(", "{", "source", ":", "{", "clock", "}", ",", "variant", ":", "{", "none", ":", "{", "clock", ":", "'none'", "}", ",", "event", ":", "{", "clock", ":", "'event'", "}", ",", "store", ":", "{", "clock", ":", "'store'", "}", ",", "tuple", ":", "{", "clock", ":", "'tuple'", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "null", ",", "event", ":", "'num'", ",", "store", ":", "'$num'", ",", "tuple", ":", "'[num,$num]'", ",", "}", ",", "}", ")", ",", "target", ":", "computeVariant", "(", "{", "source", ":", "{", "target", "}", ",", "variant", ":", "{", "none", ":", "{", "target", ":", "'none'", "}", ",", "event", ":", "{", "target", ":", "'event'", "}", ",", "store", ":", "{", "target", ":", "'store'", "}", ",", "tuple", ":", "{", "target", ":", "'tuple'", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "null", ",", "event", ":", "'aNumT'", ",", "store", ":", "'aT '", ",", "tuple", ":", "'[aNumT,aT]'", ",", "}", ",", "}", ")", ",", "fn", ":", "computeVariants", "(", "{", "source", ":", "{", "fn", ",", "typedFn", ",", "filter", "}", ",", "variant", ":", "{", "fn", ":", "{", "none", ":", "{", "fn", ":", "'none'", "}", ",", "noArgs", ":", "{", "fn", ":", "'noArgs'", "}", ",", "arg", ":", "{", "fn", ":", "'arg'", "}", ",", "argPair", ":", "{", "fn", ":", "'argPair'", "}", ",", "}", ",", "types", ":", "{", "typed", ":", "{", "typedFn", ":", "true", "}", ",", "inferred", ":", "[", "{", "typedFn", ":", "false", ",", "filter", ":", "'bool'", "}", ",", "{", "typedFn", ":", "false", ",", "filter", ":", "'infer'", "}", ",", "]", ",", "untyped", ":", "{", "typedFn", ":", "false", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "none", ":", "null", ",", "noArgs", ":", "'fn0'", ",", "arg", ":", "{", "typed", ":", "'fn1'", ",", "inferred", ":", "'({a}:AN) => ({a})'", ",", "untyped", ":", "'({a}) => ({a})'", ",", "}", ",", "argPair", ":", "{", "typed", ":", "'fn2'", ",", "inferred", ":", "'({a}:AN,c) => ({a:a+c})'", ",", "untyped", ":", "'({a},c) => ({a:a+c})'", ",", "}", ",", "}", ",", "}", ")", ",", "filter", ":", "computeVariant", "(", "{", "source", ":", "{", "filter", "}", ",", "variant", ":", "{", "none", ":", "{", "filter", ":", "'none'", "}", ",", "unit", ":", "{", "filter", ":", "'unit'", "}", ",", "fn", ":", "{", "filter", ":", "'fn'", "}", ",", "infer", ":", "{", "filter", ":", "'infer'", "}", ",", "bool", ":", "{", "filter", ":", "'bool'", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "null", ",", "unit", ":", "'$flag'", ",", "fn", ":", "'filterFun'", ",", "infer", ":", "'filterInf'", ",", "bool", ":", "'Boolean'", ",", "}", ",", "}", ")", ",", "}", ";", "const", "methodCode", "=", "computeFn", "(", "{", "source", ":", "{", "pass", ",", "sourceCode", ":", "fields", ".", "source", ",", "clockCode", ":", "fields", ".", "clock", ",", "targetCode", ":", "fields", ".", "target", ",", "fnCode", ":", "fields", ".", "fn", ",", "filterCode", ":", "fields", ".", "filter", ",", "}", ",", "fn", ":", "value", "=>", "{", "return", "printMethod", "(", "{", "method", ":", "'sample'", ",", "shape", ":", "{", "source", ":", "'sourceCode'", ",", "clock", ":", "'clockCode'", ",", "target", ":", "'targetCode'", ",", "filter", ":", "'filterCode'", ",", "fn", ":", "'fnCode'", ",", "}", ",", "value", ",", "addExpectError", ":", "false", ",", "}", ")", ";", "}", ",", "sort", ":", "'string'", ",", "}", ")", ";", "const", "largeGroup", "=", "fmt", "`${", "targetToken", "}${", "typedFnToken", "}`", ";", "const", "returnCode", "=", "computeVariants", "(", "{", "source", ":", "{", "target", ",", "source", ",", "clock", ",", "filter", "}", ",", "variant", ":", "{", "Target", ":", "{", "none", ":", "{", "target", ":", "'none'", "}", ",", "event", ":", "{", "target", ":", "'event'", "}", ",", "store", ":", "{", "target", ":", "'store'", "}", ",", "tuple", ":", "{", "target", ":", "'tuple'", "}", ",", "}", ",", "filter", ":", "{", "noFilter", ":", "{", "filter", ":", "'none'", "}", ",", "hasFilter", ":", "{", "}", ",", "}", ",", "sources", ":", "{", "store", ":", "[", "{", "source", ":", "'store'", ",", "clock", ":", "'store'", "}", ",", "{", "source", ":", "'combinable'", ",", "clock", ":", "'store'", "}", ",", "{", "source", ":", "'store'", ",", "clock", ":", "'none'", "}", ",", "{", "source", ":", "'combinable'", ",", "clock", ":", "'none'", "}", ",", "]", ",", "event", ":", "{", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "none", ":", "{", "noFilter", ":", "{", "store", ":", "'Store<AN>'", ",", "event", ":", "'Event<AN>'", ",", "}", ",", "hasFilter", ":", "'Event<AN>'", ",", "}", ",", "event", ":", "'Event<AN>'", ",", "store", ":", "'Store<AN>'", ",", "tuple", ":", "'[Event<AN>, Store<AN>]'", ",", "}", ",", "}", ")", ";", "sortOrder", "(", "[", "targetToken", ",", "typedFn", ",", "source", ",", "clock", ",", "fn", ",", "methodCode", "]", ")", ";", "config", "(", "{", "header", ",", "file", ":", "'generated/sampleReturn'", ",", "usedMethods", ":", "[", "'createStore'", ",", "'createEvent'", ",", "'sample'", ",", "'Event'", ",", "'Store'", "]", ",", "grouping", ":", "{", "pass", ",", "getHash", ":", "[", "targetToken", ",", "clock", ",", "typedFn", ",", "filter", "]", ",", "tags", ":", "{", "source", ",", "clock", ",", "fn", ",", "target", ",", "targetToken", ",", "filter", ",", "}", ",", "describeGroup", ":", "computeFn", "(", "{", "source", ":", "{", "largeGroup", ",", "description", ":", "fmt", "`${", "targetToken", "}${", "typedFnToken", "}, ${", "clock", "} clock`", ",", "}", ",", "fn", ":", "(", "{", "largeGroup", ",", "description", "}", ")", "=>", "(", "{", "largeGroup", ",", "noGroup", ":", "true", ",", "description", ",", "}", ")", ",", "}", ")", ",", "createTestLines", ":", "{", "type", ":", "'text'", ",", "value", ":", "fmt", "`{const result: ${", "returnCode", "} = ${", "methodCode", "}}`", ",", "}", ",", "}", ",", "}", ")", ";", "}", ";", "const", "header", "=", "`\ntype AN = {a: number}\nconst $num = createStore(0)\nconst a = createStore({a: 0})\nconst $aNull = createStore<AN | null>({a: 0})\nconst num = createEvent<number>()\nconst aNum = createEvent<AN>()\nconst aNumNull = createEvent<AN | null>()\nconst aT = createStore({a: 0})\nconst aNumT = createEvent<AN>()\nconst $flag = createStore(true)\nconst fn0 = () => ({a: 0})\nconst fn1 = ({a}: AN) => ({a})\nconst fn2 = ({a}: AN, c: number) => ({a: a + c})\nconst filterFun = (val: AN | null) => val !== null\nconst filterInf = (val: AN | null): val is AN => val !== null\n`", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 147, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, 46481, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null ]
635
[ "import", "{", "printArray", "}", "from", "'../runner/text'", ";", "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "computeVariants", ",", "bool", ",", "separate", ",", "flag", ",", "config", ",", "sortOrder", ",", "fmt", ",", "}", "from", "'../runner/manifold/operators'", ";", "import", "{", "Separate", "}", "from", "'runner/manifold/types'", ";", "export", "default", "(", ")", "=>", "{", "const", "clockType", "=", "union", "(", "{", "oneOf", ":", "[", "'no'", ",", "'unit'", ",", "'array'", "]", ",", "sort", ":", "[", "'no'", ",", "'unit'", ",", "'array'", "]", ",", "}", ")", ";", "const", "filterType", "=", "union", "(", "{", "oneOf", ":", "[", "'fn'", ",", "'store'", ",", "'bool'", "]", ",", "sort", ":", "[", "'fn'", ",", "'store'", ",", "'bool'", "]", ",", "}", ")", ";", "const", "fnType", "=", "union", "(", "{", "oneOf", ":", "[", "'no'", ",", "'good untyped'", ",", "'good typed'", ",", "'bad untyped'", ",", "'bad typed'", ",", "'bad return'", ",", "]", ",", "sort", ":", "[", "'no'", ",", "'good untyped'", ",", "'good typed'", ",", "'bad untyped'", ",", "'bad typed'", ",", "'bad return'", ",", "]", ",", "}", ")", ";", "const", "sourceType", "=", "separate", "(", "{", "source", ":", "{", "clockType", ",", "filterType", "}", ",", "variant", ":", "{", "clock", ":", "{", "noClock", ":", "{", "clockType", ":", "'no'", "}", ",", "hasClock", ":", "{", "}", ",", "}", ",", "filter", ":", "{", "boolFilter", ":", "{", "filterType", ":", "'bool'", "}", ",", "nonBool", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "noClock", ":", "{", "boolFilter", ":", "union", "(", "[", "'unit'", "]", ")", ",", "nonBool", ":", "union", "(", "[", "'unit'", ",", "'object'", ",", "'tuple'", "]", ")", ",", "}", ",", "hasClock", ":", "{", "boolFilter", ":", "union", "(", "[", "'no'", ",", "'unit'", "]", ")", ",", "nonBool", ":", "union", "(", "[", "'no'", ",", "'unit'", ",", "'object'", ",", "'tuple'", "]", ")", ",", "}", ",", "}", ",", "sort", ":", "[", "'unit'", ",", "'object'", ",", "'tuple'", ",", "'no'", "]", ",", "}", ")", ";", "const", "targetType", "=", "union", "(", "{", "oneOf", ":", "[", "'unit'", ",", "'array'", "]", ",", "sort", ":", "[", "'unit'", ",", "'array'", "]", "}", ")", ";", "const", "sourceSubtype", "=", "separate", "(", "{", "source", ":", "{", "sourceType", ",", "targetType", "}", ",", "variant", ":", "{", "source", ":", "{", "object", ":", "{", "sourceType", ":", "'object'", "}", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "target", ":", "{", "targetUnit", ":", "{", "targetType", ":", "'unit'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "object", ":", "{", "targetUnit", ":", "union", "(", "[", "'fullObject'", ",", "'nullableField'", ",", "'smallObject'", "]", ")", ",", "}", ",", "tuple", ":", "{", "targetUnit", ":", "union", "(", "[", "'fullTuple'", ",", "'smallTuple'", "]", ")", ",", "}", ",", "}", ",", "sort", ":", "[", "'fullObject'", ",", "'nullableField'", ",", "'smallObject'", ",", "'fullTuple'", ",", "'smallTuple'", ",", "]", ",", "}", ")", ";", "const", "noSource", "=", "bool", "(", "{", "source", ":", "{", "sourceType", "}", ",", "true", ":", "{", "sourceType", ":", "'no'", "}", ",", "}", ")", ";", "const", "targetVoid", "=", "flag", "(", "{", "avoid", ":", "[", "noSource", ",", "bool", "(", "{", "source", ":", "{", "sourceSubtype", "}", ",", "true", ":", "[", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "]", ",", "}", ")", ",", "]", ",", "}", ")", ";", "const", "noTargetAny", "=", "bool", "(", "{", "source", ":", "{", "sourceSubtype", "}", ",", "true", ":", "[", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "]", ",", "}", ")", ";", "const", "targetAny", "=", "separate", "(", "{", "source", ":", "{", "targetType", "}", ",", "variant", ":", "{", "_", ":", "{", "unit", ":", "{", "targetType", ":", "'unit'", "}", ",", "array", ":", "{", "targetType", ":", "'array'", "}", ",", "}", "as", "const", ",", "}", ",", "cases", ":", "{", "unit", ":", "flag", "(", "{", "avoid", ":", "[", "targetVoid", ",", "noSource", ",", "noTargetAny", "]", "}", ")", ",", "array", ":", "flag", "(", ")", ",", "}", ",", "}", ")", ";", "const", "targetIsTyped", "=", "computeVariant", "(", "{", "source", ":", "{", "targetAny", ",", "targetVoid", ",", "targetType", "}", ",", "variant", ":", "{", "array", ":", "{", "targetType", ":", "'array'", "}", ",", "nonAny", ":", "{", "targetAny", ":", "false", ",", "targetVoid", ":", "false", ",", "targetType", ":", "'unit'", ",", "}", ",", "any", ":", "[", "{", "targetAny", ":", "true", ",", "targetType", ":", "'unit'", "}", ",", "{", "targetVoid", ":", "true", ",", "targetType", ":", "'unit'", "}", ",", "]", ",", "}", "as", "const", ",", "cases", ":", "{", "array", ":", "true", ",", "nonAny", ":", "true", ",", "any", ":", "false", ",", "}", ",", "}", ")", ";", "const", "combinable", "=", "bool", "(", "{", "source", ":", "{", "sourceType", "}", ",", "true", ":", "[", "{", "sourceType", ":", "'object'", "}", ",", "{", "sourceType", ":", "'tuple'", "}", "]", ",", "}", ")", ";", "const", "wrongTarget", "=", "flag", "(", "{", "needs", ":", "targetIsTyped", ",", "avoid", ":", "noSource", ",", "}", ")", ";", "const", "targetSubtype", "=", "separate", "(", "{", "source", ":", "{", "sourceSubtype", ",", "wrongTarget", "}", ",", "variant", ":", "{", "src", ":", "{", "smallObject", ":", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "smallTuple", ":", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "}", ",", "isCorrect", ":", "{", "correct", ":", "{", "wrongTarget", ":", "false", "}", ",", "wrong", ":", "{", "wrongTarget", ":", "true", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "smallObject", ":", "{", "correct", ":", "value", "(", "'smallObject'", "as", "const", ")", ",", "wrong", ":", "union", "(", "[", "'tooWideObject'", ",", "'wrongFieldSmall'", "]", ")", ",", "}", ",", "nullableField", ":", "{", "correct", ":", "value", "(", "'smallObject'", "as", "const", ")", ",", "wrong", ":", "value", "(", "'nonNullFieldSmall'", "as", "const", ")", ",", "}", ",", "smallTuple", ":", "{", "correct", ":", "value", "(", "'smallTuple'", "as", "const", ")", ",", "}", ",", "}", ",", "sort", ":", "[", "'smallObject'", ",", "'tooWideObject'", ",", "'nonNullFieldSmall'", ",", "'wrongFieldSmall'", ",", "'smallTuple'", ",", "]", ",", "}", ")", ";", "const", "sourceIsWiderThatTargetCond", "=", "bool", "(", "{", "source", ":", "{", "sourceType", ",", "sourceSubtype", ",", "targetSubtype", "}", ",", "true", ":", "[", "{", "sourceType", ":", "'tuple'", "}", ",", "{", "sourceType", ":", "'no'", "}", ",", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "{", "targetSubtype", ":", "'smallTuple'", "}", ",", "]", ",", "}", ")", ";", "const", "sourceIsWiderThatTarget", "=", "separate", "(", "{", "source", ":", "{", "sourceSubtype", "}", ",", "variant", ":", "{", "_", ":", "{", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "nullableField", ":", "value", "(", "true", ")", ",", "__", ":", "flag", "(", "{", "needs", ":", "targetIsTyped", ",", "avoid", ":", "[", "noSource", ",", "sourceIsWiderThatTargetCond", "]", ",", "}", ")", ",", "}", ",", "sort", ":", "[", "false", ",", "true", "]", ",", "}", ")", ";", "const", "inferByFilter", "=", "flag", "(", "{", "needs", ":", "[", "computeVariants", "(", "{", "source", ":", "{", "filterType", ",", "sourceSubtype", ",", "combinable", "}", ",", "variant", ":", "{", "filter", ":", "{", "store", ":", "{", "filterType", ":", "'store'", "}", ",", "nonStore", ":", "[", "{", "filterType", ":", "'fn'", "}", ",", "{", "filterType", ":", "'bool'", "}", "]", ",", "}", ",", "source", ":", "{", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "plain", ":", "{", "combinable", ":", "false", "}", ",", "combinable", ":", "{", "combinable", ":", "true", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "store", ":", "false", ",", "nonStore", ":", "{", "nullableField", ":", "true", ",", "plain", ":", "true", ",", "combinable", ":", "false", ",", "}", ",", "}", ",", "}", ")", ",", "targetIsTyped", ",", "]", ",", "avoid", ":", "bool", "(", "{", "source", ":", "{", "sourceType", ",", "filterType", ",", "sourceIsWiderThatTarget", "}", ",", "true", ":", "{", "sourceType", ":", "'unit'", ",", "filterType", ":", "'fn'", ",", "sourceIsWiderThatTarget", ":", "true", ",", "}", ",", "}", ")", ",", "sort", ":", "[", "false", ",", "true", "]", ",", "}", ")", ";", "const", "filterFnType", "=", "separate", "(", "{", "source", ":", "{", "sourceType", ",", "clockType", ",", "filterType", ",", "inferByFilter", "}", ",", "variant", ":", "{", "src", ":", "{", "noSource", ":", "{", "sourceType", ":", "'no'", "}", ",", "hasSource", ":", "{", "}", ",", "}", "as", "const", ",", "filter", ":", "{", "fn", ":", "{", "filterType", ":", "'fn'", "}", ",", "rest", ":", "{", "}", ",", "}", "as", "const", ",", "infer", ":", "{", "infer", ":", "{", "inferByFilter", ":", "true", "}", ",", "noInfer", ":", "{", "}", ",", "}", "as", "const", ",", "}", "as", "const", ",", "cases", ":", "{", "noSource", ":", "{", "fn", ":", "{", "infer", ":", "union", "(", "[", "'infer'", "]", ")", ",", "noInfer", ":", "union", "(", "[", "'good untyped'", ",", "'good typed'", ",", "'bad untyped'", ",", "'bad typed'", ",", "'bad return'", ",", "]", ")", ",", "}", ",", "rest", ":", "union", "(", "[", "'no'", "]", ")", ",", "}", ",", "hasSource", ":", "union", "(", "[", "'no'", "]", ")", ",", "}", ",", "}", ")", ";", "const", "fnSecondArg", "=", "flag", "(", "{", "needs", ":", "[", "bool", "(", "{", "source", ":", "{", "filterType", ",", "clockType", "}", ",", "true", ":", "[", "{", "filterType", ":", "'fn'", ",", "clockType", ":", "'unit'", "}", ",", "{", "filterType", ":", "'fn'", ",", "clockType", ":", "'array'", "}", ",", "]", ",", "}", ")", ",", "]", ",", "avoid", ":", "[", "wrongTarget", ",", "bool", "(", "{", "source", ":", "{", "sourceType", "}", ",", "true", ":", "{", "sourceType", ":", "'no'", "}", ",", "}", ")", ",", "]", ",", "sort", ":", "[", "false", ",", "true", "]", ",", "}", ")", ";", "function", "permuteTargets", "(", "{", "correctObject", ",", "correctObjectWide", ",", "wrongObject", ",", "wrongObjectWide", ",", "correctTuple", ",", "correctTupleWide", ",", "wrongTuple", ",", "wrongTupleWide", ",", "}", ")", "{", "return", "{", "nonTuple", ":", "{", "correct", ":", "{", "same", ":", "value", "(", "correctObject", ")", ",", "wide", ":", "value", "(", "correctObjectWide", ")", ",", "}", ",", "wrong", ":", "{", "same", ":", "value", "(", "wrongObject", ")", ",", "wide", ":", "value", "(", "wrongObjectWide", ")", ",", "}", ",", "}", ",", "tuple", ":", "{", "correct", ":", "{", "same", ":", "value", "(", "correctTuple", ")", ",", "wide", ":", "value", "(", "correctTupleWide", ")", ",", "}", ",", "wrong", ":", "{", "same", ":", "value", "(", "wrongTuple", ")", ",", "wide", ":", "value", "(", "wrongTupleWide", ")", ",", "}", ",", "}", ",", "}", ";", "}", "const", "targetValue", "=", "separate", "(", "{", "source", ":", "{", "targetType", ",", "targetSubtype", ",", "targetVoid", ",", "targetAny", ",", "sourceType", ",", "wrongTarget", ",", "sourceIsWiderThatTarget", ",", "}", ",", "variant", ":", "{", "targetKind", ":", "{", "smallObject", ":", "{", "targetSubtype", ":", "'smallObject'", "}", ",", "smallTuple", ":", "{", "targetSubtype", ":", "'smallTuple'", "}", ",", "tooWideObject", ":", "{", "targetSubtype", ":", "'tooWideObject'", "}", ",", "nonNullFieldSmall", ":", "{", "targetSubtype", ":", "'nonNullFieldSmall'", "}", ",", "wrongFieldSmall", ":", "{", "targetSubtype", ":", "'wrongFieldSmall'", "}", ",", "singleVoid", ":", "{", "targetType", ":", "'unit'", ",", "targetVoid", ":", "true", "}", ",", "singleAny", ":", "{", "targetType", ":", "'unit'", ",", "targetAny", ":", "true", "}", ",", "single", ":", "{", "targetType", ":", "'unit'", "}", ",", "manyAnyVoid", ":", "{", "targetType", ":", "'array'", ",", "targetVoid", ":", "true", ",", "targetAny", ":", "true", ",", "}", ",", "manyVoid", ":", "{", "targetType", ":", "'array'", ",", "targetVoid", ":", "true", "}", ",", "manyAny", ":", "{", "targetType", ":", "'array'", ",", "targetAny", ":", "true", "}", ",", "many", ":", "{", "targetType", ":", "'array'", "}", ",", "}", ",", "source", ":", "{", "none", ":", "{", "sourceType", ":", "'no'", "}", ",", "nonTuple", ":", "[", "{", "sourceType", ":", "'unit'", "}", ",", "{", "sourceType", ":", "'object'", "}", "]", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "target", ":", "{", "correct", ":", "{", "wrongTarget", ":", "false", "}", ",", "wrong", ":", "{", "wrongTarget", ":", "true", "}", ",", "}", ",", "sourceWidth", ":", "{", "wide", ":", "{", "sourceIsWiderThatTarget", ":", "true", "}", ",", "same", ":", "{", "sourceIsWiderThatTarget", ":", "false", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "smallObject", ":", "value", "(", "'aNum'", ")", ",", "smallTuple", ":", "value", "(", "'lNum'", ")", ",", "tooWideObject", ":", "value", "(", "'ab'", ")", ",", "nonNullFieldSmall", ":", "value", "(", "'aNum'", ")", ",", "wrongFieldSmall", ":", "value", "(", "'aStr'", ")", ",", "singleVoid", ":", "value", "(", "'voidt'", ")", ",", "singleAny", ":", "value", "(", "'anyt'", ")", ",", "single", ":", "{", "none", ":", "{", "correct", ":", "value", "(", "'$ab'", ")", ",", "wrong", ":", "value", "(", "'strt'", ")", ",", "}", ",", "nonTuple", ":", "{", "correct", ":", "{", "wide", ":", "value", "(", "'aNum'", ")", ",", "same", ":", "value", "(", "'ab'", ")", ",", "}", ",", "wrong", ":", "{", "wide", ":", "value", "(", "'aStr'", ")", ",", "same", ":", "value", "(", "'abn'", ")", ",", "}", ",", "}", ",", "tuple", ":", "{", "correct", ":", "{", "wide", ":", "value", "(", "'lNum'", ")", ",", "same", ":", "value", "(", "'lNumStr'", ")", ",", "}", ",", "wrong", ":", "{", "wide", ":", "value", "(", "'lStr'", ")", ",", "same", ":", "value", "(", "'lNumNum'", ")", ",", "}", ",", "}", ",", "}", ",", "manyAnyVoid", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", ",", "'anyt'", ",", "'voidt'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongObject", ":", "[", "'abn'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'anyt'", ",", "'voidt'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", ",", "'anyt'", ",", "'voidt'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'anyt'", ",", "'voidt'", "]", ",", "}", ")", ",", "manyVoid", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", ",", "'voidt'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", ",", "'voidt'", "]", ",", "wrongObject", ":", "[", "'abn'", ",", "'voidt'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'voidt'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", ",", "'voidt'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'voidt'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", ",", "'voidt'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'voidt'", "]", ",", "}", ")", ",", "manyAny", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", ",", "'anyt'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", ",", "'anyt'", "]", ",", "wrongObject", ":", "[", "'abn'", ",", "'anyt'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'anyt'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", ",", "'anyt'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'anyt'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", ",", "'anyt'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'anyt'", "]", ",", "}", ")", ",", "many", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", "]", ",", "wrongObject", ":", "[", "'abn'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'ab'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'lNumStr'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'lNumStr'", "]", ",", "}", ")", ",", "}", ",", "}", ")", ";", "const", "fnCode", "=", "separate", "(", "{", "source", ":", "{", "fnType", ",", "sourceType", ",", "clockType", ",", "targetType", ",", "sourceSubtype", ",", "inferByFilter", ",", "filterType", ",", "}", ",", "variant", ":", "{", "dataSources", ":", "{", "clockOnly", ":", "{", "sourceType", ":", "'no'", "}", ",", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "}", "as", "const", ",", "infer", ":", "{", "inferClockOnly", ":", "{", "sourceType", ":", "'no'", ",", "inferByFilter", ":", "true", ",", "targetType", ":", "'unit'", ",", "}", ",", "infer", ":", "{", "inferByFilter", ":", "true", "}", ",", "noInfer", ":", "{", "inferByFilter", ":", "false", "}", ",", "}", "as", "const", ",", "fnType", ":", "{", "noFn", ":", "{", "fnType", ":", "'no'", "}", ",", "goodUntyped", ":", "{", "fnType", ":", "'good untyped'", "}", ",", "goodTyped", ":", "{", "fnType", ":", "'good typed'", "}", ",", "badUntyped", ":", "{", "fnType", ":", "'bad untyped'", "}", ",", "badTyped", ":", "{", "fnType", ":", "'bad typed'", "}", ",", "badReturn", ":", "{", "fnType", ":", "'bad return'", "}", ",", "}", "as", "const", ",", "filter", ":", "{", "bool", ":", "{", "filterType", ":", "'bool'", "}", ",", "rest", ":", "{", "}", ",", "}", "as", "const", ",", "}", ",", "cases", ":", "{", "clockOnly", ":", "{", "inferClockOnly", ":", "{", "noFn", ":", "value", "(", "null", ")", ",", "goodUntyped", ":", "value", "(", "'(val) => ({a:val.a, b:val.b})'", ")", ",", "goodTyped", ":", "value", "(", "'(val: AB) => ({a:val.a, b:val.b})'", ")", ",", "badUntyped", ":", "value", "(", "'(val) => ({a:val.c, b:val.b})'", ")", ",", "badTyped", ":", "value", "(", "'(val: ABN) => ({a:val.a, b:val.b})'", ")", ",", "badReturn", ":", "value", "(", "'() => ({a:0, b:1})'", ")", ",", "}", ",", "noInfer", ":", "{", "noFn", ":", "value", "(", "null", ")", ",", "goodUntyped", ":", "{", "bool", ":", "value", "(", "'(val) => ({a:val.a, b:val.b})'", ")", ",", "rest", ":", "value", "(", "\"(val) => ({a:1, b: val ? val.b : ''})\"", ")", ",", "}", ",", "goodTyped", ":", "{", "bool", ":", "value", "(", "'(val: AB) => ({a:val.a, b:val.b})'", ")", ",", "rest", ":", "value", "(", "\"(val: AB | null) => ({a:1, b: val ? val.b : ''})\"", ")", ",", "}", ",", "badUntyped", ":", "value", "(", "'(val) => ({a:val.c, b:val.b})'", ")", ",", "badTyped", ":", "value", "(", "\"(val: ABN) => ({a:val.c, b:''})\"", ")", ",", "badReturn", ":", "value", "(", "null", ")", ",", "}", ",", "}", ",", "nullableField", ":", "{", "infer", ":", "{", "noFn", ":", "value", "(", "null", ")", ",", "goodUntyped", ":", "value", "(", "'(val) => ({a: val.a + 1, b: val.b})'", ")", ",", "goodTyped", ":", "value", "(", "'(val: AB) => ({a: val.a + 1, b: val.b})'", ")", ",", "badUntyped", ":", "value", "(", "'(val) => ({a: 1 + val.c, b: val.b})'", ")", ",", "badTyped", ":", "value", "(", "\"(val: ABN) => ({a: val.a + 1, b: ''})\"", ")", ",", "badReturn", ":", "value", "(", "\"() => 'wrong'\"", ")", ",", "}", ",", "noInfer", ":", "{", "noFn", ":", "value", "(", "null", ")", ",", "goodUntyped", ":", "value", "(", "'(val) => ({a: 0, b: `${val.b.length}`})'", ")", ",", "goodTyped", ":", "value", "(", "'(val: AoptB) => ({a: 0, b: `${val.b.length}`})'", ")", ",", "badUntyped", ":", "value", "(", "'(val) => ({a: val.a + 1, b: val.b})'", ")", ",", "badTyped", ":", "value", "(", "'(val: AB) => ({a: val.a + 1, b: val.b})'", ")", ",", "badReturn", ":", "value", "(", "\"() => 'wrong'\"", ")", ",", "}", ",", "}", ",", "__", ":", "value", "(", "null", ")", ",", "}", ",", "}", ")", ";", "const", "targetCode", "=", "computeFn", "(", "{", "source", ":", "{", "targetValue", "}", ",", "fn", "(", "{", "targetValue", "}", ")", "{", "return", "Array", ".", "isArray", "(", "targetValue", ")", "?", "printArray", "(", "targetValue", ")", ":", "targetValue", ";", "}", ",", "}", ")", ";", "const", "clockCode", "=", "separate", "(", "{", "source", ":", "{", "clockType", ",", "sourceType", ",", "fnSecondArg", "}", ",", "variant", ":", "{", "clock", ":", "{", "clockOnlySingle", ":", "{", "sourceType", ":", "'no'", ",", "clockType", ":", "'unit'", "}", ",", "clockOnlyArray", ":", "{", "sourceType", ":", "'no'", ",", "clockType", ":", "'array'", "}", ",", "noClock", ":", "{", "clockType", ":", "'no'", "}", ",", "clockSingle", ":", "{", "clockType", ":", "'unit'", "}", ",", "clockArray", ":", "{", "clockType", ":", "'array'", "}", ",", "}", "as", "const", ",", "fnArg", ":", "{", "hasFnSecondArg", ":", "{", "fnSecondArg", ":", "true", "}", ",", "noFnSecondArg", ":", "{", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "clockOnlySingle", ":", "value", "(", "'nullableAB'", ")", ",", "clockOnlyArray", ":", "value", "(", "'[ab,nullableAB]'", ")", ",", "noClock", ":", "value", "(", "null", ")", ",", "clockSingle", ":", "{", "hasFnSecondArg", ":", "value", "(", "'numt'", ")", ",", "noFnSecondArg", ":", "value", "(", "'anyt'", ")", ",", "}", ",", "clockArray", ":", "{", "hasFnSecondArg", ":", "value", "(", "'[numt,$num]'", ")", ",", "noFnSecondArg", ":", "value", "(", "'[anyt]'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "const", "sourceCode", "=", "separate", "(", "{", "source", ":", "{", "sourceType", ",", "sourceSubtype", ",", "filterType", ",", "inferByFilter", "}", ",", "variant", ":", "{", "AsourceSubtype", ":", "{", "fullObject", ":", "{", "sourceSubtype", ":", "'fullObject'", "}", ",", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "smallObject", ":", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "fullTuple", ":", "{", "sourceSubtype", ":", "'fullTuple'", "}", ",", "smallTuple", ":", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "}", "as", "const", ",", "Bsource", ":", "{", "none", ":", "{", "sourceType", ":", "'no'", "}", ",", "unit", ":", "{", "sourceType", ":", "'unit'", "}", ",", "object", ":", "{", "sourceType", ":", "'object'", "}", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", "as", "const", ",", "Cfilter", ":", "{", "fn", ":", "{", "filterType", ":", "'fn'", "}", ",", "store", ":", "{", "filterType", ":", "'store'", "}", ",", "boolFn", ":", "{", "filterType", ":", "'bool'", "}", ",", "}", "as", "const", ",", "Dinfer", ":", "{", "infer", ":", "{", "inferByFilter", ":", "true", "}", ",", "noInfer", ":", "{", "inferByFilter", ":", "false", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "fullObject", ":", "value", "(", "'{a,b}'", ")", ",", "nullableField", ":", "value", "(", "'{a:aOpt,b}'", ")", ",", "smallObject", ":", "value", "(", "'{a}'", ")", ",", "fullTuple", ":", "value", "(", "'[a,b]'", ")", ",", "smallTuple", ":", "value", "(", "'[a]'", ")", ",", "__", ":", "{", "none", ":", "value", "<", "string", "|", "null", ">", "(", "null", ")", ",", "unit", ":", "{", "fn", ":", "{", "infer", ":", "value", "(", "'abNull'", ")", ",", "noInfer", ":", "value", "(", "'ab'", ")", ",", "}", ",", "boolFn", ":", "{", "infer", ":", "value", "(", "'nullableAB'", ")", ",", "noInfer", ":", "value", "(", "'ab'", ")", ",", "}", ",", "store", ":", "value", "(", "'ab'", ")", ",", "}", ",", "object", ":", "value", "(", "'{a,b}'", ")", ",", "tuple", ":", "value", "(", "'[a,b]'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "const", "filterCode", "=", "separate", "(", "{", "source", ":", "{", "filterType", ",", "fnSecondArg", ",", "sourceType", ",", "sourceSubtype", ",", "inferByFilter", ",", "filterFnType", ",", "}", ",", "variant", ":", "{", "Afilter", ":", "{", "fn", ":", "{", "filterType", ":", "'fn'", "}", ",", "store", ":", "{", "filterType", ":", "'store'", "}", ",", "boolFn", ":", "{", "filterType", ":", "'bool'", "}", ",", "}", ",", "BfnArg", ":", "{", "hasFnSecondArg", ":", "{", "fnSecondArg", ":", "true", "}", ",", "noFnSecondArg", ":", "{", "}", ",", "}", ",", "Csource", ":", "{", "none", ":", "{", "sourceType", ":", "'no'", "}", ",", "fullObject", ":", "{", "sourceSubtype", ":", "'fullObject'", "}", ",", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "smallObject", ":", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "fullTuple", ":", "{", "sourceSubtype", ":", "'fullTuple'", "}", ",", "smallTuple", ":", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "unit", ":", "{", "sourceType", ":", "'unit'", "}", ",", "object", ":", "{", "sourceType", ":", "'object'", "}", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "Dinfer", ":", "{", "infer", ":", "{", "inferByFilter", ":", "true", "}", ",", "noInfer", ":", "{", "inferByFilter", ":", "false", "}", ",", "}", ",", "Etype", ":", "{", "goodUntyped", ":", "{", "filterFnType", ":", "'good untyped'", "}", ",", "goodTyped", ":", "{", "filterFnType", ":", "'good typed'", "}", ",", "badUntyped", ":", "{", "filterFnType", ":", "'bad untyped'", "}", ",", "badTyped", ":", "{", "filterFnType", ":", "'bad typed'", "}", ",", "badReturn", ":", "{", "filterFnType", ":", "'bad return'", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "fn", ":", "{", "hasFnSecondArg", ":", "{", "unit", ":", "{", "infer", ":", "value", "(", "'(val,n): val is AB => n > 0 && val.a !== null'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "fullObject", ":", "{", "infer", ":", "value", "(", "'(val,n): val is AB => val.a > n'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "object", ":", "{", "infer", ":", "value", "(", "'(val,n): val is AB => val.a > n'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "nullableField", ":", "{", "infer", ":", "value", "(", "\"(val,n): val is AB => typeof val.a === 'number' && val.a > n\"", ")", ",", "noInfer", ":", "value", "(", "\"(val,n) => typeof val.a === 'number' && val.a > n\"", ")", ",", "}", ",", "smallObject", ":", "{", "infer", ":", "value", "(", "'(val,n): val is Astr => val.a > n'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "fullTuple", ":", "value", "(", "'(val, n) => val[0] > n'", ")", ",", "tuple", ":", "value", "(", "'(val, n) => val[0] > n'", ")", ",", "smallTuple", ":", "value", "(", "'(val, n) => val[0] > n'", ")", ",", "}", ",", "noFnSecondArg", ":", "{", "none", ":", "{", "infer", ":", "value", "(", "'(clk): clk is AB => clk !== null'", ")", ",", "noInfer", ":", "{", "goodUntyped", ":", "value", "(", "'(clk) => clk !== null'", ")", ",", "goodTyped", ":", "value", "(", "'(clk: AB | null) => clk !== null'", ")", ",", "badUntyped", ":", "value", "(", "'(clk) => clk.a > 0'", ")", ",", "badTyped", ":", "value", "(", "'(clk: AB) => clk.a > 0'", ")", ",", "badReturn", ":", "value", "(", "'() => 1'", ")", ",", "}", ",", "}", ",", "unit", ":", "{", "infer", ":", "value", "(", "'(val): val is AB => val.a !== null'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "fullObject", ":", "{", "infer", ":", "value", "(", "'(val): val is AB => val.a > 0'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "object", ":", "{", "infer", ":", "value", "(", "'(val): val is AB => val.a > 0'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "nullableField", ":", "{", "infer", ":", "value", "(", "\"(val): val is AB => typeof val.a === 'number' && val.a > 0\"", ")", ",", "noInfer", ":", "value", "(", "\"(val) => typeof val.a === 'number' && val.a > 0\"", ")", ",", "}", ",", "smallObject", ":", "{", "infer", ":", "value", "(", "'(val): val is Astr => val.a > 0'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "fullTuple", ":", "value", "(", "'(val) => val[0] > 0'", ")", ",", "tuple", ":", "value", "(", "'(val) => val[0] > 0'", ")", ",", "smallTuple", ":", "value", "(", "'(val) => val[0] > 0'", ")", ",", "}", ",", "}", ",", "store", ":", "value", "(", "'$filter'", ")", ",", "boolFn", ":", "value", "(", "'Boolean'", ")", ",", "}", ",", "}", ")", ";", "const", "groupTokens", "=", "computeFn", "(", "{", "source", ":", "{", "sourceIsWiderThatTarget", ",", "sourceType", ",", "clockType", ",", "targetType", ",", "targetCode", ",", "fnType", ",", "}", ",", "fn", "(", "{", "sourceIsWiderThatTarget", ",", "sourceType", ",", "clockType", ",", "targetType", ",", "targetCode", ",", "fnType", ",", "}", ")", "{", "return", "`${", "sourceType", "===", "'no'", "?", "''", ":", "`${", "sourceType", "}${", "clockType", "===", "'no'", "?", "''", ":", "' + '", "}`", "}${", "clockType", "===", "'no'", "?", "''", ":", "clockType", "===", "'unit'", "?", "'clock'", ":", "'[clock]'", "}${", "fnType", "===", "'no'", "?", "''", ":", "', fn'", "} -> ${", "targetCode", "?", "targetType", ":", "'new unit'", "} ${", "sourceIsWiderThatTarget", "?", "'wide'", ":", "'same'", "}`", ";", "}", ",", "}", ")", ";", "sortOrder", "(", "[", "inferByFilter", ",", "sourceType", ",", "sourceSubtype", ",", "targetType", ",", "targetSubtype", ",", "filterType", ",", "clockType", ",", "sourceIsWiderThatTarget", ",", "fnSecondArg", ",", "]", ")", ";", "config", "(", "{", "file", ":", "'generated/sampleFilter'", ",", "usedMethods", ":", "[", "'createStore'", ",", "'createEvent'", ",", "'sample'", "]", ",", "header", ",", "grouping", ":", "{", "pass", ":", "bool", "(", "{", "source", ":", "{", "wrongTarget", ",", "sourceType", ",", "targetType", ",", "sourceSubtype", ",", "filterType", ",", "inferByFilter", ",", "fnType", ",", "filterFnType", ",", "}", ",", "false", ":", "[", "{", "wrongTarget", ":", "true", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'bad typed'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'bad untyped'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'bad return'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'no'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'fn'", ",", "inferByFilter", ":", "false", ",", "fnType", ":", "'bad typed'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'fn'", ",", "inferByFilter", ":", "false", ",", "fnType", ":", "'bad untyped'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'fn'", ",", "inferByFilter", ":", "false", ",", "fnType", ":", "'bad return'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'fn'", ",", "inferByFilter", ":", "false", ",", "fnType", ":", "'no'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "fnType", ":", "'bad typed'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "fnType", ":", "'bad untyped'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "fnType", ":", "'bad return'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'bad typed'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'bad untyped'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'bad return'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'store'", ",", "fnType", ":", "'no'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'fn'", ",", "fnType", ":", "'bad typed'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'fn'", ",", "fnType", ":", "'bad untyped'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'fn'", ",", "fnType", ":", "'bad return'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "filterType", ":", "'fn'", ",", "inferByFilter", ":", "false", ",", "fnType", ":", "'no'", "}", ",", "{", "sourceType", ":", "'no'", ",", "fnType", ":", "'bad typed'", "}", ",", "{", "sourceType", ":", "'no'", ",", "fnType", ":", "'bad untyped'", "}", ",", "{", "sourceType", ":", "'no'", ",", "targetType", ":", "'unit'", ",", "fnType", ":", "'bad return'", "}", ",", "{", "sourceType", ":", "'no'", ",", "filterFnType", ":", "'bad typed'", "}", ",", "{", "sourceType", ":", "'no'", ",", "filterFnType", ":", "'bad untyped'", "}", ",", "{", "sourceType", ":", "'no'", ",", "filterFnType", ":", "'bad return'", "}", ",", "]", ",", "}", ")", ",", "getHash", ":", "[", "inferByFilter", ",", "sourceIsWiderThatTarget", ",", "filterType", ",", "sourceType", ",", "sourceCode", ",", "fnType", ",", "targetType", ",", "clockType", ",", "]", ",", "tags", ":", "{", "inferByFilter", ",", "sourceIsWiderThatTarget", ",", "filter", ":", "filterType", ",", "source", ":", "sourceType", ",", "sourceCode", ",", "target", ":", "targetType", ",", "clock", ":", "clockType", ",", "fn", ":", "fnType", ",", "filterFn", ":", "filterFnType", ",", "}", ",", "describeGroup", ":", "computeFn", "(", "{", "source", ":", "{", "groupTokens", ",", "sourceType", "}", ",", "fn", ":", "(", "{", "groupTokens", ",", "sourceType", "}", ")", "=>", "(", "{", "largeGroup", ":", "`${", "sourceType", "} source`", ",", "description", ":", "groupTokens", ",", "}", ")", ",", "}", ")", ",", "createTestLines", ":", "{", "method", ":", "'sample'", ",", "shape", ":", "{", "source", ":", "sourceCode", ",", "clock", ":", "clockCode", ",", "target", ":", "targetCode", ",", "filter", ":", "filterCode", ",", "fn", ":", "fnCode", ",", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ";", "const", "header", "=", "`\ntype Astr = {a: string}\ntype AB = {a: number; b: string}\ntype AoptB = {a: number | null; b: string}\ntype ABN = {a: number; b: number}\nconst $filter = createStore(true)\nconst a = createStore(0)\nconst aOpt = createStore<number | null>(0)\nconst b = createStore('')\nconst voidt = createEvent()\nconst anyt = createEvent<any>()\nconst numt = createEvent<number>()\nconst strt = createEvent<number>()\nconst $num = createStore(0)\nconst ab = createEvent<AB>()\nconst $ab = createStore<AB>({a: 0, b: ''})\nconst nullableAB = createEvent<AB | null>()\nconst abNull = createEvent<{a: number | null; b: string}>()\nconst aNum = createEvent<{a: number}>()\nconst aStr = createEvent<{a: string}>()\nconst lNum = createEvent<[number]>()\nconst lStr = createEvent<[string]>()\nconst lNumStr = createEvent<[number, string]>()\nconst lNumNum = createEvent<[number, number]>()\nconst abn = createEvent<ABN>()\n`", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 27928, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
636
[ "import", "{", "printArray", "}", "from", "'../runner/text'", ";", "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "computeVariants", ",", "bool", ",", "separate", ",", "flag", ",", "config", ",", "sortOrder", ",", "fmt", ",", "}", "from", "'../runner/manifold/operators'", ";", "import", "{", "Separate", "}", "from", "'runner/manifold/types'", ";", "export", "default", "(", ")", "=>", "{", "const", "clockType", "=", "union", "(", "{", "oneOf", ":", "[", "'no'", ",", "'unit'", ",", "'array'", "]", ",", "sort", ":", "[", "'no'", ",", "'unit'", ",", "'array'", "]", ",", "}", ")", ";", "const", "filterType", "=", "union", "(", "{", "oneOf", ":", "[", "'fn'", ",", "'store'", ",", "'bool'", "]", ",", "sort", ":", "[", "'fn'", ",", "'store'", ",", "'bool'", "]", ",", "}", ")", ";", "const", "sourceType", "=", "separate", "(", "{", "source", ":", "{", "clockType", ",", "filterType", "}", ",", "variant", ":", "{", "clock", ":", "{", "noClock", ":", "{", "clockType", ":", "'no'", "}", ",", "hasClock", ":", "{", "}", ",", "}", ",", "filter", ":", "{", "boolFilter", ":", "{", "filterType", ":", "'bool'", "}", ",", "nonBool", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "noClock", ":", "{", "boolFilter", ":", "union", "(", "[", "'unit'", "]", ")", ",", "nonBool", ":", "union", "(", "[", "'unit'", ",", "'object'", ",", "'tuple'", "]", ")", ",", "}", ",", "hasClock", ":", "{", "boolFilter", ":", "union", "(", "[", "'no'", ",", "'unit'", "]", ")", ",", "nonBool", ":", "union", "(", "[", "'no'", ",", "'unit'", ",", "'object'", ",", "'tuple'", "]", ")", ",", "}", ",", "}", ",", "sort", ":", "[", "'unit'", ",", "'object'", ",", "'tuple'", ",", "'no'", "]", ",", "}", ")", ";", "const", "targetType", "=", "union", "(", "{", "oneOf", ":", "[", "'unit'", ",", "'array'", "]", ",", "sort", ":", "[", "'unit'", ",", "'array'", "]", "}", ")", ";", "const", "sourceSubtype", "=", "separate", "(", "{", "source", ":", "{", "sourceType", ",", "targetType", "}", ",", "variant", ":", "{", "source", ":", "{", "object", ":", "{", "sourceType", ":", "'object'", "}", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "target", ":", "{", "targetUnit", ":", "{", "targetType", ":", "'unit'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "object", ":", "{", "targetUnit", ":", "union", "(", "[", "'fullObject'", ",", "'nullableField'", ",", "'smallObject'", "]", ")", ",", "}", ",", "tuple", ":", "{", "targetUnit", ":", "union", "(", "[", "'fullTuple'", ",", "'smallTuple'", "]", ")", ",", "}", ",", "}", ",", "sort", ":", "[", "'fullObject'", ",", "'nullableField'", ",", "'smallObject'", ",", "'fullTuple'", ",", "'smallTuple'", ",", "]", ",", "}", ")", ";", "const", "noSource", "=", "bool", "(", "{", "source", ":", "{", "sourceType", "}", ",", "true", ":", "{", "sourceType", ":", "'no'", "}", ",", "}", ")", ";", "const", "targetVoid", "=", "flag", "(", "{", "avoid", ":", "[", "noSource", ",", "bool", "(", "{", "source", ":", "{", "sourceSubtype", "}", ",", "true", ":", "[", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "]", ",", "}", ")", ",", "]", ",", "}", ")", ";", "const", "noTargetAny", "=", "bool", "(", "{", "source", ":", "{", "sourceSubtype", "}", ",", "true", ":", "[", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "]", ",", "}", ")", ";", "const", "targetAny", "=", "separate", "(", "{", "source", ":", "{", "targetType", "}", ",", "variant", ":", "{", "_", ":", "{", "unit", ":", "{", "targetType", ":", "'unit'", "}", ",", "array", ":", "{", "targetType", ":", "'array'", "}", ",", "}", "as", "const", ",", "}", ",", "cases", ":", "{", "unit", ":", "flag", "(", "{", "avoid", ":", "[", "targetVoid", ",", "noSource", ",", "noTargetAny", "]", "}", ")", ",", "array", ":", "flag", "(", ")", ",", "}", ",", "}", ")", ";", "const", "targetIsTyped", "=", "computeVariant", "(", "{", "source", ":", "{", "targetAny", ",", "targetVoid", ",", "targetType", "}", ",", "variant", ":", "{", "array", ":", "{", "targetType", ":", "'array'", "}", ",", "nonAny", ":", "{", "targetAny", ":", "false", ",", "targetVoid", ":", "false", ",", "targetType", ":", "'unit'", ",", "}", ",", "any", ":", "[", "{", "targetAny", ":", "true", ",", "targetType", ":", "'unit'", "}", ",", "{", "targetVoid", ":", "true", ",", "targetType", ":", "'unit'", "}", ",", "]", ",", "}", "as", "const", ",", "cases", ":", "{", "array", ":", "true", ",", "nonAny", ":", "true", ",", "any", ":", "false", ",", "}", ",", "}", ")", ";", "const", "combinable", "=", "bool", "(", "{", "source", ":", "{", "sourceType", "}", ",", "true", ":", "[", "{", "sourceType", ":", "'object'", "}", ",", "{", "sourceType", ":", "'tuple'", "}", "]", ",", "}", ")", ";", "const", "wrongTarget", "=", "flag", "(", "{", "needs", ":", "targetIsTyped", ",", "avoid", ":", "noSource", ",", "}", ")", ";", "const", "targetSubtype", "=", "separate", "(", "{", "source", ":", "{", "sourceSubtype", ",", "wrongTarget", "}", ",", "variant", ":", "{", "src", ":", "{", "smallObject", ":", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "smallTuple", ":", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "}", ",", "isCorrect", ":", "{", "correct", ":", "{", "wrongTarget", ":", "false", "}", ",", "wrong", ":", "{", "wrongTarget", ":", "true", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "smallObject", ":", "{", "correct", ":", "value", "(", "'smallObject'", "as", "const", ")", ",", "wrong", ":", "union", "(", "[", "'tooWideObject'", ",", "'wrongFieldSmall'", "]", ")", ",", "}", ",", "nullableField", ":", "{", "correct", ":", "value", "(", "'smallObject'", "as", "const", ")", ",", "wrong", ":", "value", "(", "'nonNullFieldSmall'", "as", "const", ")", ",", "}", ",", "smallTuple", ":", "{", "correct", ":", "value", "(", "'smallTuple'", "as", "const", ")", ",", "}", ",", "}", ",", "sort", ":", "[", "'smallObject'", ",", "'tooWideObject'", ",", "'nonNullFieldSmall'", ",", "'wrongFieldSmall'", ",", "'smallTuple'", ",", "]", ",", "}", ")", ";", "const", "sourceIsWiderThatTargetCond", "=", "bool", "(", "{", "source", ":", "{", "sourceType", ",", "sourceSubtype", ",", "targetSubtype", "}", ",", "true", ":", "[", "{", "sourceType", ":", "'tuple'", "}", ",", "{", "sourceType", ":", "'no'", "}", ",", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "{", "targetSubtype", ":", "'smallTuple'", "}", ",", "]", ",", "}", ")", ";", "const", "sourceIsWiderThatTarget", "=", "separate", "(", "{", "source", ":", "{", "sourceSubtype", "}", ",", "variant", ":", "{", "_", ":", "{", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "nullableField", ":", "value", "(", "true", ")", ",", "__", ":", "flag", "(", "{", "needs", ":", "targetIsTyped", ",", "avoid", ":", "[", "noSource", ",", "sourceIsWiderThatTargetCond", "]", ",", "}", ")", ",", "}", ",", "sort", ":", "[", "false", ",", "true", "]", ",", "}", ")", ";", "const", "inferByFilter", "=", "flag", "(", "{", "needs", ":", "[", "computeVariants", "(", "{", "source", ":", "{", "filterType", ",", "sourceSubtype", ",", "combinable", "}", ",", "variant", ":", "{", "filter", ":", "{", "store", ":", "{", "filterType", ":", "'store'", "}", ",", "nonStore", ":", "[", "{", "filterType", ":", "'fn'", "}", ",", "{", "filterType", ":", "'bool'", "}", "]", ",", "}", ",", "source", ":", "{", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "plain", ":", "{", "combinable", ":", "false", "}", ",", "combinable", ":", "{", "combinable", ":", "true", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "store", ":", "false", ",", "nonStore", ":", "{", "nullableField", ":", "true", ",", "plain", ":", "true", ",", "combinable", ":", "false", ",", "}", ",", "}", ",", "}", ")", ",", "targetIsTyped", ",", "]", ",", "avoid", ":", "bool", "(", "{", "source", ":", "{", "sourceType", ",", "filterType", ",", "sourceIsWiderThatTarget", "}", ",", "true", ":", "{", "sourceType", ":", "'unit'", ",", "filterType", ":", "'fn'", ",", "sourceIsWiderThatTarget", ":", "true", ",", "}", ",", "}", ")", ",", "sort", ":", "[", "false", ",", "true", "]", ",", "}", ")", ";", "const", "fnSecondArg", "=", "flag", "(", "{", "needs", ":", "[", "bool", "(", "{", "source", ":", "{", "filterType", ",", "clockType", "}", ",", "true", ":", "[", "{", "filterType", ":", "'fn'", ",", "clockType", ":", "'unit'", "}", ",", "{", "filterType", ":", "'fn'", ",", "clockType", ":", "'array'", "}", ",", "]", ",", "}", ")", ",", "]", ",", "avoid", ":", "[", "wrongTarget", ",", "bool", "(", "{", "source", ":", "{", "sourceType", "}", ",", "true", ":", "{", "sourceType", ":", "'no'", "}", ",", "}", ")", ",", "]", ",", "sort", ":", "[", "false", ",", "true", "]", ",", "}", ")", ";", "function", "permuteTargets", "(", "{", "correctObject", ",", "correctObjectWide", ",", "wrongObject", ",", "wrongObjectWide", ",", "correctTuple", ",", "correctTupleWide", ",", "wrongTuple", ",", "wrongTupleWide", ",", "}", ")", "{", "return", "{", "nonTuple", ":", "{", "correct", ":", "{", "same", ":", "value", "(", "correctObject", ")", ",", "wide", ":", "value", "(", "correctObjectWide", ")", ",", "}", ",", "wrong", ":", "{", "same", ":", "value", "(", "wrongObject", ")", ",", "wide", ":", "value", "(", "wrongObjectWide", ")", ",", "}", ",", "}", ",", "tuple", ":", "{", "correct", ":", "{", "same", ":", "value", "(", "correctTuple", ")", ",", "wide", ":", "value", "(", "correctTupleWide", ")", ",", "}", ",", "wrong", ":", "{", "same", ":", "value", "(", "wrongTuple", ")", ",", "wide", ":", "value", "(", "wrongTupleWide", ")", ",", "}", ",", "}", ",", "}", ";", "}", "const", "targetValue", "=", "separate", "(", "{", "source", ":", "{", "targetType", ",", "targetSubtype", ",", "targetVoid", ",", "targetAny", ",", "sourceType", ",", "wrongTarget", ",", "sourceIsWiderThatTarget", ",", "}", ",", "variant", ":", "{", "targetKind", ":", "{", "smallObject", ":", "{", "targetSubtype", ":", "'smallObject'", "}", ",", "smallTuple", ":", "{", "targetSubtype", ":", "'smallTuple'", "}", ",", "tooWideObject", ":", "{", "targetSubtype", ":", "'tooWideObject'", "}", ",", "nonNullFieldSmall", ":", "{", "targetSubtype", ":", "'nonNullFieldSmall'", "}", ",", "wrongFieldSmall", ":", "{", "targetSubtype", ":", "'wrongFieldSmall'", "}", ",", "singleVoid", ":", "{", "targetType", ":", "'unit'", ",", "targetVoid", ":", "true", "}", ",", "singleAny", ":", "{", "targetType", ":", "'unit'", ",", "targetAny", ":", "true", "}", ",", "single", ":", "{", "targetType", ":", "'unit'", "}", ",", "manyAnyVoid", ":", "{", "targetType", ":", "'array'", ",", "targetVoid", ":", "true", ",", "targetAny", ":", "true", ",", "}", ",", "manyVoid", ":", "{", "targetType", ":", "'array'", ",", "targetVoid", ":", "true", "}", ",", "manyAny", ":", "{", "targetType", ":", "'array'", ",", "targetAny", ":", "true", "}", ",", "many", ":", "{", "targetType", ":", "'array'", "}", ",", "}", ",", "source", ":", "{", "none", ":", "{", "sourceType", ":", "'no'", "}", ",", "nonTuple", ":", "[", "{", "sourceType", ":", "'unit'", "}", ",", "{", "sourceType", ":", "'object'", "}", "]", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "target", ":", "{", "correct", ":", "{", "wrongTarget", ":", "false", "}", ",", "wrong", ":", "{", "wrongTarget", ":", "true", "}", ",", "}", ",", "sourceWidth", ":", "{", "wide", ":", "{", "sourceIsWiderThatTarget", ":", "true", "}", ",", "same", ":", "{", "sourceIsWiderThatTarget", ":", "false", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "smallObject", ":", "value", "(", "'aNum'", ")", ",", "smallTuple", ":", "value", "(", "'lNum'", ")", ",", "tooWideObject", ":", "value", "(", "'ab'", ")", ",", "nonNullFieldSmall", ":", "value", "(", "'aNum'", ")", ",", "wrongFieldSmall", ":", "value", "(", "'aStr'", ")", ",", "singleVoid", ":", "value", "(", "'voidt'", ")", ",", "singleAny", ":", "value", "(", "'anyt'", ")", ",", "single", ":", "{", "none", ":", "{", "correct", ":", "value", "(", "'numt'", ")", ",", "wrong", ":", "value", "(", "'strt'", ")", ",", "}", ",", "nonTuple", ":", "{", "correct", ":", "{", "wide", ":", "value", "(", "'aNum'", ")", ",", "same", ":", "value", "(", "'ab'", ")", ",", "}", ",", "wrong", ":", "{", "wide", ":", "value", "(", "'aStr'", ")", ",", "same", ":", "value", "(", "'abn'", ")", ",", "}", ",", "}", ",", "tuple", ":", "{", "correct", ":", "{", "wide", ":", "value", "(", "'lNum'", ")", ",", "same", ":", "value", "(", "'lNumStr'", ")", ",", "}", ",", "wrong", ":", "{", "wide", ":", "value", "(", "'lStr'", ")", ",", "same", ":", "value", "(", "'lNumNum'", ")", ",", "}", ",", "}", ",", "}", ",", "manyAnyVoid", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", ",", "'anyt'", ",", "'voidt'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongObject", ":", "[", "'abn'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'anyt'", ",", "'voidt'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", ",", "'anyt'", ",", "'voidt'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", ",", "'anyt'", ",", "'voidt'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'anyt'", ",", "'voidt'", "]", ",", "}", ")", ",", "manyVoid", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", ",", "'voidt'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", ",", "'voidt'", "]", ",", "wrongObject", ":", "[", "'abn'", ",", "'voidt'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'voidt'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", ",", "'voidt'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'voidt'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", ",", "'voidt'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'voidt'", "]", ",", "}", ")", ",", "manyAny", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", ",", "'anyt'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", ",", "'anyt'", "]", ",", "wrongObject", ":", "[", "'abn'", ",", "'anyt'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'anyt'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", ",", "'anyt'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'anyt'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", ",", "'anyt'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'anyt'", "]", ",", "}", ")", ",", "many", ":", "permuteTargets", "(", "{", "correctObject", ":", "[", "'ab'", "]", ",", "correctObjectWide", ":", "[", "'aNum'", "]", ",", "wrongObject", ":", "[", "'abn'", "]", ",", "wrongObjectWide", ":", "[", "'aStr'", ",", "'ab'", "]", ",", "correctTuple", ":", "[", "'lNumStr'", "]", ",", "correctTupleWide", ":", "[", "'lNum'", ",", "'lNumStr'", "]", ",", "wrongTuple", ":", "[", "'lNumNum'", "]", ",", "wrongTupleWide", ":", "[", "'lStr'", ",", "'lNumStr'", "]", ",", "}", ")", ",", "}", ",", "}", ")", ";", "const", "targetCode", "=", "computeFn", "(", "{", "source", ":", "{", "targetValue", "}", ",", "fn", "(", "{", "targetValue", "}", ")", "{", "return", "Array", ".", "isArray", "(", "targetValue", ")", "?", "printArray", "(", "targetValue", ")", ":", "targetValue", ";", "}", ",", "}", ")", ";", "const", "clockCode", "=", "separate", "(", "{", "source", ":", "{", "clockType", ",", "fnSecondArg", "}", ",", "variant", ":", "{", "clock", ":", "{", "noClock", ":", "{", "clockType", ":", "'no'", "}", ",", "clockSingle", ":", "{", "clockType", ":", "'unit'", "}", ",", "clockArray", ":", "{", "clockType", ":", "'array'", "}", ",", "}", "as", "const", ",", "fnArg", ":", "{", "hasFnSecondArg", ":", "{", "fnSecondArg", ":", "true", "}", ",", "noFnSecondArg", ":", "{", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "noClock", ":", "value", "(", "null", ")", ",", "clockSingle", ":", "{", "hasFnSecondArg", ":", "value", "(", "'numt'", ")", ",", "noFnSecondArg", ":", "value", "(", "'anyt'", ")", ",", "}", ",", "clockArray", ":", "{", "hasFnSecondArg", ":", "value", "(", "'[numt,$num]'", ")", ",", "noFnSecondArg", ":", "value", "(", "'[anyt]'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "const", "sourceCode", "=", "separate", "(", "{", "source", ":", "{", "sourceType", ",", "sourceSubtype", ",", "filterType", ",", "inferByFilter", "}", ",", "variant", ":", "{", "AsourceSubtype", ":", "{", "fullObject", ":", "{", "sourceSubtype", ":", "'fullObject'", "}", ",", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "smallObject", ":", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "fullTuple", ":", "{", "sourceSubtype", ":", "'fullTuple'", "}", ",", "smallTuple", ":", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "}", "as", "const", ",", "Bsource", ":", "{", "none", ":", "{", "sourceType", ":", "'no'", "}", ",", "unit", ":", "{", "sourceType", ":", "'unit'", "}", ",", "object", ":", "{", "sourceType", ":", "'object'", "}", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", "as", "const", ",", "Cfilter", ":", "{", "fn", ":", "{", "filterType", ":", "'fn'", "}", ",", "store", ":", "{", "filterType", ":", "'store'", "}", ",", "boolFn", ":", "{", "filterType", ":", "'bool'", "}", ",", "}", "as", "const", ",", "Dinfer", ":", "{", "infer", ":", "{", "inferByFilter", ":", "true", "}", ",", "noInfer", ":", "{", "inferByFilter", ":", "false", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "fullObject", ":", "value", "(", "'{a,b}'", ")", ",", "nullableField", ":", "value", "(", "'{a:aOpt,b}'", ")", ",", "smallObject", ":", "value", "(", "'{a}'", ")", ",", "fullTuple", ":", "value", "(", "'[a,b]'", ")", ",", "smallTuple", ":", "value", "(", "'[a]'", ")", ",", "__", ":", "{", "none", ":", "value", "<", "string", "|", "null", ">", "(", "null", ")", ",", "unit", ":", "{", "fn", ":", "{", "infer", ":", "value", "(", "'abNull'", ")", ",", "noInfer", ":", "value", "(", "'ab'", ")", ",", "}", ",", "boolFn", ":", "{", "infer", ":", "value", "(", "'nullableAB'", ")", ",", "noInfer", ":", "value", "(", "'ab'", ")", ",", "}", ",", "store", ":", "value", "(", "'ab'", ")", ",", "}", ",", "object", ":", "value", "(", "'{a,b}'", ")", ",", "tuple", ":", "value", "(", "'[a,b]'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "const", "filterCode", "=", "separate", "(", "{", "source", ":", "{", "filterType", ",", "fnSecondArg", ",", "sourceType", ",", "sourceSubtype", ",", "inferByFilter", "}", ",", "variant", ":", "{", "Afilter", ":", "{", "fn", ":", "{", "filterType", ":", "'fn'", "}", ",", "store", ":", "{", "filterType", ":", "'store'", "}", ",", "boolFn", ":", "{", "filterType", ":", "'bool'", "}", ",", "}", ",", "BfnArg", ":", "{", "hasFnSecondArg", ":", "{", "fnSecondArg", ":", "true", "}", ",", "noFnSecondArg", ":", "{", "}", ",", "}", ",", "Csource", ":", "{", "none", ":", "{", "sourceType", ":", "'no'", "}", ",", "fullObject", ":", "{", "sourceSubtype", ":", "'fullObject'", "}", ",", "nullableField", ":", "{", "sourceSubtype", ":", "'nullableField'", "}", ",", "smallObject", ":", "{", "sourceSubtype", ":", "'smallObject'", "}", ",", "fullTuple", ":", "{", "sourceSubtype", ":", "'fullTuple'", "}", ",", "smallTuple", ":", "{", "sourceSubtype", ":", "'smallTuple'", "}", ",", "unit", ":", "{", "sourceType", ":", "'unit'", "}", ",", "object", ":", "{", "sourceType", ":", "'object'", "}", ",", "tuple", ":", "{", "sourceType", ":", "'tuple'", "}", ",", "}", ",", "Dinfer", ":", "{", "infer", ":", "{", "inferByFilter", ":", "true", "}", ",", "noInfer", ":", "{", "inferByFilter", ":", "false", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "fn", ":", "{", "hasFnSecondArg", ":", "{", "unit", ":", "{", "infer", ":", "value", "(", "'(val,n): val is AB => n > 0 && val.a !== null'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "fullObject", ":", "{", "infer", ":", "value", "(", "'(val,n): val is AB => val.a > n'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "object", ":", "{", "infer", ":", "value", "(", "'(val,n): val is AB => val.a > n'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "nullableField", ":", "{", "infer", ":", "value", "(", "\"(val,n): val is AB => typeof val.a === 'number' && val.a > n\"", ")", ",", "noInfer", ":", "value", "(", "\"(val,n) => typeof val.a === 'number' && val.a > n\"", ")", ",", "}", ",", "smallObject", ":", "{", "infer", ":", "value", "(", "'(val,n): val is Astr => val.a > n'", ")", ",", "noInfer", ":", "value", "(", "'(val,n) => val.a > n'", ")", ",", "}", ",", "fullTuple", ":", "value", "(", "'(val, n) => val[0] > n'", ")", ",", "tuple", ":", "value", "(", "'(val, n) => val[0] > n'", ")", ",", "smallTuple", ":", "value", "(", "'(val, n) => val[0] > n'", ")", ",", "}", ",", "noFnSecondArg", ":", "{", "none", ":", "{", "infer", ":", "value", "(", "\"(n): n is number => typeof n === 'number' && n > 0\"", ")", ",", "noInfer", ":", "value", "(", "'(n) => n > 0'", ")", ",", "}", ",", "unit", ":", "{", "infer", ":", "value", "(", "'(val): val is AB => val.a !== null'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "fullObject", ":", "{", "infer", ":", "value", "(", "'(val): val is AB => val.a > 0'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "object", ":", "{", "infer", ":", "value", "(", "'(val): val is AB => val.a > 0'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "nullableField", ":", "{", "infer", ":", "value", "(", "\"(val): val is AB => typeof val.a === 'number' && val.a > 0\"", ")", ",", "noInfer", ":", "value", "(", "\"(val) => typeof val.a === 'number' && val.a > 0\"", ")", ",", "}", ",", "smallObject", ":", "{", "infer", ":", "value", "(", "'(val): val is Astr => val.a > 0'", ")", ",", "noInfer", ":", "value", "(", "'(val) => val.a > 0'", ")", ",", "}", ",", "fullTuple", ":", "value", "(", "'(val) => val[0] > 0'", ")", ",", "tuple", ":", "value", "(", "'(val) => val[0] > 0'", ")", ",", "smallTuple", ":", "value", "(", "'(val) => val[0] > 0'", ")", ",", "}", ",", "}", ",", "store", ":", "value", "(", "'$filter'", ")", ",", "boolFn", ":", "value", "(", "'Boolean'", ")", ",", "}", ",", "}", ")", ";", "const", "groupTokens", "=", "computeFn", "(", "{", "source", ":", "{", "sourceIsWiderThatTarget", ",", "sourceType", ",", "clockType", ",", "targetType", ",", "}", ",", "fn", "(", "{", "sourceIsWiderThatTarget", ",", "sourceType", ",", "clockType", ",", "targetType", "}", ")", "{", "return", "`${", "sourceType", "===", "'no'", "?", "''", ":", "`${", "sourceType", "}${", "clockType", "===", "'no'", "?", "''", ":", "' + '", "}`", "}${", "clockType", "===", "'no'", "?", "''", ":", "'clock'", "} -> ${", "targetType", "} ${", "sourceIsWiderThatTarget", "?", "'wide'", ":", "'same'", "}`", ";", "}", ",", "}", ")", ";", "sortOrder", "(", "[", "inferByFilter", ",", "sourceType", ",", "sourceSubtype", ",", "targetType", ",", "targetSubtype", ",", "filterType", ",", "clockType", ",", "sourceIsWiderThatTarget", ",", "fnSecondArg", ",", "]", ")", ";", "config", "(", "{", "file", ":", "'generated/guard'", ",", "usedMethods", ":", "[", "'createStore'", ",", "'createEvent'", ",", "'guard'", "]", ",", "header", ",", "grouping", ":", "{", "pass", ":", "bool", "(", "{", "source", ":", "{", "wrongTarget", ",", "sourceSubtype", ",", "filterType", ",", "inferByFilter", "}", ",", "false", ":", "[", "{", "wrongTarget", ":", "true", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'store'", "}", ",", "{", "sourceSubtype", ":", "'nullableField'", ",", "filterType", ":", "'fn'", ",", "inferByFilter", ":", "false", ",", "}", ",", "]", ",", "}", ")", ",", "getHash", ":", "[", "inferByFilter", ",", "sourceIsWiderThatTarget", ",", "filterType", ",", "sourceType", ",", "targetType", ",", "clockType", ",", "]", ",", "tags", ":", "{", "inferByFilter", ",", "sourceIsWiderThatTarget", ",", "filter", ":", "filterType", ",", "source", ":", "sourceType", ",", "target", ":", "targetType", ",", "clock", ":", "clockType", ",", "}", ",", "describeGroup", ":", "computeFn", "(", "{", "source", ":", "{", "groupTokens", ",", "sourceType", "}", ",", "fn", ":", "(", "{", "groupTokens", ",", "sourceType", "}", ")", "=>", "(", "{", "largeGroup", ":", "`${", "sourceType", "} source`", ",", "description", ":", "groupTokens", ",", "}", ")", ",", "}", ")", ",", "createTestLines", ":", "{", "method", ":", "'guard'", ",", "shape", ":", "{", "source", ":", "sourceCode", ",", "clock", ":", "clockCode", ",", "target", ":", "targetCode", ",", "filter", ":", "filterCode", ",", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ";", "const", "header", "=", "`\ntype Astr = {a: string}\ntype AB = {a: number; b: string}\ntype AoptB = {a: number | null; b: string}\ntype ABN = {a: number; b: number}\nconst $filter = createStore(true)\nconst a = createStore(0)\nconst aOpt = createStore<number | null>(0)\nconst b = createStore('')\nconst voidt = createEvent()\nconst anyt = createEvent<any>()\nconst numt = createEvent<number>()\nconst strt = createEvent<number>()\nconst $num = createStore(0)\nconst ab = createEvent<AB>()\nconst nullableAB = createEvent<AB | null>()\nconst abNull = createEvent<{a: number | null; b: string}>()\nconst aNum = createEvent<{a: number}>()\nconst aStr = createEvent<{a: string}>()\nconst lNum = createEvent<[number]>()\nconst lStr = createEvent<[string]>()\nconst lNumStr = createEvent<[number, string]>()\nconst lNumNum = createEvent<[number, number]>()\nconst abn = createEvent<ABN>()\n`", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
637
[ "type", "item", "<", "T", ">", "=", "Item", "<", "T", ">", "|", "null", ";", "type", "Item", "<", "T", ">", "=", "{", "right", ":", "item", "<", "T", ">", ";", "left", ":", "item", "<", "T", ">", ";", "value", ":", "T", ";", "}", ";", "type", "Heap", "<", "T", ">", "=", "{", "top", ":", "item", "<", "T", ">", ";", "size", ":", "number", ";", "isAafterB", ":", "(", "a", ":", "T", ",", "b", ":", "T", ")", "=>", "boolean", ";", "}", ";", "export", "function", "sortListBySkewHeap", "<", "T", ">", "(", "list", ",", "isAafterB", ")", "{", "const", "heap", "=", "create", "(", "isAafterB", ")", ";", "list", ".", "forEach", "(", "e", "=>", "{", "push", "(", "e", ",", "heap", ")", ";", "}", ")", ";", "const", "result", "=", "[", "]", ";", "let", "value", ";", "while", "(", "(", "value", "=", "pop", "(", "heap", ")", ")", ")", "{", "result", ".", "push", "(", "value", ")", ";", "}", "return", "result", ";", "}", "function", "merge", "<", "T", ">", "(", "a", ",", "b", ",", "isAafterB", ")", "{", "if", "(", "!", "a", ")", "return", "b", ";", "if", "(", "!", "b", ")", "return", "a", ";", "let", "ret", ";", "if", "(", "!", "isAafterB", "(", "a", ".", "value", ",", "b", ".", "value", ")", ")", "{", "ret", "=", "a", ";", "a", "=", "b", ";", "b", "=", "ret", ";", "}", "ret", "=", "merge", "(", "a", ".", "right", ",", "b", ",", "isAafterB", ")", ";", "a", ".", "right", "=", "a", ".", "left", ";", "a", ".", "left", "=", "ret", ";", "return", "a", ";", "}", "function", "push", "<", "T", ">", "(", "value", ",", "queue", ")", "{", "queue", ".", "top", "=", "merge", "(", "queue", ".", "top", ",", "{", "value", ",", "left", ":", "null", ",", "right", ":", "null", "}", ",", "queue", ".", "isAafterB", ")", ";", "queue", ".", "size", "+=", "1", ";", "}", "function", "pop", "<", "T", ">", "(", "queue", ")", "{", "if", "(", "queue", ".", "size", "===", "0", ")", "return", ";", "queue", ".", "size", "-=", "1", ";", "const", "top", "=", "queue", ".", "top", "!", ";", "const", "value", "=", "top", ".", "value", ";", "queue", ".", "top", "=", "merge", "(", "top", ".", "left", ",", "top", ".", "right", ",", "queue", ".", "isAafterB", ")", ";", "return", "value", ";", "}", "function", "create", "<", "T", ">", "(", "isAafterB", ")", "{", "return", "{", "top", ":", "null", ",", "size", ":", "0", ",", "isAafterB", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, 5, null, 8, null, null, null, 4786, null, null, null, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 138, null, null, null, null, 17961, null, 17961, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, 11, null, 4786, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 11, null, null, null, null, 4786, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 138, null, null, null, null, null, null, null, 11, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4786, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
638
[ "import", "{", "exec", "}", "from", "'./operators'", ";", "import", "{", "createGroupedCases", "}", "from", "'./createGroupedCases'", ";", "import", "{", "byFields", "}", "from", "'./byFields'", ";", "export", "function", "suiteGenerator", "(", "execFn", ")", "{", "const", "execResult", "=", "exec", "(", "execFn", ")", ";", "const", "cases", "=", "createGroupedCases", "(", "byFields", "(", "execResult", ".", "plan", ",", "execResult", ".", "config", ",", "execResult", ".", "items", ")", ".", "map", "(", "e", "=>", "e", ".", "value", ")", ",", "execResult", ".", "grouping", ")", ".", "finalLines", ";", "return", "cases", ".", "join", "(", "`\\n`", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 4, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 27929, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
639
[ "import", "*", "as", "ts", "from", "'typescript'", ";", "import", "{", "resolve", ",", "relative", "}", "from", "'path'", ";", "import", "{", "existsSync", ",", "readFileSync", ",", "readdirSync", ",", "writeFileSync", ",", "watchFile", ",", "}", "from", "'fs'", ";", "import", "{", "JsonOutput", "}", "from", "'./types'", ";", "import", "{", "jsonOutputToAnnotatedFile", "}", "from", "'./generateFile'", ";", "const", "WATCH_CHANGES", "=", "true", ";", "const", "WATCH_GENERATED", "=", "true", ";", "const", "primeTargetDir", "=", "'generated'", ";", "const", "debugTargetDir", "=", "'gen2'", ";", "const", "currentTargetDir", "=", "primeTargetDir", ";", "/** dir with generated tests */", "const", "OUTPUT_DIR", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'__tests__'", ",", "'effector'", ",", "currentTargetDir", ")", ";", "const", "TS_CONFIG_PATH", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'tsconfig.json'", ")", ";", "const", "tsConfigRaw", "=", "{", "compilerOptions", ":", "{", "strictNullChecks", ":", "true", ",", "module", ":", "'CommonJS'", ",", "target", ":", "'esnext'", ",", "jsx", ":", "'react'", ",", "allowJs", ":", "true", ",", "strict", ":", "true", ",", "allowSyntheticDefaultImports", ":", "true", ",", "moduleResolution", ":", "'node'", ",", "resolveJsonModule", ":", "true", ",", "lib", ":", "[", "'esnext'", ",", "'es2019'", "]", ",", "baseUrl", ":", "'./'", ",", "paths", ":", "{", "effector", ":", "[", "'packages/effector/index.d.ts'", "]", ",", "}", ",", "}", ",", "exclude", ":", "[", "]", ",", "}", ";", "const", "REPO_ROOT", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'..'", ")", ";", "const", "EFFECTOR_TYPES", "=", "resolve", "(", "REPO_ROOT", ",", "'packages'", ",", "'effector'", ",", "'index.d.ts'", ")", ";", "const", "EFFECTOR_PACKAGE", "=", "resolve", "(", "REPO_ROOT", ",", "'packages'", ",", "'effector'", ",", "'package.json'", ")", ";", "const", "REPO_NODE_MODULES", "=", "resolve", "(", "REPO_ROOT", ",", "'node_modules'", ")", ";", "const", "JEST_TYPES_DIR", "=", "resolve", "(", "REPO_ROOT", ",", "'node_modules'", ",", "'@types'", ",", "'jest'", ")", ";", "const", "JEST_TYPES_FILE", "=", "resolve", "(", "REPO_ROOT", ",", "'node_modules'", ",", "'@types'", ",", "'jest'", ",", "'index.d.ts'", ")", ";", "const", "jestTypes", "=", "readFileSync", "(", "JEST_TYPES_FILE", ",", "'utf8'", ")", ";", "const", "tsConfig", "=", "(", "(", ")", "=>", "{", "const", "result", "=", "{", "}", ";", "const", "config", "=", "tsConfigRaw", ".", "compilerOptions", ";", "function", "getResultValue", "(", "field", ",", "value", ")", "{", "switch", "(", "field", ")", "{", "case", "'module'", ":", "switch", "(", "value", ")", "{", "case", "'ESNext'", ":", "return", "ts", ".", "ModuleKind", ".", "ESNext", ";", "case", "'CommonJS'", ":", "/** WARN option change */", "return", "ts", ".", "ModuleKind", ".", "ESNext", ";", "default", ":", "notImplemented", "(", ")", ";", "}", "case", "'target'", ":", "switch", "(", "value", ")", "{", "case", "'esnext'", ":", "return", "ts", ".", "ScriptTarget", ".", "ESNext", ";", "case", "'ES5'", ":", "return", "ts", ".", "ScriptTarget", ".", "ES5", ";", "default", ":", "notImplemented", "(", ")", ";", "}", "case", "'moduleResolution'", ":", "switch", "(", "value", ")", "{", "case", "'node'", ":", "return", "ts", ".", "ModuleResolutionKind", ".", "NodeJs", ";", "default", ":", "notImplemented", "(", ")", ";", "}", "case", "'lib'", ":", "return", "value", ".", "map", "(", "(", "lib", ")", "=>", "`lib.${", "lib", "}.d.ts`", ")", ";", "case", "'jsx'", ":", "default", ":", "return", "value", ";", "}", "}", "for", "(", "const", "field", "in", "config", ")", "{", "result", "[", "field", "]", "=", "getResultValue", "(", "field", ",", "config", "[", "field", "]", ")", ";", "}", "return", "result", ";", "function", "notImplemented", "(", ")", "{", "throw", "Error", "(", "'not implemented'", ")", ";", "}", "}", ")", "(", ")", ";", "function", "watchVirtual", "(", ")", "{", "const", "TEST_FILE", "=", "'virtual.test.ts'", ";", "const", "TEST_FILE_PATH", "=", "resolve", "(", "REPO_ROOT", ",", "TEST_FILE", ")", ";", "const", "REAL_JSON", "=", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'jsonOutput.json'", ")", ";", "const", "fileList", "=", "[", "{", "file", ":", "TEST_FILE", ",", "path", ":", "TEST_FILE_PATH", ",", "version", ":", "0", ",", "}", ",", "{", "file", ":", "'effector'", ",", "path", ":", "EFFECTOR_TYPES", ",", "version", ":", "0", ",", "}", ",", "]", ";", "let", "annots", "=", "[", "]", ";", "let", "jsonOut", ";", "let", "ouptutContent", "=", "''", ";", "const", "services", "=", "ts", ".", "createLanguageService", "(", "{", "getScriptFileNames", ":", "(", ")", "=>", "[", "TEST_FILE", "]", ",", "getScriptVersion", "(", "fileName", ")", "{", "const", "absolutePath", "=", "resolve", "(", "REPO_ROOT", ",", "fileName", ")", ";", "const", "record", "=", "fileList", ".", "find", "(", "e", "=>", "e", ".", "path", "===", "absolutePath", ")", ";", "if", "(", "!", "record", ")", "{", "return", "'0'", ";", "}", "return", "record", ".", "version", ".", "toString", "(", ")", ";", "}", ",", "getScriptSnapshot", "(", "fileNameShort", ")", "{", "const", "isVirtual", "=", "fileNameShort", "===", "TEST_FILE", ";", "const", "fileName", "=", "resolve", "(", "REPO_ROOT", ",", "fileNameShort", ")", ";", "if", "(", "!", "isVirtual", "&&", "!", "existsSync", "(", "fileName", ")", ")", "{", "return", "undefined", ";", "}", "let", "rawContent", ";", "if", "(", "isVirtual", ")", "{", "const", "jsonOutput", "=", "JSON", ".", "parse", "(", "readFileSync", "(", "REAL_JSON", ",", "'utf8'", ")", ")", ";", "jsonOut", "=", "jsonOutput", ";", "const", "{", "file", ",", "annotations", "}", "=", "jsonOutputToAnnotatedFile", "(", "jsonOutput", ")", ";", "annots", "=", "annotations", ";", "rawContent", "=", "file", ";", "ouptutContent", "=", "file", ";", "writeFileSync", "(", "resolve", "(", "__dirname", ",", "'..'", ",", "'..'", ",", "'out.gen.ts'", ")", ",", "file", ")", ";", "}", "else", "{", "rawContent", "=", "readFileSync", "(", "fileName", ",", "'utf8'", ")", ";", "}", "if", "(", "fileNameShort", ".", "includes", "(", "'/lib.'", ")", ")", "return", "ts", ".", "ScriptSnapshot", ".", "fromString", "(", "rawContent", ")", ";", "const", "content", "=", "[", "rawContent", ".", "replace", "(", "/\\@ts\\-expect\\-error/gm", ",", "''", ")", ",", "]", ".", "join", "(", "`\\n`", ")", ";", "return", "ts", ".", "ScriptSnapshot", ".", "fromString", "(", "content", ")", ";", "}", ",", "getCurrentDirectory", ":", "(", ")", "=>", "REPO_ROOT", ",", "getCompilationSettings", ":", "(", ")", "=>", "tsConfig", ",", "getDefaultLibFileName", "(", "options", ")", "{", "return", "ts", ".", "getDefaultLibFilePath", "(", "options", ")", ";", "}", ",", "fileExists", "(", "path", ")", "{", "if", "(", "path", "===", "JEST_TYPES_FILE", "||", "path", "===", "EFFECTOR_PACKAGE", "||", "TEST_FILE_PATH", ")", "return", "true", ";", "if", "(", "fileList", ".", "some", "(", "e", "=>", "e", ".", "path", "===", "path", ")", ")", "return", "true", ";", "return", "ts", ".", "sys", ".", "fileExists", "(", "path", ")", ";", "}", ",", "readFile", "(", "path", ",", "encoding", ")", "{", "if", "(", "path", "===", "JEST_TYPES_FILE", ")", "return", "jestTypes", ";", "if", "(", "path", "===", "TEST_FILE_PATH", ")", "return", "ouptutContent", ";", "const", "result", "=", "ts", ".", "sys", ".", "readFile", "(", "path", ",", "encoding", ")", ";", "return", "result", ";", "}", ",", "readDirectory", "(", "path", ",", "extension", ",", "exclude", ",", "include", ",", "depth", ")", "{", "console", ".", "log", "(", "'readDirectory'", ",", "{", "path", ",", "extension", ",", "exclude", ",", "include", ",", "depth", "}", ")", ";", "return", "ts", ".", "sys", ".", "readDirectory", "(", "path", ",", "extension", ",", "exclude", ",", "include", ",", "depth", ")", ";", "}", ",", "directoryExists", "(", "name", ")", "{", "if", "(", "name", "===", "JEST_TYPES_DIR", ")", "return", "true", ";", "if", "(", "name", ".", "includes", "(", "'node_modules'", ")", ")", "return", "false", ";", "return", "ts", ".", "sys", ".", "directoryExists", "(", "name", ")", ";", "}", ",", "getDirectories", "(", "path", ")", "{", "console", ".", "log", "(", "'getDirectories'", ",", "path", ")", ";", "return", "ts", ".", "sys", ".", "getDirectories", "(", "path", ")", ";", "}", ",", "}", ",", "ts", ".", "createDocumentRegistry", "(", ")", ")", ";", "logErrors", "(", "TEST_FILE_PATH", ",", "TEST_FILE", ")", ";", "if", "(", "WATCH_GENERATED", ")", "{", "watchFile", "(", "TEST_FILE_PATH", ",", "{", "persistent", ":", "true", ",", "interval", ":", "250", "}", ",", "(", "curr", ",", "prev", ")", "=>", "{", "if", "(", "+", "curr", ".", "mtime", "<=", "+", "prev", ".", "mtime", ")", "{", "return", ";", "}", "const", "item", "=", "fileList", ".", "find", "(", "e", "=>", "e", ".", "path", "===", "TEST_FILE_PATH", ")", "!", ";", "try", "{", "item", ".", "version", "++", ";", "}", "catch", "(", "err", ")", "{", "console", ".", "error", "(", "err", ")", ";", "}", "logErrors", "(", "TEST_FILE_PATH", ",", "TEST_FILE", ")", ";", "}", ")", ";", "}", "function", "logErrors", "(", "fileName", ",", "fileNameShort", ")", "{", "const", "allDiagnostics", "=", "services", ".", "getCompilerOptionsDiagnostics", "(", ")", ".", "concat", "(", "services", ".", "getSyntacticDiagnostics", "(", "fileName", ")", ")", ".", "concat", "(", "services", ".", "getSemanticDiagnostics", "(", "fileName", ")", ")", ";", "allDiagnostics", ".", "forEach", "(", "diagnostic", "=>", "{", "const", "message", "=", "ts", ".", "flattenDiagnosticMessageText", "(", "diagnostic", ".", "messageText", ",", "'\\n'", ")", ";", "if", "(", "message", ".", "includes", "(", "`Unused '@ts-expect-error' directive.`", ")", ")", "return", ";", "if", "(", "message", ".", "includes", "(", "`implicitly has an 'any' type`", ")", ")", "return", ";", "if", "(", "diagnostic", ".", "file", ")", "{", "/** added lines for library reference */", "const", "CHANGED_FILE_OFFSET", "=", "0", ";", "const", "{", "line", ",", "character", "}", "=", "diagnostic", ".", "file", ".", "getLineAndCharacterOfPosition", "(", "diagnostic", ".", "start", "!", ")", ";", "const", "lineReal", "=", "line", "+", "1", "-", "CHANGED_FILE_OFFSET", ";", "const", "annot", "=", "annots", ".", "find", "(", "ann", "=>", "ann", ".", "fromLine", "<=", "lineReal", "&&", "ann", ".", "toLine", ">=", "lineReal", ")", "!", ";", "if", "(", "annot", ")", "{", "const", "result", "=", "jsonOut", ".", "groups", "[", "annot", ".", "group", "]", ".", "caseItems", "[", "annot", ".", "caseItem", "]", ";", "if", "(", "result", ".", "pass", ")", "{", "console", ".", "warn", "(", "'unexpected error in case'", ",", "result", ")", ";", "console", ".", "log", "(", "`TS${", "diagnostic", ".", "code", "}(${", "lineReal", "},${", "character", "+", "1", "}): ${", "message", "}`", ")", ";", "}", "}", "else", "{", "console", ".", "log", "(", "`TS${", "diagnostic", ".", "code", "} ${", "diagnostic", ".", "file", ".", "fileName", "} (${", "lineReal", "},${", "character", "+", "1", "}): ${", "message", "}`", ")", ";", "}", "}", "else", "{", "console", ".", "log", "(", "`TS${", "diagnostic", ".", "code", "} ${", "message", "}`", ")", ";", "}", "}", ")", ";", "if", "(", "allDiagnostics", ".", "length", "===", "0", ")", "{", "console", ".", "log", "(", "`no errors in file ${", "fileNameShort", "}`", ")", ";", "}", "}", "}", "function", "createWatcher", "(", ")", "{", "function", "watch", "(", "rootFileNames", ")", "{", "const", "servicesHost", "=", "{", "getScriptFileNames", ":", "(", ")", "=>", "rootFileNames", ",", "getScriptVersion", "(", "fileName", ")", "{", "const", "absolutePath", "=", "resolve", "(", "OUTPUT_DIR", ",", "fileName", ")", ";", "const", "record", "=", "fileList", ".", "find", "(", "e", "=>", "e", ".", "path", "===", "absolutePath", ")", ";", "if", "(", "!", "record", ")", "{", "return", "'0'", ";", "}", "return", "record", ".", "version", ".", "toString", "(", ")", ";", "}", ",", "getScriptSnapshot", "(", "fileNameShort", ")", "{", "const", "fileName", "=", "resolve", "(", "OUTPUT_DIR", ",", "fileNameShort", ")", ";", "if", "(", "!", "existsSync", "(", "fileName", ")", ")", "{", "return", "undefined", ";", "}", "const", "rawContent", "=", "readFileSync", "(", "fileName", ",", "'utf8'", ")", ";", "if", "(", "fileNameShort", ".", "includes", "(", "'/lib.'", ")", ")", "return", "ts", ".", "ScriptSnapshot", ".", "fromString", "(", "rawContent", ")", ";", "const", "content", "=", "[", "`/// <reference path=\"../../../../../node_modules/@types/jest/index.d.ts\" />`", ",", "rawContent", ".", "replace", "(", "/\\@ts\\-expect\\-error/gm", ",", "''", ")", ",", "]", ".", "join", "(", "`\\n`", ")", ";", "return", "ts", ".", "ScriptSnapshot", ".", "fromString", "(", "content", ")", ";", "}", ",", "getCurrentDirectory", ":", "(", ")", "=>", "OUTPUT_DIR", ",", "getCompilationSettings", ":", "(", ")", "=>", "tsConfig", ",", "getDefaultLibFileName", "(", "options", ")", "{", "return", "ts", ".", "getDefaultLibFilePath", "(", "options", ")", ";", "}", ",", "fileExists", "(", "path", ")", "{", "if", "(", "path", "===", "JEST_TYPES_FILE", "||", "path", "===", "EFFECTOR_PACKAGE", ")", "return", "true", ";", "if", "(", "fileList", ".", "some", "(", "e", "=>", "e", ".", "path", "===", "path", ")", ")", "return", "true", ";", "if", "(", "path", ".", "includes", "(", "'node_modules'", ")", "||", "path", ".", "includes", "(", "'package.json'", ")", ")", "return", "false", ";", "return", "ts", ".", "sys", ".", "fileExists", "(", "path", ")", ";", "}", ",", "readFile", "(", "path", ",", "encoding", ")", "{", "if", "(", "path", "===", "JEST_TYPES_FILE", ")", "return", "jestTypes", ";", "const", "result", "=", "ts", ".", "sys", ".", "readFile", "(", "path", ",", "encoding", ")", ";", "return", "result", ";", "}", ",", "readDirectory", "(", "path", ",", "extension", ",", "exclude", ",", "include", ",", "depth", ")", "{", "console", ".", "log", "(", "'readDirectory'", ",", "{", "path", ",", "extension", ",", "exclude", ",", "include", ",", "depth", "}", ")", ";", "return", "ts", ".", "sys", ".", "readDirectory", "(", "path", ",", "extension", ",", "exclude", ",", "include", ",", "depth", ")", ";", "}", ",", "directoryExists", "(", "name", ")", "{", "if", "(", "name", "===", "JEST_TYPES_DIR", ")", "return", "true", ";", "if", "(", "name", ".", "includes", "(", "'node_modules'", ")", ")", "return", "false", ";", "return", "ts", ".", "sys", ".", "directoryExists", "(", "name", ")", ";", "}", ",", "getDirectories", "(", "path", ")", "{", "console", ".", "log", "(", "'getDirectories'", ",", "path", ")", ";", "return", "ts", ".", "sys", ".", "getDirectories", "(", "path", ")", ";", "}", ",", "}", ";", "const", "services", "=", "ts", ".", "createLanguageService", "(", "servicesHost", ",", "ts", ".", "createDocumentRegistry", "(", ")", ")", ";", "rootFileNames", ".", "forEach", "(", "fileNameShort", "=>", "{", "const", "fileName", "=", "resolve", "(", "OUTPUT_DIR", ",", "fileNameShort", ")", ";", "logErrors", "(", "fileName", ",", "fileNameShort", ")", ";", "if", "(", "WATCH_CHANGES", ")", "{", "watchFile", "(", "fileName", ",", "{", "persistent", ":", "true", ",", "interval", ":", "250", "}", ",", "(", "curr", ",", "prev", ")", "=>", "{", "if", "(", "+", "curr", ".", "mtime", "<=", "+", "prev", ".", "mtime", ")", "{", "return", ";", "}", "const", "item", "=", "fileList", ".", "find", "(", "e", "=>", "e", ".", "path", "===", "fileName", ")", "!", ";", "try", "{", "item", ".", "version", "++", ";", "}", "catch", "(", "err", ")", "{", "console", ".", "error", "(", "err", ")", ";", "}", "logErrors", "(", "fileName", ",", "fileNameShort", ")", ";", "}", ")", ";", "}", "}", ")", ";", "function", "logErrors", "(", "fileName", ",", "fileNameShort", ")", "{", "const", "allDiagnostics", "=", "services", ".", "getCompilerOptionsDiagnostics", "(", ")", ".", "concat", "(", "services", ".", "getSyntacticDiagnostics", "(", "fileName", ")", ")", ".", "concat", "(", "services", ".", "getSemanticDiagnostics", "(", "fileName", ")", ")", ";", "allDiagnostics", ".", "forEach", "(", "diagnostic", "=>", "{", "const", "message", "=", "ts", ".", "flattenDiagnosticMessageText", "(", "diagnostic", ".", "messageText", ",", "'\\n'", ")", ";", "if", "(", "message", ".", "includes", "(", "`Unused '@ts-expect-error' directive.`", ")", ")", "return", ";", "if", "(", "message", ".", "includes", "(", "`implicitly has an 'any' type`", ")", ")", "return", ";", "if", "(", "diagnostic", ".", "file", ")", "{", "/** added lines for library reference */", "const", "CHANGED_FILE_OFFSET", "=", "1", ";", "const", "{", "line", ",", "character", ",", "}", "=", "diagnostic", ".", "file", ".", "getLineAndCharacterOfPosition", "(", "diagnostic", ".", "start", "!", ")", ";", "console", ".", "log", "(", "`TS${", "diagnostic", ".", "code", "} ${", "diagnostic", ".", "file", ".", "fileName", "} (${", "line", "+", "1", "-", "CHANGED_FILE_OFFSET", "},${", "character", "+", "1", "}): ${", "message", "}`", ")", ";", "}", "else", "{", "console", ".", "log", "(", "`TS${", "diagnostic", ".", "code", "} ${", "message", "}`", ")", ";", "}", "}", ")", ";", "if", "(", "allDiagnostics", ".", "length", "===", "0", ")", "{", "console", ".", "log", "(", "`no errors in file ${", "fileNameShort", "}`", ")", ";", "}", "}", "}", "const", "currentDirectoryFiles", "=", "readdirSync", "(", "OUTPUT_DIR", ")", ".", "filter", "(", "fileName", "=>", "fileName", ".", "length", ">=", "3", "&&", "fileName", ".", "substr", "(", "fileName", ".", "length", "-", "3", ",", "3", ")", "===", "'.ts'", ")", ";", "console", ".", "log", "(", "'currentDirectoryFiles'", ",", "currentDirectoryFiles", ")", ";", "const", "fileList", "=", "currentDirectoryFiles", ".", "map", "(", "fileNameShort", "=>", "{", "const", "fileName", "=", "resolve", "(", "OUTPUT_DIR", ",", "fileNameShort", ")", ";", "return", "{", "file", ":", "fileNameShort", ",", "path", ":", "fileName", ",", "version", ":", "0", ",", "}", ";", "}", ")", ";", "fileList", ".", "push", "(", "{", "file", ":", "'effector'", ",", "path", ":", "EFFECTOR_TYPES", ",", "version", ":", "0", ",", "}", ")", ";", "watch", "(", "currentDirectoryFiles", ")", ";", "}", "watchVirtual", "(", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, 8, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, 46482, null, null, 2, null, null, null, null, 1843, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, 2, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4078, null, 2, null, null, null, 8, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, 46482, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 975, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 235, null, 235, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, 2, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 155, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46483, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, 4, null, 5, null, null, null, 13361, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, 2, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4078, null, 2, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 975, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1843, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 235, null, 235, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, 2, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 155, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, 2, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
640
[ "import", "{", "suiteGenerator", "}", "from", "'../generateCases'", ";", "import", "{", "computeFn", ",", "union", ",", "value", ",", "separate", ",", "flag", ",", "config", ",", "bool", ",", "}", "from", "'../operators'", ";", "describe", "(", "'flag'", ",", "(", ")", "=>", "{", "test", "(", "'basic case'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "flag", "(", "{", "name", ":", "'feature'", ",", "}", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", "as", "const", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "true", "}", ",", "bBranch", ":", "{", "feature", ":", "false", "}", ",", "}", "as", "const", ",", "}", ",", "cases", ":", "{", "events", ":", "value", "(", "'events only'", ")", ",", "noClock", ":", "{", "aBranch", ":", "value", "(", "'no a clock'", ")", ",", "bBranch", ":", "value", "(", "'no b clock'", ")", ",", "}", ",", "sourceStore", ":", "value", "(", "'source store'", ")", ",", "rest", ":", "{", "aBranch", ":", "value", "(", "'rest a'", ")", ",", "bBranch", ":", "value", "(", "'rest b'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | false | rest b | \n | event | store | true | rest a | \n | event | event | false | events only | \n | event | event | true | events only | \n | event | none | false | no b clock | \n | event | none | true | no a clock | \n | store | store | false | source store | \n | store | store | true | source store | \n | store | event | false | source store | \n | store | event | true | source store | \n | store | none | false | no b clock | \n | store | none | true | no a clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'avoid'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "featureA", "=", "flag", "(", "{", "name", ":", "'featureA'", ",", "}", ")", ";", "const", "featureB", "=", "flag", "(", "{", "name", ":", "'featureB'", ",", "avoid", ":", "[", "featureA", "]", ",", "}", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "featureA", ",", "featureB", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "featureA", ":", "true", "}", ",", "bBranch", ":", "{", "featureB", ":", "true", "}", ",", "none", ":", "{", "featureA", ":", "false", ",", "featureB", ":", "false", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "events", ":", "value", "(", "'events only'", ")", ",", "noClock", ":", "{", "aBranch", ":", "value", "(", "'no a clock'", ")", ",", "bBranch", ":", "value", "(", "'no b clock'", ")", ",", "none", ":", "value", "(", "'no a|b none'", ")", ",", "}", ",", "sourceStore", ":", "value", "(", "'source store'", ")", ",", "rest", ":", "{", "aBranch", ":", "value", "(", "'rest a'", ")", ",", "bBranch", ":", "value", "(", "'rest b'", ")", ",", "none", ":", "value", "(", "'rest none'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "featureA", ",", "featureB", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "featureA", ",", "featureB", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n\"\n## pass\n* source * clock * featureA * featureB * tag * \n| event | store | false | false | rest none | \n| event | store | false | true | rest b | \n| event | store | true | false | rest a | \n| event | store | true | true | rest a | \n| event | event | false | false | events only | \n| event | event | false | true | events only | \n| event | event | true | false | events only | \n| event | event | true | true | events only | \n| event | none | false | false | no a|b none | \n| event | none | false | true | no b clock | \n| event | none | true | false | no a clock | \n| event | none | true | true | no a clock | \n| store | store | false | false | source store | \n| store | store | false | true | source store | \n| store | store | true | false | source store | \n| store | store | true | true | source store | \n| store | event | false | false | source store | \n| store | event | false | true | source store | \n| store | event | true | false | source store | \n| store | event | true | true | source store | \n| store | none | false | false | no a|b none | \n| store | none | false | true | no b clock | \n| store | none | true | false | no a clock | \n| store | none | true | true | no a clock | \n\"\n`", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'bool'", ",", "(", ")", "=>", "{", "test", "(", "'basic case'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'union'", ")", ";", "const", "tag", "=", "bool", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", "}", ",", "true", ":", "{", "source", ":", "'a'", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * union * tag * \n | a | true | \n | b | false | \n | c | false | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'array support'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'union'", ")", ";", "const", "tag", "=", "bool", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", "}", ",", "true", ":", "[", "{", "source", ":", "'a'", "}", ",", "{", "source", ":", "'b'", "}", "]", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * union * tag * \n | a | true | \n | b | true | \n | c | false | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'non-exhaustive'", ",", "(", ")", "=>", "{", "expect", "(", "(", ")", "=>", "{", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'source'", ")", ";", "const", "pass", "=", "bool", "(", "{", "name", ":", "'pass'", ",", "source", ":", "{", "source", "}", ",", "true", ":", "{", "source", ":", "'a'", "}", ",", "false", ":", "{", "source", ":", "'b'", "}", ",", "}", ")", ";", "const", "failed", "=", "computeFn", "(", "{", "source", ":", "{", "pass", "}", ",", "name", ":", "'failed'", ",", "fn", ":", "(", "{", "pass", "}", ")", "=>", "!", "pass", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "failed", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ",", "createTestLines", ":", "{", "method", ":", "'method'", ",", "shape", ":", "{", "source", "}", ",", "addExpectError", ":", "failed", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "}", ")", ".", "toThrowErrorMatchingInlineSnapshot", "(", "`\"either true or false should be defined but not both\"`", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3582, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
641
[ "import", "{", "suiteGenerator", "}", "from", "'../generateCases'", ";", "import", "{", "union", ",", "value", ",", "computeVariants", ",", "config", "}", "from", "'../operators'", ";", "test", "(", "'basic case'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "computeVariants", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "bBranch", ":", "{", "feature", ":", "'b'", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "{", "aBranch", ":", "'no a clock'", ",", "bBranch", ":", "'no b clock'", ",", "}", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "{", "aBranch", ":", "'rest a'", ",", "bBranch", ":", "'rest b'", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | none | a | no a clock | \n | event | none | b | no b clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | none | a | no a clock | \n | store | none | b | no b clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unused match group'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "computeVariants", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "bBranch", ":", "{", "feature", ":", "'b'", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "'no clock'", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "'rest'", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest | \n | event | store | b | rest | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | none | a | no clock | \n | event | none | b | no clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | none | a | no clock | \n | store | none | b | no clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unused match'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "computeVariants", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "bBranch", ":", "{", "feature", ":", "'b'", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "{", "aBranch", ":", "'no a clock'", ",", "bBranch", ":", "'no b clock'", ",", "}", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "{", "aBranch", ":", "'rest a'", ",", "bBranch", ":", "'rest b'", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b | \n | event | store | c | | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | event | c | events only | \n | event | none | a | no a clock | \n | event | none | b | no b clock | \n | event | none | c | | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | store | c | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | event | c | source store | \n | store | none | a | no a clock | \n | store | none | b | no b clock | \n | store | none | c | source store | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'rest match'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "computeVariants", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "restBranch", ":", "{", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "{", "aBranch", ":", "'no a clock'", ",", "restBranch", ":", "'no b|c clock'", ",", "}", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "{", "aBranch", ":", "'rest a'", ",", "restBranch", ":", "'rest b|c'", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b|c | \n | event | store | c | rest b|c | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | event | c | events only | \n | event | none | a | no a clock | \n | event | none | b | no b|c clock | \n | event | none | c | no b|c clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | store | c | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | event | c | source store | \n | store | none | a | no a clock | \n | store | none | b | no b|c clock | \n | store | none | c | no b|c clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'array match'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "computeVariants", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "restBranch", ":", "[", "{", "feature", ":", "'b'", "}", ",", "{", "feature", ":", "'c'", "}", "]", ",", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "{", "aBranch", ":", "'no a clock'", ",", "restBranch", ":", "'no b|c clock'", ",", "}", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "{", "aBranch", ":", "'rest a'", ",", "restBranch", ":", "'rest b|c'", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b|c | \n | event | store | c | rest b|c | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | event | c | events only | \n | event | none | a | no a clock | \n | event | none | b | no b|c clock | \n | event | none | c | no b|c clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | store | c | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | event | c | source store | \n | store | none | a | no a clock | \n | store | none | b | no b|c clock | \n | store | none | c | no b|c clock | \n \"\n `", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
642
[ "import", "{", "suiteGenerator", "}", "from", "'../generateCases'", ";", "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "computeVariants", ",", "separate", ",", "flag", ",", "config", ",", "bool", ",", "}", "from", "'../operators'", ";", "test", "(", "'basic case'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "bBranch", ":", "{", "feature", ":", "'b'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "events", ":", "value", "(", "'events only'", ")", ",", "noClock", ":", "{", "aBranch", ":", "value", "(", "'no a clock'", ")", ",", "bBranch", ":", "value", "(", "'no b clock'", ")", ",", "}", ",", "sourceStore", ":", "value", "(", "'source store'", ")", ",", "rest", ":", "{", "aBranch", ":", "value", "(", "'rest a'", ")", ",", "bBranch", ":", "value", "(", "'rest b'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | none | a | no a clock | \n | event | none | b | no b clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | none | a | no a clock | \n | store | none | b | no b clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unused match group'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "bBranch", ":", "{", "feature", ":", "'b'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "events", ":", "value", "(", "'events only'", ")", ",", "noClock", ":", "value", "(", "'no clock'", ")", ",", "sourceStore", ":", "value", "(", "'source store'", ")", ",", "rest", ":", "value", "(", "'rest'", ")", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest | \n | event | store | b | rest | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | none | a | no clock | \n | event | none | b | no clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | none | a | no clock | \n | store | none | b | no clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'unused match'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "bBranch", ":", "{", "feature", ":", "'b'", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "events", ":", "value", "(", "'events only'", ")", ",", "noClock", ":", "{", "aBranch", ":", "value", "(", "'no a clock'", ")", ",", "bBranch", ":", "value", "(", "'no b clock'", ")", ",", "}", ",", "sourceStore", ":", "value", "(", "'source store'", ")", ",", "rest", ":", "{", "aBranch", ":", "value", "(", "'rest a'", ")", ",", "bBranch", ":", "value", "(", "'rest b'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b | \n | event | store | c | | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | event | c | events only | \n | event | none | a | no a clock | \n | event | none | b | no b clock | \n | event | none | c | | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | store | c | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | event | c | source store | \n | store | none | a | no a clock | \n | store | none | b | no b clock | \n | store | none | c | source store | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'rest match'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "restBranch", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "events", ":", "value", "(", "'events only'", ")", ",", "noClock", ":", "{", "aBranch", ":", "value", "(", "'no a clock'", ")", ",", "restBranch", ":", "value", "(", "'no b|c clock'", ")", ",", "}", ",", "sourceStore", ":", "value", "(", "'source store'", ")", ",", "rest", ":", "{", "aBranch", ":", "value", "(", "'rest a'", ")", ",", "restBranch", ":", "value", "(", "'rest b|c'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b|c | \n | event | store | c | rest b|c | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | event | c | events only | \n | event | none | a | no a clock | \n | event | none | b | no b|c clock | \n | event | none | c | no b|c clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | store | c | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | event | c | source store | \n | store | none | a | no a clock | \n | store | none | b | no b|c clock | \n | store | none | c | no b|c clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'array match'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "feature", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'feature'", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", ",", "feature", "}", ",", "variant", ":", "{", "base", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", "as", "const", ",", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "'a'", "}", ",", "restBranch", ":", "[", "{", "feature", ":", "'b'", "}", ",", "{", "feature", ":", "'c'", "}", "]", ",", "}", "as", "const", ",", "}", ",", "cases", ":", "{", "events", ":", "value", "(", "'events only'", ")", ",", "noClock", ":", "{", "aBranch", ":", "value", "(", "'no a clock'", ")", ",", "restBranch", ":", "value", "(", "'no b|c clock'", ")", ",", "}", ",", "sourceStore", ":", "value", "(", "'source store'", ")", ",", "rest", ":", "{", "aBranch", ":", "value", "(", "'rest a'", ")", ",", "restBranch", ":", "value", "(", "'rest b|c'", ")", ",", "}", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * feature * tag * \n | event | store | a | rest a | \n | event | store | b | rest b|c | \n | event | store | c | rest b|c | \n | event | event | a | events only | \n | event | event | b | events only | \n | event | event | c | events only | \n | event | none | a | no a clock | \n | event | none | b | no b|c clock | \n | event | none | c | no b|c clock | \n | store | store | a | source store | \n | store | store | b | source store | \n | store | store | c | source store | \n | store | event | a | source store | \n | store | event | b | source store | \n | store | event | c | source store | \n | store | none | a | no a clock | \n | store | none | b | no b|c clock | \n | store | none | c | no b|c clock | \n \"\n `", ")", ";", "}", ")", ";", "describe", "(", "'branching'", ",", "(", ")", "=>", "{", "test", "(", "'execution of cases'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ")", ";", "const", "clock", "=", "union", "(", "[", "'A'", ",", "'B'", "]", ")", ";", "const", "feature", "=", "flag", "(", "{", "}", ")", ";", "const", "fn", "=", "computeVariant", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "hasFn", ":", "{", "source", ":", "'a'", "}", ",", "noFn", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "hasFn", ":", "'function'", ",", "noFn", ":", "null", ",", "}", ",", "}", ")", ";", "const", "tag", "=", "separate", "(", "{", "source", ":", "{", "feature", "}", ",", "variant", ":", "{", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "true", "}", ",", "none", ":", "{", "feature", ":", "false", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "aBranch", ":", "separate", "(", "{", "source", ":", "{", "clock", "}", ",", "variant", ":", "{", "_", ":", "{", "a", ":", "{", "clock", ":", "'A'", "}", ",", "b", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "a", ":", "union", "(", "[", "'a1'", ",", "'a2'", "]", ")", ",", "b", ":", "union", "(", "[", "'b1'", ",", "'b2'", "]", ")", ",", "}", ",", "}", ")", ",", "none", ":", "union", "(", "[", "'c1'", ",", "'c2'", "]", ")", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "feature", ",", "clock", ",", "tag", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "{", "source", ",", "feature", ",", "clock", ",", "tag", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * feature * clock * tag * \n | a | false | A | c1 | \n | a | false | A | c2 | \n | a | true | A | a1 | \n | a | true | A | a2 | \n | a | false | B | c1 | \n | a | false | B | c2 | \n | a | true | B | b1 | \n | a | true | B | b2 | \n | b | false | A | c1 | \n | b | false | A | c2 | \n | b | true | A | a1 | \n | b | true | A | a2 | \n | b | false | B | c1 | \n | b | false | B | c2 | \n | b | true | B | b1 | \n | b | true | B | b2 | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'case safety (cases executed only when they are choosen)'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ")", ";", "const", "fn", "=", "computeVariant", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "hasFn", ":", "{", "source", ":", "'a'", "}", ",", "noFn", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "hasFn", ":", "'fn'", ",", "noFn", ":", "null", ",", "}", ",", "}", ")", ";", "const", "tag", "=", "separate", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "byFeature", ":", "{", "hasFn", ":", "{", "source", ":", "'a'", "}", ",", "none", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "hasFn", ":", "computeFn", "(", "{", "source", ":", "{", "fn", "}", ",", "fn", ":", "(", "{", "fn", "}", ")", "=>", "fn", "!", ".", "toUpperCase", "(", ")", ",", "}", ")", ",", "none", ":", "value", "(", "null", ")", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "{", "source", ",", "fn", ",", "tag", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * fn * tag * \n | a | fn | FN | \n | b | null | null | \n \"\n `", ")", ";", "}", ")", ";", "test", ".", "skip", "(", "'source safety (source executed only when result is needed for something else)'", ",", "(", ")", "=>", "{", "const", "jestFn", "=", "jest", ".", "fn", "(", "(", "{", "fn", "}", ")", "=>", "fn", "!", ".", "toUpperCase", "(", ")", ")", ";", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ")", ";", "const", "fn", "=", "computeVariant", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "hasFn", ":", "{", "source", ":", "'a'", "}", ",", "noFn", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "hasFn", ":", "'fn'", ",", "noFn", ":", "null", ",", "}", ",", "}", ")", ";", "const", "tag", "=", "separate", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "byFeature", ":", "{", "hasFn", ":", "{", "source", ":", "'a'", "}", ",", "none", ":", "{", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "hasFn", ":", "computeFn", "(", "{", "source", ":", "{", "uppercased", ":", "computeFn", "(", "{", "source", ":", "{", "fn", "}", ",", "fn", ":", "jestFn", ",", "}", ")", ",", "}", ",", "fn", ":", "(", "{", "uppercased", "}", ")", "=>", "uppercased", ",", "}", ")", ",", "none", ":", "value", "(", "null", ")", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "{", "source", ",", "fn", ",", "tag", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "jestFn", ".", "mock", ".", "results", ".", "map", "(", "(", "{", "type", "}", ")", "=>", "type", ")", ")", ".", "not", ".", "toContain", "(", "'throw'", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 58, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
643
[ "import", "{", "printArray", "}", "from", "'../../text'", ";", "import", "{", "suiteGenerator", "}", "from", "'../generateCases'", ";", "import", "{", "computeFn", ",", "union", ",", "value", ",", "computeVariant", ",", "computeVariants", ",", "separate", ",", "flag", ",", "config", ",", "bool", ",", "permute", ",", "}", "from", "'../operators'", ";", "test", "(", "'it works'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", ",", "'combinable'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'none'", ",", "'event'", ",", "'store'", ",", "'tuple'", "]", ",", "'clock'", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", "]", ",", "describeGroup", ":", "source", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "method", ":", "'method'", ",", "shape", ":", "{", "src", ":", "source", ",", "clk", ":", "clock", ",", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"test('event (should pass)', () => {\n //prettier-ignore\n {\n method({src:event, clk:none })\n method({src:event, clk:event})\n method({src:event, clk:store})\n method({src:event, clk:tuple})\n }\n expect(typecheck).toMatchInlineSnapshot()\n })\n test('store (should pass)', () => {\n //prettier-ignore\n {\n method({src:store, clk:none })\n method({src:store, clk:event})\n method({src:store, clk:store})\n method({src:store, clk:tuple})\n }\n expect(typecheck).toMatchInlineSnapshot()\n })\n test('combinable (should pass)', () => {\n //prettier-ignore\n {\n method({src:combinable, clk:none })\n method({src:combinable, clk:event})\n method({src:combinable, clk:store})\n method({src:combinable, clk:tuple})\n }\n expect(typecheck).toMatchInlineSnapshot()\n })\"\n `", ")", ";", "}", ")", ";", "describe", "(", "'group'", ",", "(", ")", "=>", "{", "test", "(", "'group by union value'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", ",", "'combinable'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'none'", ",", "'event'", ",", "'store'", ",", "'tuple'", "]", ",", "'clock'", ")", ";", "const", "pass", "=", "value", "(", "true", ",", "'pass'", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ",", "createTestLines", ":", "{", "method", ":", "'method'", ",", "shape", ":", "{", "src", ":", "source", ",", "clk", ":", "clock", ",", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"test(' (should pass)', () => {\n //prettier-ignore\n {\n method({src:event , clk:none })\n method({src:event , clk:event})\n method({src:event , clk:store})\n method({src:event , clk:tuple})\n method({src:store , clk:none })\n method({src:store , clk:event})\n method({src:store , clk:store})\n method({src:store , clk:tuple})\n method({src:combinable, clk:none })\n method({src:combinable, clk:event})\n method({src:combinable, clk:store})\n method({src:combinable, clk:tuple})\n }\n expect(typecheck).toMatchInlineSnapshot()\n })\"\n `", ")", ";", "}", ")", ";", "describe", "(", "'pass'", ",", "(", ")", "=>", "{", "test", "(", "'pass by union value'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'none'", ",", "'event'", "]", ",", "'clock'", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", "]", ",", "describeGroup", ":", "source", ",", "pass", ":", "computeFn", "(", "{", "name", ":", "'pass'", ",", "source", ":", "{", "source", "}", ",", "fn", ":", "(", "{", "source", "}", ")", "=>", "source", "===", "'event'", ",", "}", ")", ",", "createTestLines", ":", "{", "method", ":", "'method'", ",", "shape", ":", "{", "src", ":", "source", ",", "clk", ":", "clock", ",", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"test('event (should pass)', () => {\n //prettier-ignore\n {\n method({src:event, clk:none })\n method({src:event, clk:event})\n }\n expect(typecheck).toMatchInlineSnapshot()\n })\n test('store (should fail)', () => {\n //prettier-ignore\n {\n //@ts-expect-error\n method({src:store, clk:none })\n //@ts-expect-error\n method({src:store, clk:event})\n }\n expect(typecheck).toMatchInlineSnapshot()\n })\"\n `", ")", ";", "}", ")", ";", "test", "(", "'edge case when pass field split groups'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'none'", ",", "'event'", "]", ",", "'clock'", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", "]", ",", "describeGroup", ":", "source", ",", "pass", ":", "computeFn", "(", "{", "name", ":", "'pass'", ",", "source", ":", "{", "clock", "}", ",", "fn", ":", "(", "{", "clock", "}", ")", "=>", "clock", "===", "'event'", ",", "}", ")", ",", "createTestLines", ":", "{", "method", ":", "'method'", ",", "shape", ":", "{", "src", ":", "source", ",", "clk", ":", "clock", ",", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"describe('event', () => {\n test('event (should pass)', () => {\n //prettier-ignore\n method({src:event, clk:event})\n expect(typecheck).toMatchInlineSnapshot()\n })\n test('event (should fail)', () => {\n //prettier-ignore\n //@ts-expect-error\n method({src:event, clk:none})\n expect(typecheck).toMatchInlineSnapshot()\n })\n })\n describe('store', () => {\n test('store (should pass)', () => {\n //prettier-ignore\n method({src:store, clk:event})\n expect(typecheck).toMatchInlineSnapshot()\n })\n test('store (should fail)', () => {\n //prettier-ignore\n //@ts-expect-error\n method({src:store, clk:none})\n expect(typecheck).toMatchInlineSnapshot()\n })\n })\"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'config'", ",", "(", ")", "=>", "{", "it", "(", "'throw error when config is not called'", ",", "(", ")", "=>", "{", "expect", "(", "(", ")", "=>", "{", "suiteGenerator", "(", "(", ")", "=>", "{", "union", "(", "[", "'event'", ",", "'store'", ",", "'combinable'", "]", ",", "'source'", ")", ";", "}", ")", ";", "}", ")", ".", "toThrowErrorMatchingInlineSnapshot", "(", "`\"no config() used\"`", ")", ";", "}", ")", ";", "it", "(", "'throw error when required fields are missed'", ",", "(", ")", "=>", "{", "expect", "(", "(", ")", "=>", "{", "suiteGenerator", "(", "(", ")", "=>", "{", "union", "(", "[", "'event'", ",", "'store'", ",", "'combinable'", "]", ",", "'source'", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "(", ")", "=>", "''", "}", ",", "}", ")", ";", "}", ")", ";", "}", ")", ".", "toThrowErrorMatchingInlineSnapshot", "(", "`\n \"required config items are missed:\n grouping.describeGroup\n grouping.createTestLines\"\n `", ")", ";", "}", ")", ";", "describe", "(", "'getHash'", ",", "(", ")", "=>", "{", "test", "(", "'function'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "tag", "=", "computeVariant", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", "}", ",", "variant", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "'no clock'", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "'rest'", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * tag * \n | event | store | rest | \n | event | event | events only | \n | event | none | no clock | \n | store | store | source store | \n | store | event | source store | \n | store | none | no clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'silent hash clash'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "tag", "=", "computeVariant", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", "}", ",", "variant", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "'no clock'", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "'rest'", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * tag * \n | event | store | rest | \n | event | event | events only | \n | event | none | no clock | \n | store | store | source store | \n | store | event | source store | \n | store | none | no clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'real hash clash'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "tag", "=", "computeVariant", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", "}", ",", "variant", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "'no clock'", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "'rest'", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", "]", ",", "describeGroup", ":", "source", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## event (pass)\n * source * clock * tag * \n | event | store | rest | \n | event | event | events only | \n | event | none | no clock | \n\n ## store (pass)\n * source * clock * tag * \n | store | store | source store | \n | store | event | source store | \n | store | none | no clock | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'real hash/describeGroup clash'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "tag", "=", "computeVariant", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", "}", ",", "variant", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "'no clock'", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "'rest'", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", "]", ",", "describeGroup", ":", "clock", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## none (pass)\n * source * clock * tag * \n | event | store | rest | \n | event | event | events only | \n | event | none | no clock | \n | store | store | source store | \n | store | event | source store | \n | store | none | no clock | \n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'computeVariant'", ",", "(", ")", "=>", "{", "test", "(", "'basic case'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'event'", ",", "'store'", "]", ",", "'source'", ")", ";", "const", "clock", "=", "union", "(", "[", "'store'", ",", "'event'", ",", "'none '", "]", ",", "'clock'", ")", ";", "const", "tag", "=", "computeVariant", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "source", ",", "clock", "}", ",", "variant", ":", "{", "events", ":", "{", "source", ":", "'event'", ",", "clock", ":", "'event'", "}", ",", "noClock", ":", "{", "clock", ":", "'none '", "}", ",", "sourceStore", ":", "{", "source", ":", "'store'", "}", ",", "rest", ":", "{", "}", ",", "}", ",", "cases", ":", "{", "events", ":", "'events only'", ",", "noClock", ":", "'no clock'", ",", "sourceStore", ":", "'source store'", ",", "rest", ":", "'rest'", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "clock", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "clock", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * clock * tag * \n | event | store | rest | \n | event | event | events only | \n | event | none | no clock | \n | store | store | source store | \n | store | event | source store | \n | store | none | no clock | \n \"\n `", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'name usage'", ",", "(", ")", "=>", "{", "test", "(", "'inline operator with name'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ",", "'source'", ")", ";", "const", "feature", "=", "flag", "(", "{", "name", ":", "'feature'", ",", "}", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "feature", "}", ",", "variant", ":", "{", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "true", "}", ",", "none", ":", "{", "feature", ":", "false", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "aBranch", ":", "value", "(", "'-'", ")", ",", "none", ":", "union", "(", "[", "'A'", ",", "'B'", "]", ",", "'clock'", ")", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * feature * tag * \n | a | false | A | \n | a | false | B | \n | a | false | A | \n | a | false | B | \n | a | true | - | \n | a | true | - | \n | b | false | A | \n | b | false | B | \n | b | false | A | \n | b | false | B | \n | b | true | - | \n | b | true | - | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'inline operator without name'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", "]", ",", "'source'", ")", ";", "const", "feature", "=", "flag", "(", "{", "name", ":", "'feature'", ",", "}", ")", ";", "const", "tag", "=", "separate", "(", "{", "name", ":", "'tag'", ",", "source", ":", "{", "feature", "}", ",", "variant", ":", "{", "byFeature", ":", "{", "aBranch", ":", "{", "feature", ":", "true", "}", ",", "none", ":", "{", "feature", ":", "false", "}", ",", "}", ",", "}", "as", "const", ",", "cases", ":", "{", "aBranch", ":", "value", "(", "'-'", ")", ",", "none", ":", "union", "(", "[", "'A'", ",", "'B'", "]", ")", ",", "}", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "feature", ",", "tag", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n \"\n ## pass\n * source * feature * tag * \n | a | false | A | \n | a | false | B | \n | a | true | - | \n | b | false | A | \n | b | false | B | \n | b | true | - | \n \"\n `", ")", ";", "}", ")", ";", "test", "(", "'flag edge case'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "union", "(", "[", "'a'", ",", "'b'", ",", "'c'", "]", ",", "'source'", ")", ";", "const", "feature", "=", "flag", "(", "{", "name", ":", "'feature'", ",", "needs", ":", "[", "computeVariants", "(", "{", "source", ":", "{", "source", "}", ",", "variant", ":", "{", "src", ":", "{", "a", ":", "{", "source", ":", "'a'", "}", ",", "b", ":", "{", "source", ":", "'b'", "}", ",", "}", ",", "}", ",", "cases", ":", "{", "a", ":", "false", ",", "b", ":", "true", ",", "}", ",", "}", ")", ",", "]", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "source", ",", "feature", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "[", "source", ",", "feature", "]", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n\"\n## pass\n* source * feature * \n| a | false | \n| b | false | \n| b | true | \n| c | false | \n\"\n`", ")", ";", "}", ")", ";", "}", ")", ";", "describe", "(", "'permute'", ",", "(", ")", "=>", "{", "test", "(", "'basic case'", ",", "(", ")", "=>", "{", "const", "suite", "=", "suiteGenerator", "(", "(", ")", "=>", "{", "const", "source", "=", "permute", "(", "{", "items", ":", "[", "'a'", ",", "'b'", ",", "'c'", ",", "'d'", "]", ",", "noReorder", ":", "true", ",", "amount", ":", "{", "min", ":", "1", ",", "max", ":", "2", "}", ",", "}", ")", ";", "const", "result", "=", "computeFn", "(", "{", "source", ":", "{", "source", "}", ",", "fn", ":", "(", "{", "source", "}", ")", "=>", "printArray", "(", "source", ")", ",", "}", ")", ";", "config", "(", "{", "grouping", ":", "{", "getHash", ":", "[", "result", "]", ",", "describeGroup", ":", "value", "(", "''", ")", ",", "pass", ":", "value", "(", "true", ")", ",", "createTestLines", ":", "{", "type", ":", "'table'", ",", "fields", ":", "{", "result", "}", ",", "}", ",", "}", ",", "}", ")", ";", "}", ")", ";", "expect", "(", "suite", ")", ".", "toMatchInlineSnapshot", "(", "`\n\"\n## pass\n* result * \n| [a] | \n| [b] | \n| [c] | \n| [d] | \n| [a,b] | \n| [a,c] | \n| [a,d] | \n| [b,d] | \n| [c,b] | \n| [c,d] | \n| [d,b] | \n\"\n`", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 147, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1955, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 11240, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 569, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
644
[ "export", "function", "deepEqual", "(", "x", ",", "y", ")", "{", "if", "(", "x", "===", "y", ")", "{", "return", "true", ";", "}", "else", "if", "(", "typeof", "x", "==", "'object'", "&&", "x", "!=", "null", "&&", "typeof", "y", "==", "'object'", "&&", "y", "!=", "null", ")", "{", "if", "(", "Object", ".", "keys", "(", "x", ")", ".", "length", "!=", "Object", ".", "keys", "(", "y", ")", ".", "length", ")", "return", "false", ";", "for", "(", "const", "prop", "in", "x", ")", "{", "if", "(", "y", ".", "hasOwnProperty", "(", "prop", ")", ")", "{", "if", "(", "!", "deepEqual", "(", "x", "[", "prop", "]", ",", "y", "[", "prop", "]", ")", ")", "return", "false", ";", "}", "else", "return", "false", ";", "}", "return", "true", ";", "}", "else", "return", "false", ";", "}" ]
[ null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
645
[ "import", "{", "is", ",", "Store", ",", "forward", ",", "restore", ",", "clearNode", ",", "withRegion", ",", "createEvent", ",", "}", "from", "'effector'", ";", "import", "{", "Plugin", ",", "ComponentOptions", ",", "shallowRef", ",", "watch", ",", "WatchCallback", ",", "WatchOptions", ",", "}", "from", "'vue-next'", ";", "import", "{", "unwrapProxy", "}", "from", "'./lib/unwrapProxy'", ";", "import", "{", "deepEqual", "}", "from", "'./lib/deepEqual'", ";", "import", "{", "deepCopy", "}", "from", "'./lib/deepCopy'", ";", "type", "Body", "=", "{", "vModel", ":", "boolean", ";", "value", ":", "Store", "<", "any", ">", ";", "}", ";", "const", "mixin", "=", "{", "data", "(", ")", "{", "let", "shape", "=", "this", ".", "$options", ".", "effector", ";", "if", "(", "!", "shape", ")", "return", "{", "}", ";", "if", "(", "typeof", "shape", "!==", "'function'", ")", "{", "throw", "Error", "(", "'[effector] option should be a function'", ")", ";", "}", "shape", "=", "shape", ".", "call", "(", "this", ")", ";", "if", "(", "typeof", "shape", "!==", "'object'", ")", "{", "throw", "Error", "(", "'Returned value should be an object'", ")", ";", "}", "this", ".", "__clear", "=", "createEvent", "(", ")", ";", "const", "config", "=", "{", "}", ";", "const", "state", "=", "{", "}", ";", "withRegion", "(", "this", ".", "__clear", ",", "(", ")", "=>", "{", "for", "(", "const", "key", "in", "shape", ")", "{", "const", "value", "=", "shape", "[", "key", "]", ";", "const", "watchOptions", "=", "{", "deep", ":", "true", ",", "immediate", ":", "false", "}", ";", "let", "watchCallback", ";", "let", "nextID", "=", "0", ";", "let", "fromEvent", "=", "false", ";", "let", "isSelfUpdate", "=", "false", ";", "if", "(", "is", ".", "store", "(", "value", ")", ")", "{", "config", "[", "key", "]", "=", "{", "value", ",", "vModel", ":", "false", ",", "}", ";", "}", "else", "if", "(", "is", ".", "event", "(", "value", ")", "||", "is", ".", "effect", "(", "value", ")", ")", "{", "config", "[", "key", "]", "=", "{", "value", ":", "restore", "(", "value", ".", "map", "(", "(", ")", "=>", "++", "nextID", ")", ",", "null", ")", ",", "vModel", ":", "false", ",", "}", ";", "}", "else", "{", "if", "(", "!", "is", ".", "store", "(", "value", ".", "value", ")", ")", "{", "throw", "Error", "(", "`Effector property ${", "key", "}.value should be Store`", ")", ";", "}", "config", "[", "key", "]", "=", "value", ";", "}", "state", "[", "key", "]", "=", "shallowRef", "(", "config", "[", "key", "]", ".", "value", ".", "getState", "(", ")", ")", ";", "config", "[", "key", "]", ".", "value", ".", "updates", ".", "watch", "(", "(", "payload", ")", "=>", "{", "if", "(", "isSelfUpdate", ")", "{", "return", ";", "}", "fromEvent", "=", "true", ";", "state", "[", "key", "]", ".", "value", "=", "shallowRef", "(", "payload", ")", ".", "value", ";", "}", ")", ";", "if", "(", "!", "config", "[", "key", "]", ".", "vModel", ")", "{", "let", "temp", "=", "null", ";", "watchCallback", "=", "(", "newValue", ",", "oldValue", ")", "=>", "{", "if", "(", "!", "fromEvent", ")", "{", "const", "isEqual", "=", "deepEqual", "(", "newValue", ",", "temp", ")", ";", "if", "(", "isEqual", ")", "{", "temp", "=", "null", ";", "return", ";", "}", "console", ".", "error", "(", "`[${", "key", "}] is immutable value. You must update this value via effector events`", ")", ";", "temp", "=", "deepCopy", "(", "oldValue", ")", ";", "state", "[", "key", "]", ".", "value", "=", "deepCopy", "(", "oldValue", ")", ";", "}", "fromEvent", "=", "false", ";", "}", ";", "}", "else", "{", "const", "updated", "=", "createEvent", "<", "unknown", ">", "(", ")", ";", "forward", "(", "{", "from", ":", "updated", ",", "to", ":", "value", ".", "value", "}", ")", ";", "watchCallback", "=", "value", "=>", "{", "isSelfUpdate", "=", "true", ";", "if", "(", "!", "fromEvent", ")", "{", "updated", "(", "unwrapProxy", "(", "value", ")", ")", ";", "}", "fromEvent", "=", "false", ";", "isSelfUpdate", "=", "false", ";", "}", ";", "}", "watch", "(", "(", ")", "=>", "state", "[", "key", "]", ".", "value", ",", "watchCallback", ",", "watchOptions", ")", ";", "}", "}", ")", ";", "return", "state", ";", "}", ",", "beforeUnmount", "(", ")", "{", "if", "(", "this", ".", "__clear", ")", "{", "clearNode", "(", "this", ".", "__clear", ")", ";", "}", "}", ",", "}", ";", "export", "const", "VueEffector", "=", "{", "install", "(", "app", ")", "{", "app", ".", "mixin", "(", "mixin", ")", ";", "}", ",", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2756, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2155, null, null, null, null, null, null, null, null, null, null, null, null, 18791, null, null, 3, null, null, null, null, 8, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 283, null, null, 4, null, 189, null, null, null, null, null, null, null, null, null, null, null, null, null ]
646
[ "import", "{", "fork", "}", "from", "'effector'", ";", "import", "{", "mount", ",", "config", "}", "from", "\"vue-test-utils-next\"", ";", "import", "{", "getScope", "}", "from", "'../lib/get-scope'", ";", "import", "{", "VueSSRPlugin", "}", "from", "'../ssr/VueSSRPlugin'", ";", "jest", ".", "mock", "(", "'vue'", ",", "(", ")", "=>", "require", "(", "'vue-next'", ")", ")", ";", "it", "(", "'check default scope name'", ",", "(", ")", "=>", "{", "const", "scope", "=", "fork", "(", ")", ";", "config", ".", "global", ".", "plugins", "=", "[", "VueSSRPlugin", "(", "{", "scope", "}", ")", "]", ";", "const", "wrapper", "=", "mount", "(", "{", "template", ":", "`\n <div>{{scopeName}}</div>\n `", ",", "setup", "(", ")", "{", "const", "{", "scopeName", "}", "=", "getScope", "(", ")", ";", "return", "{", "scopeName", "}", ";", "}", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "scopeName", ")", ".", "toBe", "(", "\"root\"", ")", ";", "}", ")", ";", "it", "(", "'set custom scope name'", ",", "(", ")", "=>", "{", "const", "scope", "=", "fork", "(", ")", ";", "config", ".", "global", ".", "plugins", "=", "[", "VueSSRPlugin", "(", "{", "scope", ",", "scopeName", ":", "\"my-custom-scope-name\"", "}", ")", "]", ";", "const", "wrapper", "=", "mount", "(", "{", "template", ":", "`\n <div>{{scopeName}}</div>\n `", ",", "setup", "(", ")", "{", "const", "{", "scopeName", "}", "=", "getScope", "(", ")", ";", "return", "{", "scopeName", "}", ";", "}", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "scopeName", ")", ".", "toBe", "(", "\"my-custom-scope-name\"", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 145, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 145, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
647
[ "import", "{", "shallowMount", "}", "from", "'vue-test-utils-next'", ";", "import", "{", "useStore", ",", "useVModel", ",", "useGate", ",", "createGate", ",", "}", "from", "'effector-vue/composition'", ";", "import", "{", "reactive", ",", "ref", ",", "nextTick", "}", "from", "'vue-next'", ";", "import", "{", "createEvent", ",", "createStore", "}", "from", "'effector'", ";", "jest", ".", "mock", "(", "'vue'", ",", "(", ")", "=>", "require", "(", "'vue-next'", ")", ")", ";", "it", "(", "'plain gate'", ",", "async", "(", ")", "=>", "{", "const", "Gate", "=", "createGate", "(", ")", ";", "expect", "(", "Gate", ".", "status", ".", "getState", "(", ")", ")", ".", "toBeFalsy", "(", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`<div></div>`", ",", "setup", "(", ")", "{", "useGate", "(", "Gate", ")", ";", "}", ",", "}", ")", ";", "expect", "(", "Gate", ".", "status", ".", "getState", "(", ")", ")", ".", "toBeTruthy", "(", ")", ";", "wrapper", ".", "unmount", "(", ")", ";", "expect", "(", "Gate", ".", "status", ".", "getState", "(", ")", ")", ".", "toBeFalsy", "(", ")", ";", "}", ")", ";", "it", "(", "'gate with props'", ",", "(", ")", "=>", "{", "const", "Gate", "=", "createGate", "(", "{", "defaultState", ":", "{", "meet", ":", "'Hello world'", ",", "}", ",", "}", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "meet", ":", "'Hello world'", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`<div></div>`", ",", "setup", "(", ")", "{", "useGate", "(", "Gate", ",", "(", ")", "=>", "(", "{", "meet", ":", "'Hello Vue Gate'", ",", "}", ")", ")", ";", "}", ",", "}", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "meet", ":", "'Hello Vue Gate'", ",", "}", ")", ";", "wrapper", ".", "unmount", "(", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "meet", ":", "'Hello world'", ",", "}", ")", ";", "}", ")", ";", "it", "(", "'update props to gate from [ref]'", ",", "async", "(", ")", "=>", "{", "const", "Gate", "=", "createGate", "(", "{", "defaultState", ":", "{", "meet", ":", "'Hello world'", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <button @click=\"handleClick\">Click</button>\n `", ",", "setup", "(", ")", "{", "const", "meet", "=", "ref", "(", "'Hello Vue Gate'", ")", ";", "const", "handleClick", "=", "(", ")", "=>", "(", "meet", ".", "value", "=", "'Hello effector'", ")", ";", "useGate", "(", "Gate", ",", "(", ")", "=>", "(", "{", "meet", ":", "meet", ".", "value", "}", ")", ")", ";", "return", "{", "handleClick", "}", ";", "}", ",", "}", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "meet", ":", "'Hello Vue Gate'", ",", "}", ")", ";", "await", "wrapper", ".", "find", "(", "'button'", ")", ".", "trigger", "(", "'click'", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "meet", ":", "'Hello effector'", ",", "}", ")", ";", "}", ")", ";", "it", "(", "'update props to gate from [reactive]'", ",", "async", "(", ")", "=>", "{", "const", "Gate", "=", "createGate", "(", "{", "defaultState", ":", "{", "meet", ":", "'Hello world'", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <button @click=\"handleClick\">Click</button>\n `", ",", "setup", "(", ")", "{", "const", "obj", "=", "reactive", "(", "{", "meet", ":", "'Hello Vue Gate'", ",", "}", ")", ";", "const", "handleClick", "=", "(", ")", "=>", "(", "obj", ".", "meet", "=", "'Hello effector'", ")", ";", "useGate", "(", "Gate", ",", "(", ")", "=>", "obj", ")", ";", "return", "{", "handleClick", "}", ";", "}", ",", "}", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "meet", ":", "'Hello Vue Gate'", ",", "}", ")", ";", "await", "wrapper", ".", "find", "(", "'button'", ")", ".", "trigger", "(", "'click'", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "meet", ":", "'Hello effector'", ",", "}", ")", ";", "}", ")", ";", "it", "(", "'works with effector store'", ",", "async", "(", ")", "=>", "{", "const", "Gate", "=", "createGate", "(", ")", ";", "const", "$user", "=", "createStore", "(", "'John Doe'", ")", ";", "const", "updated", "=", "createEvent", "(", ")", ";", "$user", ".", "on", "(", "updated", ",", "(", ")", "=>", "'Alan Doe'", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <div>\n <button @click=\"updated\">Click</button>\n </div>\n `", ",", "setup", "(", ")", "{", "const", "user", "=", "useStore", "(", "$user", ")", ";", "useGate", "(", "Gate", ",", "(", ")", "=>", "user", ")", ";", "return", "{", "updated", ",", "}", ";", "}", ",", "}", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toBe", "(", "'John Doe'", ")", ";", "await", "wrapper", ".", "find", "(", "'button'", ")", ".", "trigger", "(", "'click'", ")", ";", "expect", "(", "Gate", ".", "state", ".", "getState", "(", ")", ")", ".", "toBe", "(", "'Alan Doe'", ")", ";", "}", ")", ";", "it", "(", "'gate used before useStore hook'", ",", "async", "(", ")", "=>", "{", "const", "Gate", "=", "createGate", "(", ")", ";", "const", "$loading", "=", "createStore", "(", "false", ")", ".", "on", "(", "Gate", ".", "open", ",", "(", ")", "=>", "true", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <div>\n {{loading}}\n </div>\n `", ",", "setup", "(", ")", "{", "useGate", "(", "Gate", ")", ";", "const", "loading", "=", "useStore", "(", "$loading", ")", ";", "return", "{", "loading", ",", "}", ";", "}", ",", "}", ")", ";", "await", "nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "$el", ".", "innerHTML", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";", "it", "(", "'gate used before useStore hook'", ",", "async", "(", ")", "=>", "{", "const", "Gate", "=", "createGate", "(", ")", ";", "const", "$isEnabled", "=", "createStore", "(", "false", ")", ".", "on", "(", "Gate", ".", "open", ",", "(", ")", "=>", "true", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <div>\n <input\n type=\"checkbox\"\n v-model=\"isEnabled\"\n data-test=\"checkbox\"\n >\n </div>\n `", ",", "setup", "(", ")", "{", "useGate", "(", "Gate", ")", ";", "const", "isEnabled", "=", "useVModel", "(", "$isEnabled", ")", ";", "return", "{", "isEnabled", ",", "}", ";", "}", ",", "}", ")", ";", "await", "nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "find", "(", "'[data-test=\"checkbox\"]'", ")", ".", "element", ".", "checked", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8716, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
648
[ "import", "{", "shallowMount", ",", "createLocalVue", ",", "mount", "}", "from", "'vue-test-utils-legacy'", ";", "import", "{", "createStore", ",", "createEvent", "}", "from", "'effector'", ";", "import", "Vue", "from", "'vue'", ";", "import", "{", "VueEffector", ",", "createComponent", "}", "from", "'effector-vue'", ";", "const", "localVue", "=", "createLocalVue", "(", ")", ";", "localVue", ".", "use", "(", "VueEffector", ")", ";", "test", "(", "'show counter'", ",", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "0", ")", ";", "const", "component", "=", "Vue", ".", "extend", "(", "{", "template", ":", "'<div>{{ counter }}</div>'", ",", "effector", ":", "{", "counter", ":", "$counter", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter", ")", ".", "toBe", "(", "0", ")", ";", "expect", "(", "wrapper", ".", "html", "(", ")", ")", ".", "toBe", "(", "'<div>0</div>'", ")", ";", "}", ")", ";", "test", "(", "'is store its [key] state'", ",", "async", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "0", ")", ";", "const", "evt", "=", "createEvent", "(", ")", ";", "$counter", ".", "on", "(", "evt", ",", "state", "=>", "state", "+", "1", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "'<div>{{ state }}</div>'", ",", "effector", ":", "$counter", ",", "}", ",", "{", "localVue", "}", ")", ";", "evt", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "state", ")", ".", "toBe", "(", "1", ")", ";", "}", ")", ";", "test", "(", "'show counter with createComponent'", ",", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "0", ")", ";", "const", "componentWithWrapper", "=", "createComponent", "(", "{", "name", ":", "'ComponentWithWrapper'", ",", "template", ":", "'<div>{{ counter }}</div>'", ",", "}", ",", "{", "counter", ":", "$counter", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "componentWithWrapper", ",", "{", "localVue", ",", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter", ")", ".", "toBe", "(", "0", ")", ";", "expect", "(", "wrapper", ".", "html", "(", ")", ")", ".", "toBe", "(", "'<div>0</div>'", ")", ";", "}", ")", ";", "test", "(", "'vue $watch'", ",", "async", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "0", ")", ";", "const", "mockCallback", "=", "jest", ".", "fn", "(", ")", ";", "const", "component", "=", "createComponent", "(", "{", "template", ":", "'<div>{{ counter }}</div>'", ",", "created", "(", ")", "{", "this", ".", "$watch", "(", "'counter'", ",", "function", "counter", "(", ")", "{", "mockCallback", "(", ")", ";", "}", ")", ";", "}", ",", "}", ",", "{", "counter", ":", "$counter", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter", ")", ".", "toBe", "(", "0", ")", ";", "$counter", ".", "setState", "(", "1", ")", ";", "await", "localVue", ".", "nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter", ")", ".", "toBe", "(", "1", ")", ";", "expect", "(", "mockCallback", ".", "mock", ".", "calls", ".", "length", ")", ".", "toBe", "(", "1", ")", ";", "}", ")", ";", "test", "(", "'test SID if pass event to effector object'", ",", "async", "(", ")", "=>", "{", "const", "evt", "=", "createEvent", "(", ")", ";", "const", "mockCallback", "=", "jest", ".", "fn", "(", ")", ";", "const", "component", "=", "createComponent", "(", "{", "template", ":", "'<div>{{ evt }}</div>'", ",", "watch", ":", "{", "evt", "(", ")", "{", "mockCallback", "(", ")", ";", "}", ",", "}", ",", "}", ",", "{", "evt", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "evt", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "mockCallback", ".", "mock", ".", "calls", ".", "length", ")", ".", "toBe", "(", "1", ")", ";", "}", ")", ";", "test", "(", "'vue component watch option'", ",", "async", "(", ")", "=>", "{", "const", "$counter", "=", "createStore", "(", "0", ")", ";", "const", "mockCallback", "=", "jest", ".", "fn", "(", ")", ";", "const", "component", "=", "createComponent", "(", "{", "template", ":", "'<div>{{ counter }}</div>'", ",", "watch", ":", "{", "counter", "(", ")", "{", "mockCallback", "(", ")", ";", "}", ",", "}", ",", "}", ",", "{", "counter", ":", "$counter", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter", ")", ".", "toBe", "(", "0", ")", ";", "$counter", ".", "setState", "(", "1", ")", ";", "await", "localVue", ".", "nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter", ")", ".", "toBe", "(", "1", ")", ";", "expect", "(", "mockCallback", ".", "mock", ".", "calls", ".", "length", ")", ".", "toBe", "(", "1", ")", ";", "}", ")", ";", "test", "(", "'is v-model works correct with state key on input'", ",", "(", ")", "=>", "{", "const", "expected", "=", "'John Doe'", ";", "const", "$fullname", "=", "createStore", "(", "''", ")", ";", "const", "component", "=", "Vue", ".", "extend", "(", "{", "template", ":", "`<div><input v-model=\"state\" data-input></div>`", ",", "effector", ":", "$fullname", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "wrapper", ".", "find", "(", "'[data-input]'", ")", ".", "setValue", "(", "expected", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "state", ")", ".", "toBe", "(", "expected", ")", ";", "}", ")", ";", "test", "(", "'is v-model works correct with custom key on input'", ",", "(", ")", "=>", "{", "const", "expected", "=", "'John Doe'", ";", "const", "$fullname", "=", "createStore", "(", "''", ")", ";", "const", "component", "=", "Vue", ".", "extend", "(", "{", "template", ":", "`<div><input v-model=\"$fullname\" data-input></div>`", ",", "effector", ":", "{", "$fullname", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "wrapper", ".", "find", "(", "'[data-input]'", ")", ".", "setValue", "(", "expected", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "$fullname", ")", ".", "toBe", "(", "expected", ")", ";", "}", ")", ";", "test", "(", "'is v-model works with custom component'", ",", "(", ")", "=>", "{", "const", "expected", "=", "'John Doe'", ";", "const", "child", "=", "Vue", ".", "extend", "(", "{", "name", ":", "'child'", ",", "template", ":", "`<div></div>`", ",", "props", ":", "{", "value", ":", "String", ",", "}", ",", "methods", ":", "{", "handleChange", "(", ")", "{", "this", ".", "$emit", "(", "'input'", ",", "expected", ")", ";", "}", ",", "}", ",", "}", ")", ";", "const", "$fullname", "=", "createStore", "(", "''", ")", ";", "const", "component", "=", "Vue", ".", "extend", "(", "{", "template", ":", "`\n <div>\n <child v-model=\"$fullname\"/>\n </div>\n `", ",", "components", ":", "{", "child", ",", "}", ",", "effector", ":", "{", "$fullname", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "wrapper", ".", "findComponent", "(", "{", "name", ":", "'child'", "}", ")", ".", "vm", ".", "handleChange", "(", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "$fullname", ")", ".", "toBe", "(", "expected", ")", ";", "}", ")", ";", "test", "(", "'non v-model usage support'", ",", "async", "(", ")", "=>", "{", "const", "changeEvent", "=", "createEvent", "(", ")", ";", "const", "someEvt", "=", "createEvent", "(", ")", ";", "const", "$store", "=", "createStore", "(", "''", ")", ".", "on", "(", "changeEvent", ",", "(", "_", ",", "value", ")", "=>", "value", ")", ".", "on", "(", "someEvt", ",", "(", ")", "=>", "'some-value'", ")", ";", "const", "component", "=", "Vue", ".", "extend", "(", "{", "template", ":", "`\n <div id=\"app\">\n <input id=\"input\" :value=\"value\" @input=\"(e) => changeEvent(e.target.value)\" />\n <button id=\"btn\" @click=\"someEvt\">set some-value</button>\n </div>\n `", ",", "name", ":", "'App'", ",", "effector", ":", "{", "value", ":", "$store", ",", "}", ",", "methods", ":", "{", "changeEvent", ",", "someEvt", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "localVue", ",", "}", ")", ";", "const", "input", "=", "wrapper", ".", "element", ".", "querySelector", "(", "'#input'", ")", "!", "as", "HTMLInputElement", ";", "const", "btn", "=", "wrapper", ".", "element", ".", "querySelector", "(", "'#btn'", ")", "!", "as", "HTMLButtonElement", ";", "btn", ".", "click", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "$store", ".", "getState", "(", ")", ")", ".", "toBe", "(", "'some-value'", ")", ";", "expect", "(", "input", ".", "value", ")", ".", "toBe", "(", "'some-value'", ")", ";", "}", ")", ";", "test", "(", "'change value in array from UI via v-model'", ",", "async", "(", ")", "=>", "{", "const", "handleChange", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "$users", "=", "createStore", "<", "{", "name", ":", "string", ";", "selected", ":", "boolean", ";", "}", "[", "]", ">", "(", "[", "{", "name", ":", "'Alan'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'Criss'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'John'", ",", "selected", ":", "false", "}", ",", "]", ")", ";", "$users", ".", "on", "(", "handleChange", ",", "(", "state", ",", "payload", ")", "=>", "{", "const", "idx", "=", "state", ".", "findIndex", "(", "(", "_", ",", "i", ")", "=>", "i", "===", "payload", ")", ";", "const", "s", "=", "[", "...", "state", "]", ";", "s", "[", "idx", "]", ".", "selected", "=", "!", "s", "[", "idx", "]", ".", "selected", ";", "return", "s", ";", "}", ")", ";", "const", "component", "=", "Vue", ".", "extend", "(", "{", "template", ":", "`\n <div>\n <label\n v-for=\"(user, key) in $users\"\n :key=\"key\"\n >\n <input\n type=\"checkbox\"\n :value=\"user\"\n @change=\"handleChange(key)\"\n data-test=\"checkbox\"\n >\n {{user.name}}\n </label>\n </div>\n `", ",", "effector", ":", "{", "$users", "}", ",", "methods", ":", "{", "handleChange", "}", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "localVue", "}", ")", ";", "const", "checkbox", "=", "wrapper", ".", "find", "(", "'[data-test=\"checkbox\"]'", ")", ";", "await", "checkbox", ".", "setChecked", "(", ")", ";", "expect", "(", "$users", ".", "getState", "(", ")", "[", "0", "]", ".", "selected", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";", "test", "(", "'change value in array from event via v-model'", ",", "async", "(", ")", "=>", "{", "const", "handleChange", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "$users", "=", "createStore", "<", "{", "name", ":", "string", ";", "selected", ":", "boolean", ";", "}", "[", "]", ">", "(", "[", "{", "name", ":", "'Alan'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'Criss'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'John'", ",", "selected", ":", "false", "}", ",", "]", ")", ";", "$users", ".", "on", "(", "handleChange", ",", "(", "state", ",", "payload", ")", "=>", "{", "const", "idx", "=", "state", ".", "findIndex", "(", "(", "_", ",", "i", ")", "=>", "i", "===", "payload", ")", ";", "const", "s", "=", "[", "...", "state", "]", ";", "s", "[", "idx", "]", ".", "selected", "=", "!", "s", "[", "idx", "]", ".", "selected", ";", "return", "s", ";", "}", ")", ";", "const", "component", "=", "Vue", ".", "extend", "(", "{", "template", ":", "`\n <div>\n <label\n v-for=\"(user, key) in $users\"\n :key=\"key\"\n >\n <input\n type=\"checkbox\"\n :value=\"user\"\n @change=\"handleChange(key)\"\n data-test=\"checkbox\"\n >\n {{user.name}}\n </label>\n\n <button @click=\"handleChange(0)\" data-test=\"btn\">\n Change\n </button>\n </div>\n `", ",", "effector", ":", "{", "$users", "}", ",", "methods", ":", "{", "handleChange", "}", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "localVue", "}", ")", ";", "const", "btn", "=", "wrapper", ".", "find", "(", "'[data-test=\"btn\"]'", ")", ";", "await", "btn", ".", "trigger", "(", "'click'", ")", ";", "expect", "(", "$users", ".", "getState", "(", ")", "[", "0", "]", ".", "selected", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1954, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 58, null, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 58, null, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 58, null, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 46, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 46, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 2, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, 83, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 282, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 3, null, null, null, null, 3, null, null, null, null, null, null, 6, null, 3, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 3, null, null, null, null, 3, null, null, null, null, null, null, 6, null, 3, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1965, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
649
[ "import", "{", "defineComponent", "}", "from", "'vue-next'", ";", "import", "{", "mount", ",", "shallowMount", "}", "from", "'vue-test-utils-next'", ";", "import", "{", "createEvent", ",", "createStore", "}", "from", "'effector'", ";", "import", "{", "VueEffector", "}", "from", "'../optionsApi'", ";", "jest", ".", "mock", "(", "'vue'", ",", "(", ")", "=>", "require", "(", "'vue-next'", ")", ")", ";", "console", ".", "error", "=", "jest", ".", "fn", "(", ")", ";", "beforeEach", "(", "(", ")", "=>", "{", "console", ".", "error", ".", "mockClear", "(", ")", ";", "}", ")", ";", "const", "globalOptions", "=", "{", "global", ":", "{", "plugins", ":", "[", "VueEffector", "]", ",", "}", ",", "}", ";", "test", "(", "'show counter'", ",", "(", ")", "=>", "{", "const", "counter$", "=", "createStore", "(", "0", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "`<div>{{counter$}}</div>`", ",", "effector", "(", ")", "{", "return", "{", "counter$", ",", "}", ";", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter$", ")", ".", "toBe", "(", "0", ")", ";", "expect", "(", "wrapper", ".", "html", "(", ")", ")", ".", "toBe", "(", "'<div>0</div>'", ")", ";", "}", ")", ";", "test", "(", "'test SID if pass event to effector object'", ",", "async", "(", ")", "=>", "{", "const", "evt", "=", "createEvent", "(", ")", ";", "const", "mockCallback", "=", "jest", ".", "fn", "(", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "'<div>{{ evt }}</div>'", ",", "effector", "(", ")", "{", "return", "{", "evt", ",", "}", ";", "}", ",", "watch", ":", "{", "evt", "(", ")", "{", "mockCallback", "(", ")", ";", "}", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "evt", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "mockCallback", ".", "mock", ".", "calls", ".", "length", ")", ".", "toBe", "(", "1", ")", ";", "}", ")", ";", "test", "(", "'vue component watch option'", ",", "async", "(", ")", "=>", "{", "const", "counter$", "=", "createStore", "(", "0", ")", ";", "const", "mockCallback", "=", "jest", ".", "fn", "(", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "'<div>{{ counter$ }}</div>'", ",", "effector", "(", ")", "{", "return", "{", "counter$", ",", "}", ";", "}", ",", "watch", ":", "{", "counter$", "(", ")", "{", "mockCallback", "(", ")", ";", "}", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter$", ")", ".", "toBe", "(", "0", ")", ";", "counter$", ".", "setState", "(", "1", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "counter$", ")", ".", "toBe", "(", "1", ")", ";", "expect", "(", "mockCallback", ".", "mock", ".", "calls", ".", "length", ")", ".", "toBe", "(", "1", ")", ";", "}", ")", ";", "test", "(", "'is v-model works correct with input'", ",", "(", ")", "=>", "{", "const", "expected", "=", "'John Doe'", ";", "const", "fullname$", "=", "createStore", "(", "''", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "`<div><input v-model=\"fullname$\" data-input></div>`", ",", "effector", "(", ")", "{", "return", "{", "fullname$", ":", "{", "value", ":", "fullname$", ",", "vModel", ":", "true", ",", "}", ",", "}", ";", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "wrapper", ".", "find", "(", "'[data-input]'", ")", ".", "setValue", "(", "expected", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "fullname$", ")", ".", "toBe", "(", "expected", ")", ";", "}", ")", ";", "test", "(", "'is v-model works with custom component'", ",", "async", "(", ")", "=>", "{", "const", "expected", "=", "'John Doe'", ";", "const", "child", "=", "defineComponent", "(", "{", "name", ":", "'child'", ",", "template", ":", "`<div></div>`", ",", "methods", ":", "{", "handleChange", "(", ")", "{", "this", ".", "$emit", "(", "'update:modelValue'", ",", "expected", ")", ";", "}", ",", "}", ",", "}", ")", ";", "const", "fullname$", "=", "createStore", "(", "''", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "`\n <div>\n <child v-model=\"fullname$\"/>\n </div>\n `", ",", "components", ":", "{", "child", ",", "}", ",", "effector", "(", ")", "{", "return", "{", "fullname$", ":", "{", "value", ":", "fullname$", ",", "vModel", ":", "true", ",", "}", ",", "}", ";", "}", ",", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "wrapper", ".", "findComponent", "(", "{", "name", ":", "'child'", "}", ")", ".", "vm", ".", "handleChange", "(", ")", ";", "expect", "(", "wrapper", ".", "vm", ".", "fullname$", ")", ".", "toBe", "(", "expected", ")", ";", "}", ")", ";", "test", "(", "'non v-model usage support'", ",", "async", "(", ")", "=>", "{", "const", "changeEvent", "=", "createEvent", "(", ")", ";", "const", "someEvt", "=", "createEvent", "(", ")", ";", "const", "store$", "=", "createStore", "(", "''", ")", ".", "on", "(", "changeEvent", ",", "(", "_", ",", "value", ")", "=>", "value", ")", ".", "on", "(", "someEvt", ",", "(", ")", "=>", "'some-value'", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "`\n <div id=\"app\">\n <input id=\"input\" :value=\"store$\" @input=\"(e) => changeEvent(e.target.value)\" />\n <button id=\"btn\" @click=\"someEvt\">set some-value</button>\n </div>\n `", ",", "name", ":", "'App'", ",", "effector", "(", ")", "{", "return", "{", "store$", ",", "}", ";", "}", ",", "methods", ":", "{", "changeEvent", ",", "someEvt", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "const", "input", "=", "wrapper", ".", "element", ".", "querySelector", "(", "'#input'", ")", "!", "as", "HTMLInputElement", ";", "const", "btn", "=", "wrapper", ".", "element", ".", "querySelector", "(", "'#btn'", ")", "!", "as", "HTMLButtonElement", ";", "btn", ".", "click", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "store$", ".", "getState", "(", ")", ")", ".", "toBe", "(", "'some-value'", ")", ";", "expect", "(", "input", ".", "value", ")", ".", "toBe", "(", "'some-value'", ")", ";", "}", ")", ";", "test", "(", "'change value in array from UI via v-model'", ",", "async", "(", ")", "=>", "{", "const", "handleChange", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "users$", "=", "createStore", "<", "{", "name", ":", "string", ";", "selected", ":", "boolean", ";", "}", "[", "]", ">", "(", "[", "{", "name", ":", "'Alan'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'Criss'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'John'", ",", "selected", ":", "false", "}", ",", "]", ")", ";", "users$", ".", "on", "(", "handleChange", ",", "(", "state", ",", "payload", ")", "=>", "{", "const", "idx", "=", "state", ".", "findIndex", "(", "(", "_", ",", "i", ")", "=>", "i", "===", "payload", ")", ";", "const", "s", "=", "[", "...", "state", "]", ";", "s", "[", "idx", "]", ".", "selected", "=", "!", "s", "[", "idx", "]", ".", "selected", ";", "return", "s", ";", "}", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "`\n <div>\n <label\n v-for=\"(user, key) in users$\"\n :key=\"key\"\n >\n <input\n type=\"checkbox\"\n :value=\"user\"\n @change=\"handleChange(key)\"\n data-test=\"checkbox\"\n >\n {{user.name}}\n </label>\n </div>\n `", ",", "effector", "(", ")", "{", "return", "{", "users$", ",", "}", ";", "}", ",", "methods", ":", "{", "handleChange", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "const", "checkbox", "=", "wrapper", ".", "find", "(", "'[data-test=\"checkbox\"]'", ")", ";", "await", "checkbox", ".", "setChecked", "(", ")", ";", "expect", "(", "users$", ".", "getState", "(", ")", "[", "0", "]", ".", "selected", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";", "test", "(", "'change value in array from event via v-model'", ",", "async", "(", ")", "=>", "{", "const", "handleChange", "=", "createEvent", "<", "number", ">", "(", ")", ";", "const", "users$", "=", "createStore", "<", "{", "name", ":", "string", ";", "selected", ":", "boolean", ";", "}", "[", "]", ">", "(", "[", "{", "name", ":", "'Alan'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'Criss'", ",", "selected", ":", "false", "}", ",", "{", "name", ":", "'John'", ",", "selected", ":", "false", "}", ",", "]", ")", ";", "users$", ".", "on", "(", "handleChange", ",", "(", "state", ",", "payload", ")", "=>", "{", "const", "idx", "=", "state", ".", "findIndex", "(", "(", "_", ",", "i", ")", "=>", "i", "===", "payload", ")", ";", "const", "s", "=", "[", "...", "state", "]", ";", "s", "[", "idx", "]", ".", "selected", "=", "!", "s", "[", "idx", "]", ".", "selected", ";", "return", "s", ";", "}", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "`\n <div>\n <label\n v-for=\"(user, key) in users$\"\n :key=\"key\"\n >\n <input\n type=\"checkbox\"\n :value=\"user\"\n @change=\"handleChange(key)\"\n data-test=\"checkbox\"\n >\n {{user.name}}\n </label>\n\n <button @click=\"handleChange(0)\" data-test=\"btn\">\n Change\n </button>\n </div>\n `", ",", "effector", "(", ")", "{", "return", "{", "users$", ",", "}", ";", "}", ",", "methods", ":", "{", "handleChange", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "mount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "const", "btn", "=", "wrapper", ".", "find", "(", "'[data-test=\"btn\"]'", ")", ";", "await", "btn", ".", "trigger", "(", "'click'", ")", ";", "expect", "(", "users$", ".", "getState", "(", ")", "[", "0", "]", ".", "selected", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";", "test", "(", "'effector store is readonly for UI'", ",", "async", "(", ")", "=>", "{", "const", "counter$", "=", "createStore", "(", "0", ")", ";", "const", "component", "=", "defineComponent", "(", "{", "template", ":", "`<div></div>`", ",", "effector", "(", ")", "{", "return", "{", "counter$", ",", "}", ";", "}", ",", "methods", ":", "{", "handleChange", "(", ")", "{", "this", ".", "counter$", "=", "15", ";", "}", ",", "}", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "component", ",", "{", "...", "globalOptions", ",", "}", ")", ";", "wrapper", ".", "vm", ".", "handleChange", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "console", ".", "error", ")", ".", "toHaveBeenCalledTimes", "(", "1", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 58, null, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 58, null, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 46, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 717, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, 2, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, 83, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 282, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 3, null, null, null, null, 3, null, null, null, null, null, null, 6, null, 3, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, 20789, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 3, null, null, null, null, 3, null, null, null, null, null, null, 6, null, 3, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, 20789, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 717, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
650
[ "import", "{", "shallowMount", "}", "from", "'vue-test-utils-next'", ";", "import", "{", "useStore", "}", "from", "'effector-vue/composition'", ";", "import", "{", "createEvent", ",", "createStore", "}", "from", "'effector'", ";", "jest", ".", "mock", "(", "'vue'", ",", "(", ")", "=>", "require", "(", "'vue-next'", ")", ")", ";", "it", "(", "'list of primitive values rendered correct'", ",", "(", ")", "=>", "{", "const", "length", "=", "3", ";", "const", "$numbers", "=", "createStore", "(", "Array", ".", "from", "(", "{", "length", "}", ",", "(", "_", ",", "idx", ")", "=>", "idx", ")", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <ul id=\"app\">\n <li v-for=\"(n, key) in numbers\" :key=\"key\" data-test=\"item\">{{n}}</li>\n </ul>\n `", ",", "setup", "(", ")", "{", "const", "numbers", "=", "useStore", "(", "$numbers", ")", ";", "return", "{", "numbers", "}", ";", "}", "}", ")", ";", "expect", "(", "wrapper", ".", "findAll", "(", "'[data-test=\"item\"]'", ")", ")", ".", "toHaveLength", "(", "length", ")", ";", "}", ")", ";", "it", "(", "'add new item and re-render list'", ",", "async", "(", ")", "=>", "{", "const", "userAdded", "=", "createEvent", "(", ")", ";", "const", "$users", "=", "createStore", "(", "[", "{", "name", ":", "'John'", ",", "surname", ":", "'Doe'", "}", "]", ")", ";", "$users", ".", "on", "(", "userAdded", ",", "(", "state", ")", "=>", "[", "...", "state", ",", "{", "name", ":", "'Alan'", ",", "surname", ":", "'Doe'", "}", "]", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <ul id=\"app\">\n <li v-for=\"(item, key) in users\" :key=\"key\" data-test=\"item\">{{item.name}}</li>\n </ul>\n `", ",", "setup", "(", ")", "{", "const", "users", "=", "useStore", "(", "$users", ")", ";", "return", "{", "users", "}", ";", "}", "}", ")", ";", "userAdded", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "findAll", "(", "'[data-test=\"item\"]'", ")", ")", ".", "toHaveLength", "(", "2", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
651
[ "import", "{", "useVModel", "}", "from", "'effector-vue/composition'", ";", "import", "{", "createEvent", ",", "createStore", "}", "from", "'effector'", ";", "import", "{", "shallowMount", "}", "from", "'vue-test-utils-next'", ";", "jest", ".", "mock", "(", "'vue'", ",", "(", ")", "=>", "require", "(", "'vue-next'", ")", ")", ";", "it", "(", "'updated value of input if store changed from outside'", ",", "async", "(", ")", "=>", "{", "const", "updated", "=", "createEvent", "(", ")", ";", "const", "$user", "=", "createStore", "(", "{", "skills", ":", "[", "{", "name", ":", "'HTML'", ",", "points", ":", "10", "}", "]", "}", ")", ";", "$user", ".", "on", "(", "updated", ",", "(", "state", ")", "=>", "(", "{", "...", "state", ",", "skills", ":", "[", "{", "name", ":", "'HTML'", ",", "points", ":", "20", "}", "]", "}", ")", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <div>\n <input v-model=\"user.skills[0].points\" data-test=\"skills.points\">\n </div>\n `", ",", "setup", "(", ")", "{", "const", "user", "=", "useVModel", "(", "$user", ")", ";", "return", "{", "user", "}", ";", "}", "}", ")", ";", "await", "wrapper", ".", "find", "(", "'[data-test=\"skills.points\"]'", ")", ".", "setValue", "(", "15", ")", ";", "expect", "(", "$user", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "skills", ":", "[", "{", "name", ":", "'HTML'", ",", "points", ":", "'15'", "}", "]", "}", ")", ";", "updated", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "wrapper", ".", "find", "(", "'[data-test=\"skills.points\"]'", ")", ".", "element", ".", "value", ")", ".", "toBe", "(", "'20'", ")", ";", "}", ")", ";", "it", "(", "'[v-model] works correct with scalar values'", ",", "async", "(", ")", "=>", "{", "const", "$username", "=", "createStore", "(", "''", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <div><input v-model=\"username\" data-test=\"field\"></div>\n `", ",", "setup", "(", ")", "{", "const", "username", "=", "useVModel", "(", "$username", ")", ";", "return", "{", "username", "}", ";", "}", "}", ")", ";", "await", "wrapper", ".", "find", "(", "'[data-test=\"field\"]'", ")", ".", "setValue", "(", "'John Doe'", ")", ";", "expect", "(", "$username", ".", "getState", "(", ")", ")", ".", "toBe", "(", "'John Doe'", ")", ";", "}", ")", ";", "it", "(", "'[v-model] works correct with objects'", ",", "async", "(", ")", "=>", "{", "const", "$user", "=", "createStore", "(", "{", "name", ":", "''", ",", "surname", ":", "''", ",", "}", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <div>\n <input v-model=\"user.name\" data-test=\"name\">\n <input v-model=\"user.surname\" data-test=\"surname\">\n </div>\n `", ",", "setup", "(", ")", "{", "const", "user", "=", "useVModel", "(", "$user", ")", ";", "return", "{", "user", "}", ";", "}", "}", ")", ";", "await", "wrapper", ".", "find", "(", "'[data-test=\"name\"]'", ")", ".", "setValue", "(", "'John'", ")", ";", "await", "wrapper", ".", "find", "(", "'[data-test=\"surname\"]'", ")", ".", "setValue", "(", "'Doe'", ")", ";", "expect", "(", "$user", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "{", "name", ":", "'John'", ",", "surname", ":", "'Doe'", ",", "}", ")", ";", "}", ")", ";", "it", "(", "'reset useVModel'", ",", "async", "(", ")", "=>", "{", "const", "model", "=", "{", "name", ":", "''", ",", "surname", ":", "''", ",", "}", ";", "const", "reset", "=", "createEvent", "(", ")", ";", "const", "$user", "=", "createStore", "(", "model", ")", ".", "reset", "(", "reset", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <div>\n <input v-model=\"user.name\" data-test=\"name\">\n <input v-model=\"user.surname\" data-test=\"surname\">\n </div>\n `", ",", "setup", "(", ")", "{", "const", "user", "=", "useVModel", "(", "$user", ")", ";", "return", "{", "user", "}", ";", "}", "}", ")", ";", "await", "wrapper", ".", "find", "(", "'[data-test=\"name\"]'", ")", ".", "setValue", "(", "'John'", ")", ";", "await", "wrapper", ".", "find", "(", "'[data-test=\"surname\"]'", ")", ".", "setValue", "(", "'Doe'", ")", ";", "reset", "(", ")", ";", "await", "wrapper", ".", "vm", ".", "$nextTick", "(", ")", ";", "expect", "(", "$user", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "model", ")", ";", "}", ")", ";", "it", "(", "'[v-model] works correct with checkboxes (like vue-3 way)'", ",", "async", "(", ")", "=>", "{", "const", "$skills", "=", "createStore", "(", "[", "]", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <input type=\"checkbox\" v-model=\"skills\" data-test=\"skills\" value=\"HTML\">\n <input type=\"checkbox\" v-model=\"skills\" data-test=\"skills\" value=\"CSS\">\n <input type=\"checkbox\" v-model=\"skills\" data-test=\"skills\" value=\"JS\">\n `", ",", "setup", "(", ")", "{", "const", "skills", "=", "useVModel", "(", "$skills", ")", ";", "return", "{", "skills", "}", ";", "}", "}", ")", ";", "await", "wrapper", ".", "findAll", "(", "'[data-test=\"skills\"]'", ")", "[", "0", "]", ".", "setValue", "(", ")", ";", "await", "wrapper", ".", "findAll", "(", "'[data-test=\"skills\"]'", ")", "[", "1", "]", ".", "setValue", "(", ")", ";", "await", "wrapper", ".", "findAll", "(", "'[data-test=\"skills\"]'", ")", "[", "2", "]", ".", "setValue", "(", ")", ";", "expect", "(", "$skills", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "[", "'HTML'", ",", "'CSS'", ",", "'JS'", "]", ")", ";", "}", ")", ";", "it", "(", "'[v-model] works correct with radio (like vue-3 way)'", ",", "async", "(", ")", "=>", "{", "const", "$gender", "=", "createStore", "(", "'male'", ")", ";", "const", "wrapper", "=", "shallowMount", "(", "{", "template", ":", "`\n <input type=\"radio\" name=\"gender\" v-model=\"gender\" data-test=\"gender\" value=\"female\">\n <input type=\"radio\" name=\"gender\" v-model=\"gender\" data-test=\"gender\" value=\"male\">\n `", ",", "setup", "(", ")", "{", "const", "gender", "=", "useVModel", "(", "$gender", ")", ";", "return", "{", "gender", "}", ";", "}", "}", ")", ";", "await", "wrapper", ".", "find", "(", "'[data-test=\"gender\"]'", ")", ".", "setValue", "(", ")", ";", "expect", "(", "$gender", ".", "getState", "(", ")", ")", ".", "toEqual", "(", "'female'", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, 37, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 46, null, null, null, null, null, null, null, 1315, null, null, null, null, null, null, null, null, 6, null, null, null, null, 133, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
652
[ "import", "{", "massCopy", ",", "outputPackageJSON", "}", "from", "'Builder/utils'", ";", "import", "packages", "from", "'Builder/packages.config'", ";", "export", "const", "copyLicense", "=", "(", "libName", ")", "=>", "(", ")", "=>", "massCopy", "(", "'.'", ",", "`npm/${", "libName", "}`", ",", "[", "'LICENSE'", "]", ")", ";", "export", "const", "generatePackageJSON", "=", "(", "libName", ")", "=>", "(", ")", "=>", "outputPackageJSON", "(", "`packages/${", "libName", "}/package.json`", ",", "packages", "[", "libName", "]", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
653
[ "import", "{", "readFile", ",", "outputFile", "}", "from", "'fs-extra'", ";", "import", "Viz", "from", "'viz.js'", ";", "import", "{", "Module", ",", "render", "}", "from", "'viz.js/full.render.js'", ";", "import", "sharp", "from", "'sharp'", ";", "import", "{", "massCopy", ",", "publishScript", "}", "from", "'Builder/utils'", ";", "import", "{", "rollupEffector", ",", "rollupEffectorReact", ",", "rollupEffectorVue", ",", "rollupEffectorDom", ",", "}", "from", "'Builder/rollup'", ";", "import", "{", "copyLicense", ",", "generatePackageJSON", "}", "from", "'./common'", ";", "export", "default", "{", "effector", ":", "[", "generatePackageJSON", "(", "'effector'", ")", ",", "copyLicense", "(", "'effector'", ")", ",", "(", ")", "=>", "massCopy", "(", "'.'", ",", "'npm/effector'", ",", "[", "'README.md'", "]", ")", ",", "(", ")", "=>", "massCopy", "(", "'packages/effector'", ",", "'npm/effector'", ",", "[", "[", "'index.d.ts'", ",", "[", "'index.d.ts'", ",", "'effector.cjs.d.ts'", ",", "'effector.mjs.d.ts'", ",", "'effector.umd.d.ts'", ",", "'compat.d.ts'", ",", "]", ",", "]", ",", "'package.json'", ",", "'fork.d.ts'", ",", "[", "'index.js.flow'", ",", "[", "'index.js.flow'", ",", "'effector.cjs.js.flow'", ",", "'effector.umd.js.flow'", ",", "'compat.js.flow'", ",", "]", ",", "]", ",", "]", ")", ",", "(", ")", "=>", "massCopy", "(", "'src/babel'", ",", "'npm/effector'", ",", "[", "'babel-plugin.js'", ",", "'babel-plugin-react.js'", ",", "]", ")", ",", "rollupEffector", ",", "renderModulesGraph", ",", "publishScript", "(", "'effector'", ")", ",", "]", ",", "'effector-react'", ":", "[", "generatePackageJSON", "(", "'effector-react'", ")", ",", "copyLicense", "(", "'effector-react'", ")", ",", "(", ")", "=>", "massCopy", "(", "'packages/effector-react'", ",", "'npm/effector-react'", ",", "[", "[", "'index.d.ts'", ",", "[", "'index.d.ts'", ",", "'effector-react.cjs.d.ts'", ",", "'effector-react.mjs.d.ts'", ",", "'effector-react.umd.d.ts'", ",", "'compat.d.ts'", ",", "]", ",", "]", ",", "'README.md'", ",", "'package.json'", ",", "[", "'scope.d.ts'", ",", "[", "'scope.d.ts'", ",", "'ssr.d.ts'", "]", "]", ",", "[", "'index.js.flow'", ",", "[", "'index.js.flow'", ",", "'effector-react.cjs.js.flow'", ",", "'effector-react.umd.js.flow'", ",", "'compat.js.flow'", ",", "]", ",", "]", ",", "]", ")", ",", "rollupEffectorReact", ",", "publishScript", "(", "'effector-react'", ")", ",", "]", ",", "'effector-vue'", ":", "[", "generatePackageJSON", "(", "'effector-vue'", ")", ",", "copyLicense", "(", "'effector-vue'", ")", ",", "(", ")", "=>", "massCopy", "(", "'packages/effector-vue'", ",", "'npm/effector-vue'", ",", "[", "[", "'index.d.ts'", ",", "[", "'index.d.ts'", ",", "'effector-vue.cjs.d.ts'", ",", "'effector-vue.mjs.d.ts'", ",", "'effector-vue.umd.d.ts'", ",", "'compat.d.ts'", ",", "]", ",", "]", ",", "[", "'composition.d.ts'", ",", "[", "'composition.d.ts'", ",", "'composition.cjs.d.ts'", ",", "'composition.mjs.d.ts'", "]", ",", "]", ",", "[", "'ssr.d.ts'", ",", "[", "'ssr.d.ts'", ",", "'ssr.cjs.d.ts'", ",", "'ssr.mjs.d.ts'", "]", ",", "]", ",", "'README.md'", ",", "'package.json'", ",", "[", "'index.js.flow'", ",", "[", "'index.js.flow'", ",", "'effector-vue.cjs.js.flow'", ",", "'effector-vue.umd.js.flow'", ",", "]", ",", "]", ",", "]", ")", ",", "rollupEffectorVue", ",", "publishScript", "(", "'effector-vue'", ")", ",", "]", ",", "forest", ":", "[", "generatePackageJSON", "(", "'forest'", ")", ",", "copyLicense", "(", "'forest'", ")", ",", "(", ")", "=>", "Promise", ".", "all", "(", "[", "massCopy", "(", "'packages/forest'", ",", "'npm/forest'", ",", "[", "[", "'index.d.ts'", ",", "[", "'index.d.ts'", ",", "'forest.cjs.d.ts'", ",", "'forest.mjs.d.ts'", ",", "'forest.umd.d.ts'", ",", "]", ",", "]", ",", "'server.d.ts'", ",", "]", ")", ",", "massCopy", "(", "'packages/forest'", ",", "'npm/forest'", ",", "[", "'README.md'", ",", "'package.json'", ",", "]", ")", ",", "]", ")", ",", "(", ")", "=>", "rollupEffectorDom", "(", "{", "name", ":", "'forest'", "}", ")", ",", "publishScript", "(", "'forest'", ")", ",", "]", ",", "}", ";", "const", "viz", "=", "new", "Viz", "(", "{", "Module", ",", "render", "}", ")", ";", "async", "function", "renderModulesGraph", "(", ")", "{", "const", "root", "=", "process", ".", "cwd", "(", ")", ";", "const", "source", "=", "await", "readFile", "(", "root", "+", "'/modules.dot'", ",", "'utf8'", ")", ";", "const", "svg", "=", "await", "viz", ".", "renderString", "(", "source", ")", ";", "await", "outputFile", "(", "root", "+", "'/modules.svg'", ",", "svg", ")", ";", "const", "buffer", "=", "await", "new", "Promise", "(", "(", "rs", ",", "rj", ")", "=>", "{", "sharp", "(", "root", "+", "'/modules.svg'", ")", ".", "toFormat", "(", "'png'", ")", ".", "toBuffer", "(", "(", "err", ",", "data", ")", "=>", "{", "if", "(", "err", ")", "return", "void", "rj", "(", "err", ")", ";", "rs", "(", "data", ")", ";", "}", ")", ";", "}", ")", ";", "await", "outputFile", "(", "root", "+", "'/modules.png'", ",", "buffer", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, 2, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
654
[ "import", "*", "as", "fs", "from", "'fs-extra'", ";", "import", "{", "load", "}", "from", "'js-yaml'", ";", "import", "{", "cliArgs", "}", "from", "'Builder/utils'", ";", "import", "{", "setConfig", "}", "from", "'Builder/taskList'", ";", "export", "default", "{", "beforeAll", ":", "[", "(", ")", "=>", "fs", ".", "emptyDir", "(", "`${", "process", ".", "cwd", "(", ")", "}/npm`", ")", ",", "async", "(", ")", "=>", "{", "process", ".", "env", ".", "IS_BUILD", "=", "'true'", ";", "}", ",", "async", "(", ")", "=>", "{", "if", "(", "cliArgs", ".", "current", ".", "length", "<", "1", ")", "return", ";", "const", "argRaw", "=", "cliArgs", ".", "current", "[", "0", "]", ";", "let", "body", ";", "try", "{", "body", "=", "load", "(", "argRaw", ")", ";", "}", "catch", "{", "return", ";", "}", "if", "(", "typeof", "body", "!==", "'object'", "||", "body", "===", "null", ")", "return", ";", "cliArgs", ".", "current", ".", "splice", "(", "0", ",", "1", ")", ";", "for", "(", "const", "field", "in", "body", ")", "{", "setConfig", "(", "field", ",", "body", "[", "field", "]", ")", ";", "}", "}", ",", "]", ",", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
655
[ "import", "Chalk", "from", "'chalk'", ";", "type", "TaskList", "=", "Array", "<", "(", ")", "=>", "Promise", "<", "any", ">", ">", ";", "type", "BoolRec", "=", "Record", "<", "string", ",", "boolean", ">", ";", "function", "onFinish", "(", "stats", ")", "{", "setConfig", "=", "noop", ";", "if", "(", "Object", ".", "keys", "(", "stats", ".", "fail", ")", ".", "length", "===", "0", ")", "{", "console", ".", "log", "(", "label", "(", "Chalk", ".", "bgGreen", ",", "'DONE'", ")", ",", "label", "(", "Chalk", ".", "bgWhite", ",", "'build complete'", ")", ",", "Chalk", ".", "greenBright", "(", "'all tasks finished successfully'", ")", ")", ";", "return", ";", "}", "console", ".", "log", "(", "label", "(", "Chalk", ".", "bgKeyword", "(", "'orange'", ")", ",", "'WARN'", ")", ",", "Chalk", ".", "bold", ".", "keyword", "(", "'orange'", ")", "(", "'some tasks failed'", ")", ")", ";", "for", "(", "const", "name", "in", "stats", ".", "fail", ")", "{", "console", ".", "log", "(", "Chalk", ".", "keyword", "(", "'orange'", ")", "(", "` - ${", "name", "}`", ")", ")", ";", "}", "process", ".", "exit", "(", "1", ")", ";", "}", "const", "label", "=", "(", "chalk", ",", "label", ")", "=>", "chalk", ".", "black", "(", "` ${", "label", "} `", ")", ";", "const", "run", "=", "(", "{", "tasks", ",", "name", ",", "stats", ",", "}", ")", "=>", "tasks", ".", "reduce", "(", "(", "p", ",", "task", ")", "=>", "p", ".", "then", "(", "task", ")", ",", "Promise", ".", "resolve", "(", ")", ")", ".", "then", "(", "(", ")", "=>", "{", "stats", ".", "done", "[", "name", "]", "=", "true", ";", "console", ".", "log", "(", "label", "(", "Chalk", ".", "bgGreen", ",", "'DONE'", ")", ",", "label", "(", "Chalk", ".", "bgWhite", ",", "name", ")", ",", "Chalk", ".", "greenBright", "(", "'task complete'", ")", ")", ";", "}", ")", ".", "catch", "(", "err", "=>", "{", "stats", ".", "done", "[", "name", "]", "=", "false", ";", "stats", ".", "fail", "[", "name", "]", "=", "err", ";", "console", ".", "log", "(", "label", "(", "Chalk", ".", "bgRed", ",", "'FAIL'", ")", ",", "label", "(", "Chalk", ".", "bgWhite", ",", "name", ")", ",", "Chalk", ".", "redBright", "(", "'task failed'", ")", ")", ";", "console", ".", "error", "(", "err", ")", ";", "}", ")", ";", "const", "noop", "=", "(", ")", "=>", "{", "}", ";", "type", "Config", "=", "{", "ignore", ":", "Array", "<", "string", ">", ";", "only", ":", "Array", "<", "string", ">", ";", "}", ";", "export", "let", "setConfig", "=", "noop", ";", "export", "function", "taskList", "(", "{", "tasks", ",", "hooks", ",", "}", ")", "{", "const", "pending", "=", "[", "]", "as", "Array", "<", "Promise", "<", "void", ">", ">", ";", "const", "stats", "=", "{", "done", ":", "{", "}", ",", "fail", ":", "{", "}", ",", "}", ";", "const", "config", "=", "{", "ignore", ":", "[", "]", ",", "only", ":", "[", "]", "}", ";", "setConfig", "=", "(", "field", ",", "data", ")", "=>", "{", "config", "[", "field", "]", "=", "data", ";", "}", ";", "return", "run", "(", "{", "tasks", ":", "hooks", ".", "beforeAll", ",", "name", ":", "'beforeAll'", ",", "stats", ",", "}", ")", ".", "then", "(", "(", ")", "=>", "{", "console", ".", "log", "(", "'running with config'", ")", ";", "console", ".", "dir", "(", "config", ")", ";", "for", "(", "const", "pkg", "in", "tasks", ")", "{", "if", "(", "config", ".", "ignore", ".", "includes", "(", "pkg", ")", ")", "continue", ";", "if", "(", "config", ".", "only", ".", "length", ">", "0", "&&", "!", "config", ".", "only", ".", "includes", "(", "pkg", ")", ")", "continue", ";", "pending", ".", "push", "(", "run", "(", "{", "tasks", ":", "tasks", "[", "pkg", "]", ",", "name", ":", "pkg", ",", "stats", ",", "}", ")", ")", ";", "}", "return", "Promise", ".", "all", "(", "pending", ")", ";", "}", ")", ".", "then", "(", "(", ")", "=>", "onFinish", "(", "stats", ")", ",", "(", ")", "=>", "onFinish", "(", "stats", ")", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
656
[ "import", "{", "taskList", "}", "from", "'./taskList'", ";", "import", "tasks", "from", "'../../tasks'", ";", "export", "const", "exec", "=", "(", ")", "=>", "taskList", "(", "tasks", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null ]
657
[ "const", "nameCache", "=", "{", "}", ";", "export", "const", "minifyConfig", "=", "(", "{", "beautify", ",", "inline", "=", "true", ",", "}", ")", "=>", "(", "{", "parse", ":", "{", "bare_returns", ":", "false", ",", "ecma", ":", "8", ",", "html5_comments", ":", "false", ",", "shebang", ":", "true", ",", "}", ",", "compress", ":", "{", "global_defs", ":", "{", "}", ",", "arrows", ":", "true", ",", "arguments", ":", "true", ",", "booleans", ":", "true", ",", "booleans_as_integers", ":", "true", ",", "collapse_vars", ":", "true", ",", "comparisons", ":", "true", ",", "computed_props", ":", "true", ",", "conditionals", ":", "true", ",", "dead_code", ":", "true", ",", "directives", ":", "true", ",", "drop_console", ":", "false", ",", "drop_debugger", ":", "true", ",", "ecma", ":", "8", ",", "evaluate", ":", "true", ",", "expression", ":", "true", ",", "hoist_funs", ":", "true", ",", "hoist_props", ":", "true", ",", "hoist_vars", ":", "false", ",", "if_return", ":", "true", ",", "inline", ",", "join_vars", ":", "true", ",", "defaults", ":", "false", ",", "keep_classnames", ":", "false", ",", "keep_fargs", ":", "false", ",", "keep_fnames", ":", "false", ",", "loops", ":", "true", ",", "module", ":", "true", ",", "properties", ":", "true", ",", "pure_getters", ":", "true", ",", "reduce_funcs", ":", "true", ",", "reduce_vars", ":", "true", ",", "sequences", ":", "true", ",", "side_effects", ":", "true", ",", "switches", ":", "true", ",", "toplevel", ":", "true", ",", "typeofs", ":", "true", ",", "unused", ":", "true", ",", "passes", ":", "3", ",", "unsafe_arrows", ":", "true", ",", "unsafe_Function", ":", "true", ",", "unsafe_math", ":", "true", ",", "unsafe_proto", ":", "true", ",", "}", ",", "mangle", ":", "{", "reserved", ":", "[", "'effector'", ",", "'effectorVue'", ",", "'effectorReact'", ",", "'it'", ",", "'test'", "]", ",", "eval", ":", "true", ",", "keep_classnames", ":", "false", ",", "keep_fnames", ":", "false", ",", "module", ":", "true", ",", "toplevel", ":", "true", ",", "safari10", ":", "false", ",", "}", ",", "output", ":", "{", "ascii_only", ":", "true", ",", "braces", ":", "false", ",", "comments", ":", "false", ",", "ecma", ":", "8", ",", "beautify", ",", "indent_level", ":", "2", ",", "inline_script", ":", "false", ",", "keep_quoted_props", ":", "false", ",", "quote_keys", ":", "false", ",", "quote_style", ":", "3", ",", "safari10", ":", "false", ",", "semicolons", ":", "true", ",", "shebang", ":", "true", ",", "webkit", ":", "false", ",", "wrap_iife", ":", "false", ",", "}", ",", "ecma", ":", "8", ",", "keep_classnames", ":", "false", ",", "keep_fnames", ":", "false", ",", "ie8", ":", "false", ",", "module", ":", "true", ",", "nameCache", ",", "safari10", ":", "false", ",", "toplevel", ":", "true", ",", "warnings", ":", "true", ",", "}", ")", ";" ]
[ null, 6, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
658
[ "import", "*", "as", "Path", "from", "'path'", ";", "import", "{", "outputFileSync", "}", "from", "'fs-extra'", ";", "import", "chroma", "from", "'chroma-js'", ";", "const", "scale", "=", "chroma", ".", "scale", "(", "[", "chroma", "(", "'#fafa6e'", ")", ".", "darken", "(", "2", ")", ",", "'#2A4858'", "]", ")", ".", "mode", "(", "'lch'", ")", ";", "function", "field", "(", "{", "name", ",", "value", ",", "quotes", "=", "false", ",", "}", ")", "{", "if", "(", "quotes", ")", "value", "=", "quote", "(", "value", ")", ";", "return", "`${", "name", "}=${", "value", "}`", ";", "}", "function", "quote", "(", "text", ")", "{", "return", "`\"${", "String", "(", "text", ")", "}\"`", ";", "}", "function", "definition", "(", "{", "name", ",", "spaces", ",", "props", "}", ")", "{", "const", "fieldsDef", "=", "[", "]", ";", "for", "(", "const", "key", "in", "props", ")", "{", "fieldsDef", ".", "push", "(", "{", "name", ":", "key", ",", "value", ":", "props", "[", "key", "]", ",", "quotes", ":", "false", ",", "}", ")", ";", "}", "const", "fieldsList", "=", "fieldsDef", ".", "map", "(", "field", ")", ";", "const", "flatProps", "=", "fieldsList", ".", "join", "(", "`, `", ")", ";", "const", "indent", "=", "Array", "(", "spaces", ")", ".", "fill", "(", "' '", ")", ".", "join", "(", "''", ")", ";", "return", "`${", "indent", "}${", "name", "} [${", "flatProps", "}];`", ";", "}", "function", "definitionMap", "(", "{", "spaces", ",", "defs", "}", ")", "{", "const", "resultList", "=", "[", "]", ";", "for", "(", "const", "name", "in", "defs", ")", "{", "resultList", ".", "push", "(", "{", "name", ",", "spaces", ",", "props", ":", "defs", "[", "name", "]", ",", "}", ")", ";", "}", "return", "resultList", ".", "map", "(", "definition", ")", ";", "}", "function", "toDot", "(", "modules", ",", "output", ")", "{", "const", "results", "=", "[", "]", ";", "results", ".", "push", "(", "'digraph G {'", ")", ";", "results", ".", "push", "(", "...", "definitionMap", "(", "{", "spaces", ":", "2", ",", "defs", ":", "{", "edge", ":", "{", "color", ":", "quote", "(", "'#999999'", ")", ",", "dir", ":", "'back'", ",", "}", ",", "node", ":", "{", "color", ":", "'white'", ",", "style", ":", "'filled'", ",", "fontsize", ":", "quote", "(", "'25px'", ")", ",", "}", ",", "graph", ":", "{", "fontsize", ":", "20", ",", "compound", ":", "true", ",", "}", ",", "}", ",", "}", ")", ")", ";", "results", ".", "push", "(", "' rankdir=TB;'", ")", ";", "results", ".", "push", "(", "' ranksep=\".95 equally\";'", ")", ";", "results", ".", "push", "(", "' ratio=auto;'", ")", ";", "let", "links", "=", "[", "]", ";", "const", "cwd", "=", "process", ".", "cwd", "(", ")", "+", "'/'", ";", "const", "modulesOnly", "=", "modules", ".", "map", "(", "md", "=>", "{", "const", "id", "=", "processPath", "(", "md", ".", "id", ")", ";", "const", "deps", "=", "md", ".", "deps", ".", "map", "(", "processPath", ")", ";", "return", "{", "id", ",", "deps", "}", ";", "}", ")", ";", "function", "processPath", "(", "path", ")", "{", "path", "=", "path", ".", "replace", "(", "cwd", ",", "''", ")", ";", "path", "=", "path", ".", "replace", "(", "'src/effector/'", ",", "''", ")", ";", "path", "=", "path", ".", "replace", "(", "'src/'", ",", "''", ")", ";", "path", "=", "path", ".", "replace", "(", "'.ts'", ",", "''", ")", ";", "path", "=", "path", ".", "replace", "(", "/(.+)\\/index$/", ",", "'$1'", ")", ";", "return", "path", ";", "}", "const", "moduleNames", "=", "new", "Set", "(", ")", ";", "modulesOnly", ".", "forEach", "(", "m", "=>", "{", "const", "from", "=", "m", ".", "id", ";", "moduleNames", ".", "add", "(", "from", ")", ";", "m", ".", "deps", ".", "forEach", "(", "dep", "=>", "{", "moduleNames", ".", "add", "(", "dep", ")", ";", "links", ".", "push", "(", "{", "from", ",", "to", ":", "dep", "}", ")", ";", "}", ")", ";", "}", ")", ";", "links", "=", "links", ".", "sort", "(", "(", "a", ",", "b", ")", "=>", "{", "if", "(", "a", ".", "from", "===", "b", ".", "from", ")", "{", "return", "a", ".", "to", ".", "localeCompare", "(", "b", ".", "to", ")", ";", "}", "return", "a", ".", "from", ".", "localeCompare", "(", "b", ".", "from", ")", ";", "}", ")", ";", "const", "moduleSet", "=", "[", "...", "moduleNames", "]", ";", "const", "nextID", "=", "(", "(", ")", "=>", "{", "let", "id", "=", "10", ";", "return", "(", ")", "=>", "`id_${", "(", "id", "++", ")", ".", "toString", "(", "36", ")", "}`", ";", "}", ")", "(", ")", ";", "const", "nameMap", "=", "{", "names", ":", "[", "]", ",", "nameOf", ":", "{", "}", ",", "idOf", ":", "{", "}", ",", "}", ";", "moduleSet", ".", "forEach", "(", "name", "=>", "{", "const", "id", "=", "nextID", "(", ")", ";", "nameMap", ".", "nameOf", "[", "id", "]", "=", "name", ";", "nameMap", ".", "idOf", "[", "name", "]", "=", "id", ";", "nameMap", ".", "names", ".", "push", "(", "name", ")", ";", "}", ")", ";", "let", "clusters", "=", "moduleSet", ".", "reduce", "(", "(", "acc", ",", "name", ")", "=>", "[", "...", "new", "Set", "(", "[", "...", "acc", ",", "name", ".", "split", "(", "'/'", ")", "[", "0", "]", "]", ")", "]", ",", "[", "]", ")", ".", "map", "(", "name", "=>", "(", "{", "name", ",", "childs", ":", "moduleSet", ".", "filter", "(", "n", "=>", "n", "===", "name", "||", "n", ".", "startsWith", "(", "`${", "name", "}/`", ")", ")", ",", "}", ")", ")", ";", "clusters", "=", "clusters", ".", "filter", "(", "(", "{", "name", "}", ",", "i", ",", "clusters", ")", "=>", "clusters", ".", "every", "(", "(", "{", "name", ":", "item", ",", "childs", "}", ")", "=>", "{", "if", "(", "item", "===", "name", ")", "return", "true", ";", "return", "!", "childs", ".", "includes", "(", "name", ")", ";", "}", ")", ")", ".", "filter", "(", "(", "{", "childs", "}", ")", "=>", "childs", ".", "length", ">", "1", ")", ";", "const", "freeNodes", "=", "new", "Set", "(", "moduleSet", ")", ";", "const", "clusterRoots", "=", "{", "roots", ":", "new", "Set", "(", ")", ",", "map", ":", "{", "}", ",", "colors", ":", "{", "}", ",", "clusterOf", ":", "{", "}", ",", "}", ";", "const", "colors", "=", "scale", ".", "colors", "(", "clusters", ".", "length", "+", "1", ")", ";", "clusters", ".", "forEach", "(", "(", "{", "name", ",", "childs", "}", ",", "i", ")", "=>", "{", "const", "color", "=", "colors", "[", "i", "+", "1", "]", ";", "const", "id", "=", "nextID", "(", ")", ";", "const", "cluster", "=", "[", "]", ";", "const", "clusterName", "=", "`cluster_${", "id", "}`", ";", "clusterRoots", ".", "colors", "[", "clusterName", "]", "=", "color", ";", "cluster", ".", "push", "(", "` subgraph ${", "clusterName", "} {`", ")", ";", "cluster", ".", "push", "(", "` style=\"rounded,bold\";`", ")", ";", "cluster", ".", "push", "(", "` color=\"${", "color", "}\";`", ")", ";", "cluster", ".", "push", "(", "definition", "(", "{", "name", ":", "'node'", ",", "spaces", ":", "4", ",", "props", ":", "{", "fontcolor", ":", "quote", "(", "color", ")", ",", "fontsize", ":", "quote", "(", "'25px'", ")", ",", "}", ",", "}", ")", ")", ";", "childs", ".", "forEach", "(", "childName", "=>", "{", "freeNodes", ".", "delete", "(", "childName", ")", ";", "const", "id", "=", "nameMap", ".", "idOf", "[", "childName", "]", ";", "clusterRoots", ".", "clusterOf", "[", "id", "]", "=", "clusterName", ";", "let", "visibleName", "=", "'/'", ";", "if", "(", "childName", "!==", "name", ")", "{", "visibleName", "=", "childName", ".", "slice", "(", "name", ".", "length", "+", "1", ")", ";", "}", "else", "{", "clusterRoots", ".", "roots", ".", "add", "(", "id", ")", ";", "clusterRoots", ".", "map", "[", "id", "]", "=", "clusterName", ";", "}", "cluster", ".", "push", "(", "definition", "(", "{", "name", ":", "id", ",", "spaces", ":", "4", ",", "props", ":", "{", "label", ":", "quote", "(", "visibleName", ")", ",", "group", ":", "quote", "(", "name", ")", ",", "}", ",", "}", ")", ")", ";", "}", ")", ";", "cluster", ".", "push", "(", "` fontcolor=\"${", "color", "}\";`", ")", ";", "cluster", ".", "push", "(", "` fontsize=\"45px\";`", ")", ";", "cluster", ".", "push", "(", "` label = \"${", "name", "}\";`", ")", ";", "cluster", ".", "push", "(", "` }`", ")", ";", "results", ".", "push", "(", "...", "cluster", ")", ";", "}", ")", ";", "freeNodes", ".", "forEach", "(", "name", "=>", "{", "const", "label", "=", "`\"${", "name", "}\"`", ";", "results", ".", "push", "(", "definition", "(", "{", "spaces", ":", "2", ",", "name", ":", "nameMap", ".", "idOf", "[", "name", "]", ",", "props", ":", "{", "label", ",", "fontsize", ":", "quote", "(", "'45px'", ")", ",", "}", ",", "}", ")", ")", ";", "}", ")", ";", "links", ".", "forEach", "(", "(", "{", "from", ",", "to", "}", ")", "=>", "{", "const", "fromId", "=", "nameMap", ".", "idOf", "[", "from", "]", ";", "const", "toId", "=", "nameMap", ".", "idOf", "[", "to", "]", ";", "let", "opts", "=", "' [style=\"dashed\"]'", ";", "const", "sameCluster", "=", "toId", "in", "clusterRoots", ".", "clusterOf", "&&", "clusterRoots", ".", "clusterOf", "[", "fromId", "]", "===", "clusterRoots", ".", "clusterOf", "[", "toId", "]", ";", "if", "(", "sameCluster", ")", "{", "const", "cluster", "=", "clusterRoots", ".", "clusterOf", "[", "fromId", "]", ";", "const", "color", "=", "clusterRoots", ".", "colors", "[", "cluster", "]", ";", "opts", "=", "` [style=\"bold\",color=\"${", "color", "}\"]`", ";", "}", "else", "if", "(", "clusterRoots", ".", "roots", ".", "has", "(", "toId", ")", ")", "{", "opts", "=", "` [style=\"dashed\",lhead=${", "clusterRoots", ".", "map", "[", "toId", "]", "}]`", ";", "}", "results", ".", "push", "(", "` ${", "fromId", "} -> ${", "toId", "}${", "opts", "};`", ")", ";", "}", ")", ";", "results", ".", "push", "(", "'}'", ")", ";", "const", "fullText", "=", "results", ".", "join", "(", "`\\n`", ")", ";", "if", "(", "nameMap", ".", "names", ".", "length", "===", "0", ")", "{", "console", ".", "log", "(", "'[moduleGraphGenerator] no modules given, return without writing results'", ")", ";", "return", ";", "}", "const", "outputPath", "=", "Path", ".", "resolve", "(", "process", ".", "cwd", "(", ")", ",", "output", ")", ";", "outputFileSync", "(", "outputPath", ",", "fullText", ")", ";", "}", "function", "prune", "(", "modules", ")", "{", "const", "avail", "=", "modules", ".", "filter", "(", "m", "=>", "m", ".", "deps", ".", "length", "==", "0", ")", ";", "if", "(", "!", "avail", ".", "length", ")", "{", "return", ";", "}", "const", "id", "=", "avail", "[", "0", "]", ".", "id", ";", "const", "index", "=", "modules", ".", "indexOf", "(", "avail", "[", "0", "]", ")", ";", "modules", ".", "splice", "(", "index", ",", "1", ")", ";", "modules", ".", "forEach", "(", "m", "=>", "{", "m", ".", "deps", "=", "m", ".", "deps", ".", "filter", "(", "dep", "=>", "dep", "!=", "id", ")", ";", "}", ")", ";", "prune", "(", "modules", ")", ";", "}", "function", "getPrefix", "(", "ids", ")", "{", "if", "(", "ids", ".", "length", "<", "2", ")", "{", "return", "''", ";", "}", "return", "ids", ".", "reduce", "(", "(", "prefix", ",", "val", ")", "=>", "{", "while", "(", "val", ".", "indexOf", "(", "prefix", ")", "!=", "0", ")", "{", "prefix", "=", "prefix", ".", "substring", "(", "0", ",", "prefix", ".", "length", "-", "1", ")", ";", "}", "return", "prefix", ";", "}", ")", ";", "}", "type", "Opts", "=", "{", "exclude", "?", ":", "string", ";", "prune", "?", ":", "boolean", ";", "output", "?", ":", "string", ";", "}", ";", "export", "default", "function", "plugin", "(", "options", "=", "{", "}", ")", "{", "const", "exclude", "=", "(", "str", ")", "=>", "options", ".", "exclude", "&&", "str", ".", "match", "(", "options", ".", "exclude", ")", ";", "return", "{", "generateBundle", "(", "bundleOptions", ",", "bundle", ",", "isWrite", ")", "{", "const", "ids", "=", "[", "]", ";", "for", "(", "const", "moduleId", "of", "this", ".", "moduleIds", ")", "{", "if", "(", "!", "exclude", "(", "moduleId", ")", ")", "{", "ids", ".", "push", "(", "moduleId", ")", ";", "}", "}", "const", "prefix", "=", "getPrefix", "(", "ids", ")", ";", "const", "strip", "=", "(", "str", ")", "=>", "str", ".", "substring", "(", "prefix", ".", "length", ")", ";", "const", "modules", "=", "[", "]", ";", "ids", ".", "forEach", "(", "id", "=>", "{", "const", "m", "=", "{", "id", ":", "strip", "(", "id", ")", ",", "deps", ":", "this", ".", "getModuleInfo", "(", "id", ")", ".", "importedIds", ".", "filter", "(", "x", "=>", "!", "exclude", "(", "x", ")", ")", ".", "map", "(", "strip", ")", ",", "}", ";", "if", "(", "exclude", "(", "m", ".", "id", ")", ")", "{", "return", ";", "}", "modules", ".", "push", "(", "m", ")", ";", "}", ")", ";", "if", "(", "Boolean", "(", "options", ".", "prune", ")", ")", "{", "prune", "(", "modules", ")", ";", "}", "try", "{", "toDot", "(", "modules", ",", "options", ".", "output", ")", ";", "}", "catch", "(", "error", ")", "{", "console", ".", "error", "(", "'error during graph generation'", ")", ";", "console", ".", "error", "(", "error", ")", ";", "}", "}", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1202, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
659
[ "const", "common", "=", "{", "author", ":", "'Zero Bias'", ",", "maintainers", ":", "[", "{", "name", ":", "'Zero Bias'", ",", "email", ":", "'[email protected]'", ",", "}", ",", "]", ",", "sideEffects", ":", "false", ",", "license", ":", "'MIT'", ",", "devDependencies", ":", "{", "}", ",", "scripts", ":", "{", "}", ",", "repository", ":", "'https://github.com/effector/effector'", ",", "bugs", ":", "'https://github.com/effector/effector/issues'", ",", "homepage", ":", "'https://effector.dev'", ",", "engines", ":", "{", "node", ":", "'>=11.0.0'", ",", "}", ",", "publishConfig", ":", "{", "access", ":", "'public'", ",", "}", ",", "funding", ":", "[", "{", "type", ":", "'patreon'", ",", "url", ":", "'https://www.patreon.com/zero_bias'", ",", "}", ",", "{", "type", ":", "'opencollective'", ",", "url", ":", "'https://opencollective.com/effector'", ",", "}", ",", "]", ",", "}", ";", "const", "keywords", "=", "[", "'state management'", ",", "'state manager'", ",", "'algebraic effects'", ",", "'model'", ",", "'reactive'", ",", "'state'", ",", "'frp'", ",", "'event'", ",", "'effect'", ",", "'functional'", ",", "'store'", ",", "]", ";", "const", "version", "=", "{", "effector", ":", "'22.1.2'", ",", "'effector-react'", ":", "'22.0.6'", ",", "'effector-vue'", ":", "'22.1.0'", ",", "forest", ":", "'0.20.2'", ",", "}", ";", "const", "issueUrl", "=", "(", "tag", ")", "=>", "`https://github.com/effector/effector/issues?q=is:issue+label:${", "tag", "}`", ";", "const", "compiledFile", "=", "(", "name", ")", "=>", "[", "`${", "name", "}.js`", ",", "`${", "name", "}.js.map`", "]", ";", "const", "esmFile", "=", "(", "name", ")", "=>", "[", "`${", "name", "}.mjs`", ",", "`${", "name", "}.mjs.map`", "]", ";", "const", "getFiles", "=", "(", "name", ")", "=>", "[", "'README.md'", ",", "'LICENSE'", ",", "'index.d.ts'", ",", "'index.js.flow'", ",", "...", "esmFile", "(", "name", ")", ",", "...", "compiledFile", "(", "`${", "name", "}.cjs`", ")", ",", "...", "compiledFile", "(", "`${", "name", "}.umd`", ")", ",", "...", "compiledFile", "(", "'compat'", ")", ",", "`${", "name", "}.cjs.js.flow`", ",", "`${", "name", "}.umd.js.flow`", ",", "'compat.js.flow'", ",", "`${", "name", "}.cjs.d.ts`", ",", "`${", "name", "}.mjs.d.ts`", ",", "`${", "name", "}.umd.d.ts`", ",", "'compat.d.ts'", ",", "]", ";", "const", "dependsOnEffector", "=", "{", "effector", ":", "`^${", "version", ".", "effector", "}`", ",", "}", ";", "export", "default", "{", "effector", ":", "{", "name", ":", "'effector'", ",", "version", ":", "version", "[", "'effector'", "]", ",", "description", ":", "'The state manager'", ",", "main", ":", "'effector.cjs.js'", ",", "module", ":", "'effector.mjs'", ",", "'umd:main'", ":", "'effector.umd.js'", ",", "'jsnext:main'", ":", "'effector.mjs'", ",", "typings", ":", "'index.d.ts'", ",", "dependencies", ":", "{", "}", ",", "exports", ":", "{", "'.'", ":", "{", "import", ":", "'./effector.mjs'", ",", "require", ":", "'./effector.cjs.js'", ",", "default", ":", "'./effector.mjs'", ",", "}", ",", "'./effector.mjs'", ":", "'./effector.mjs'", ",", "'./fork'", ":", "{", "import", ":", "'./fork.mjs'", ",", "require", ":", "'./fork.js'", ",", "default", ":", "'./fork.mjs'", ",", "}", ",", "'./compat'", ":", "'./compat.js'", ",", "'./effector.umd'", ":", "'./effector.umd.js'", ",", "'./babel-plugin'", ":", "'./babel-plugin.js'", ",", "'./babel-plugin-react'", ":", "'./babel-plugin-react.js'", ",", "'./package.json'", ":", "'./package.json'", ",", "}", ",", "files", ":", "[", "...", "getFiles", "(", "'effector'", ")", ",", "...", "compiledFile", "(", "'fork'", ")", ",", "...", "esmFile", "(", "'fork'", ")", ",", "'fork.d.ts'", ",", "'babel-plugin.js'", ",", "'babel-plugin-react.js'", ",", "]", ",", "keywords", ",", "...", "common", ",", "}", ",", "'effector-react'", ":", "{", "name", ":", "'effector-react'", ",", "version", ":", "version", "[", "'effector-react'", "]", ",", "description", ":", "'React bindings for effector'", ",", "main", ":", "'effector-react.cjs.js'", ",", "module", ":", "'effector-react.mjs'", ",", "exports", ":", "{", "'.'", ":", "{", "import", ":", "'./effector-react.mjs'", ",", "require", ":", "'./effector-react.cjs.js'", ",", "default", ":", "'./effector-react.mjs'", ",", "}", ",", "'./package.json'", ":", "'./package.json'", ",", "'./effector-react.mjs'", ":", "'./effector-react.mjs'", ",", "'./scope.mjs'", ":", "'./scope.mjs'", ",", "'./scope'", ":", "{", "import", ":", "'./scope.mjs'", ",", "require", ":", "'./scope.js'", ",", "default", ":", "'./scope.mjs'", ",", "}", ",", "'./ssr'", ":", "{", "import", ":", "'./ssr.mjs'", ",", "require", ":", "'./ssr.js'", ",", "default", ":", "'./ssr.mjs'", ",", "}", ",", "'./compat'", ":", "'./compat.js'", ",", "'./effector-react.umd'", ":", "'./effector-react.umd.js'", ",", "}", ",", "'umd:main'", ":", "'effector-react.umd.js'", ",", "'jsnext:main'", ":", "'effector-react.mjs'", ",", "typings", ":", "'index.d.ts'", ",", "peerDependencies", ":", "{", "react", ":", "'>=16.8.0 <19.0.0'", ",", "effector", ":", "'^22.0.2'", ",", "}", ",", "files", ":", "[", "...", "getFiles", "(", "'effector-react'", ")", ",", "...", "compiledFile", "(", "'scope'", ")", ",", "...", "esmFile", "(", "'scope'", ")", ",", "...", "compiledFile", "(", "'ssr'", ")", ",", "...", "esmFile", "(", "'ssr'", ")", ",", "'scope.d.ts'", ",", "'ssr.d.ts'", ",", "]", ",", "keywords", ":", "[", "'react'", ",", "'hooks'", ",", "...", "keywords", "]", ",", "...", "common", ",", "bugs", ":", "issueUrl", "(", "'effector-react,effector-react%2Fscope'", ")", ",", "}", ",", "'effector-vue'", ":", "{", "name", ":", "'effector-vue'", ",", "version", ":", "version", "[", "'effector-vue'", "]", ",", "description", ":", "'Vue bindings for effector'", ",", "main", ":", "'effector-vue.cjs.js'", ",", "module", ":", "'effector-vue.mjs'", ",", "exports", ":", "{", "'.'", ":", "{", "import", ":", "'./effector-vue.mjs'", ",", "require", ":", "'./effector-vue.cjs.js'", ",", "default", ":", "'./effector-vue.mjs'", ",", "}", ",", "'./composition'", ":", "{", "import", ":", "'./composition.mjs'", ",", "require", ":", "'./composition.cjs.js'", ",", "default", ":", "'./composition.mjs'", ",", "}", ",", "'./ssr'", ":", "{", "import", ":", "'./ssr.mjs'", ",", "require", ":", "'./ssr.cjs.js'", ",", "default", ":", "'./ssr.mjs'", ",", "}", ",", "'./effector-vue.mjs'", ":", "'./effector-vue.mjs'", ",", "'./composition.mjs'", ":", "'./composition.mjs'", ",", "'./ssr.mjs'", ":", "'./ssr.mjs'", ",", "'./compat'", ":", "'./compat.js'", ",", "'./effector-vue.umd'", ":", "'./effector-vue.umd.js'", ",", "}", ",", "'umd:main'", ":", "'effector-vue.umd.js'", ",", "'jsnext:main'", ":", "'effector-vue.mjs'", ",", "typings", ":", "'index.d.ts'", ",", "peerDependencies", ":", "{", "vue", ":", "'*'", ",", "effector", ":", "'^22.0.2'", ",", "'@vue/reactivity'", ":", "'^3.0.2'", ",", "'@vue/runtime-core'", ":", "'^3.0.2'", ",", "}", ",", "files", ":", "[", "...", "getFiles", "(", "'effector-vue'", ")", ",", "...", "compiledFile", "(", "'composition.cjs'", ")", ",", "...", "compiledFile", "(", "'ssr.cjs'", ")", ",", "...", "esmFile", "(", "'composition'", ")", ",", "...", "esmFile", "(", "'ssr'", ")", ",", "'composition.d.ts'", ",", "'composition.mjs.d.ts'", ",", "'composition.cjs.d.ts'", ",", "'ssr.d.ts'", ",", "'ssr.mjs.d.ts'", ",", "'ssr.cjs.d.ts'", ",", "]", ",", "keywords", ":", "[", "'vue'", ",", "'composition api'", ",", "...", "keywords", "]", ",", "...", "common", ",", "bugs", ":", "issueUrl", "(", "'effector-vue'", ")", ",", "}", ",", "forest", ":", "{", "name", ":", "'forest'", ",", "version", ":", "version", "[", "'forest'", "]", ",", "description", ":", "'UI engine for web'", ",", "main", ":", "'forest.cjs.js'", ",", "module", ":", "'forest.mjs'", ",", "exports", ":", "{", "'.'", ":", "{", "import", ":", "'./forest.mjs'", ",", "require", ":", "'./forest.cjs.js'", ",", "default", ":", "'./forest.mjs'", ",", "}", ",", "'./forest.mjs'", ":", "'./forest.mjs'", ",", "'./server'", ":", "{", "import", ":", "'./server.mjs'", ",", "require", ":", "'./server.js'", ",", "default", ":", "'./server.mjs'", ",", "}", ",", "'./forest.umd'", ":", "'./forest.umd.js'", ",", "}", ",", "'umd:main'", ":", "'forest.umd.js'", ",", "'jsnext:main'", ":", "'forest.mjs'", ",", "typings", ":", "'index.d.ts'", ",", "dependencies", ":", "{", "}", ",", "peerDependencies", ":", "dependsOnEffector", ",", "keywords", ":", "[", "...", "keywords", ",", "'dom'", ",", "'view'", "]", ",", "...", "common", ",", "bugs", ":", "issueUrl", "(", "'forest'", ")", ",", "}", ",", "}", ";" ]
[ null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, 2, null, null, null, null, null, null, null, 5, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
660
[ "import", "{", "resolve", ",", "join", ",", "relative", "}", "from", "'path'", ";", "import", "*", "as", "fs", "from", "'fs-extra'", ";", "import", "execa", "from", "'execa'", ";", "export", "const", "cliArgs", "=", "{", "current", ":", "process", ".", "argv", ".", "slice", "(", "2", ")", ",", "original", ":", "process", ".", "argv", ".", "slice", "(", "2", ")", ",", "}", ";", "const", "root", "=", "process", ".", "cwd", "(", ")", ";", "export", "function", "dir", "(", "...", "paths", ")", "{", "return", "resolve", "(", "root", ",", "...", "paths", ")", ";", "}", "export", "async", "function", "outputPackageJSON", "(", "path", ",", "config", ")", "{", "let", "fullPath", ";", "if", "(", "path", ".", "endsWith", "(", "'package.json'", ")", ")", "fullPath", "=", "dir", "(", "path", ")", ";", "else", "fullPath", "=", "dir", "(", "path", ",", "'package.json'", ")", ";", "await", "fs", ".", "outputJSON", "(", "fullPath", ",", "config", ",", "{", "spaces", ":", "2", "}", ")", ";", "}", "export", "function", "booleanEnv", "(", "value", ",", "defaults", ")", "{", "switch", "(", "value", ")", "{", "case", "'no'", ":", "case", "'false'", ":", "case", "false", ":", "return", "false", ";", "case", "'yes'", ":", "case", "'true'", ":", "case", "true", ":", "return", "true", ";", "case", "null", ":", "case", "undefined", ":", "default", ":", "return", "defaults", ";", "}", "}", "export", "function", "publishScript", "(", "name", ")", "{", "const", "onCatch", "=", "(", "error", ")", "=>", "{", "if", "(", "booleanEnv", "(", "process", ".", "env", ".", "PRINT_ERRORS", ",", "false", ")", ")", "{", "console", ".", "error", "(", "error", ")", ";", "}", "}", ";", "return", "async", "(", ")", "=>", "{", "const", "args", "=", "[", "...", "cliArgs", ".", "original", "]", ";", "if", "(", "args", ".", "length", "<", "2", ")", "return", ";", "const", "command", "=", "args", ".", "shift", "(", ")", ";", "const", "argument", "=", "args", ".", "shift", "(", ")", ";", "if", "(", "command", "===", "'publish'", ")", "{", "if", "(", "argument", "===", "'next'", ")", "{", "try", "{", "const", "{", "stdout", ",", "stderr", "}", "=", "await", "execa", "(", "'npm'", ",", "[", "'publish'", ",", "'--tag'", ",", "'next'", "]", ",", "{", "cwd", ":", "`${", "process", ".", "cwd", "(", ")", "}/npm/${", "name", "}`", ",", "env", ":", "process", ".", "env", ",", "}", ")", ";", "console", ".", "log", "(", "stdout", ")", ";", "console", ".", "error", "(", "stderr", ")", ";", "}", "catch", "(", "error", ")", "{", "onCatch", "(", "error", ")", ";", "}", "}", "else", "if", "(", "argument", "===", "'latest'", ")", "{", "try", "{", "const", "{", "stdout", ",", "stderr", "}", "=", "await", "execa", "(", "'npm'", ",", "[", "'publish'", ",", "'--tag'", ",", "'latest'", "]", ",", "{", "cwd", ":", "`${", "process", ".", "cwd", "(", ")", "}/npm/${", "name", "}`", ",", "env", ":", "process", ".", "env", ",", "}", ")", ";", "console", ".", "log", "(", "stdout", ")", ";", "console", ".", "error", "(", "stderr", ")", ";", "}", "catch", "(", "error", ")", "{", "onCatch", "(", "error", ")", ";", "}", "}", "}", "}", ";", "}", "export", "function", "massCopy", "(", "from", ",", "to", ",", "targets", ")", "{", "const", "jobs", "=", "[", "]", ";", "for", "(", "const", "target", "of", "targets", ")", "{", "if", "(", "typeof", "target", "===", "'string'", ")", "{", "jobs", ".", "push", "(", "[", "dir", "(", "from", ",", "target", ")", ",", "dir", "(", "to", ",", "target", ")", "]", ")", ";", "}", "else", "{", "const", "[", "fromFile", ",", "toFile", "]", "=", "target", ";", "if", "(", "typeof", "toFile", "===", "'string'", ")", "{", "jobs", ".", "push", "(", "[", "dir", "(", "from", ",", "fromFile", ")", ",", "dir", "(", "to", ",", "toFile", ")", "]", ")", ";", "}", "else", "{", "for", "(", "const", "toFileName", "of", "toFile", ")", "{", "jobs", ".", "push", "(", "[", "dir", "(", "from", ",", "fromFile", ")", ",", "dir", "(", "to", ",", "toFileName", ")", "]", ")", ";", "}", "}", "}", "}", "return", "Promise", ".", "all", "(", "jobs", ".", "map", "(", "(", "[", "from", ",", "to", "]", ")", "=>", "fs", ".", "copy", "(", "from", ",", "to", ")", ")", ")", ";", "}", "example", "export", "function", "getSourcemapPathTransform", "(", "name", ")", "{", "const", "nameWithoutSuffix", "=", "name", ".", "replace", "(", "'effector-'", ",", "''", ")", ".", "replace", "(", "'@effector/'", ",", "''", ")", ";", "const", "packageRoot", "=", "join", "(", "'../..'", ",", "'src'", ",", "nameWithoutSuffix", ")", ";", "return", "(", "relativePath", ")", "=>", "`${", "name", "}/${", "relative", "(", "packageRoot", ",", "relativePath", ")", "}`", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 2, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 2, null, 2, null, 13, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
661
[ "import", "{", "rollup", "}", "from", "'rollup'", ";", "import", "{", "babel", "}", "from", "'@rollup/plugin-babel'", ";", "import", "json", "from", "'@rollup/plugin-json'", ";", "import", "resolve", "from", "'@rollup/plugin-node-resolve'", ";", "import", "{", "terser", "}", "from", "'rollup-plugin-terser'", ";", "import", "commonjs", "from", "'@rollup/plugin-commonjs'", ";", "import", "{", "sizeSnapshot", "}", "from", "'rollup-plugin-size-snapshot'", ";", "import", "analyze", "from", "'rollup-plugin-visualizer'", ";", "import", "alias", "from", "'@rollup/plugin-alias'", ";", "import", "graphPlugin", "from", "'./moduleGraphGenerator'", ";", "import", "{", "dir", ",", "getSourcemapPathTransform", "}", "from", "'./utils'", ";", "import", "{", "minifyConfig", "}", "from", "'./minificationConfig'", ";", "const", "compatNameCache", "=", "{", "}", ";", "const", "onwarn", "=", "(", "warning", ",", "rollupWarn", ")", "=>", "{", "if", "(", "warning", ".", "code", "!==", "'CIRCULAR_DEPENDENCY'", "&&", "warning", ".", "code", "!==", "'NON_EXISTENT_EXPORT'", ")", "{", "rollupWarn", "(", "warning", ")", ";", "}", "}", ";", "const", "compatTarget", "=", "{", "browsers", ":", "[", "'Chrome 47'", ",", "'last 2 Firefox versions'", ",", "'last 2 Safari versions'", ",", "'last 2 Edge versions'", ",", "'IE 11'", ",", "]", ",", "}", ";", "const", "extensions", "=", "[", "'.js'", ",", "'.mjs'", ",", "'.ts'", ",", "'.tsx'", "]", ";", "const", "externals", "=", "[", "'effector'", ",", "'effector/effector.mjs'", ",", "'effector/compat'", ",", "'effector-react'", ",", "'effector-react/effector-react.mjs'", ",", "'effector-react/scope'", ",", "'effector-react/scope.mjs'", ",", "'effector-react/compat'", ",", "'effector-vue'", ",", "'effector-vue/effector-vue.mjs'", ",", "'effector-vue/compat'", ",", "'forest'", ",", "'forest/forest.mjs'", ",", "'forest/server'", ",", "'@vue/reactivity'", ",", "'@vue/runtime-core'", ",", "'vue'", ",", "'react'", ",", "]", ";", "const", "getPlugins", "=", "(", "name", ",", "{", "isEsm", "=", "false", ",", "replaceVueReactivity", "=", "false", ",", "replaceVueNext", "=", "false", "}", "=", "{", "}", ")", "=>", "(", "{", "babel", ":", "isEsm", "?", "babel", "(", "{", "babelHelpers", ":", "'bundled'", ",", "extensions", ",", "skipPreflightCheck", ":", "true", ",", "exclude", ":", "/node_modules.*/", ",", "babelrc", ":", "false", ",", "...", "require", "(", "'../babel.config'", ")", ".", "generateConfig", "(", "{", "isBuild", ":", "true", ",", "isTest", ":", "false", ",", "isCompat", ":", "false", ",", "isEsm", ":", "true", ",", "replaceVueReactivity", ",", "replaceVueNext", ",", "}", ")", ",", "}", ")", ":", "babel", "(", "{", "babelHelpers", ":", "'bundled'", ",", "skipPreflightCheck", ":", "true", ",", "extensions", ",", "exclude", ":", "/node_modules.*/", ",", "babelrc", ":", "false", ",", "...", "require", "(", "'../babel.config'", ")", ".", "generateConfig", "(", "{", "isBuild", ":", "true", ",", "isTest", ":", "false", ",", "isCompat", ":", "false", ",", "isEsm", ":", "false", ",", "replaceVueReactivity", ",", "replaceVueNext", ",", "}", ")", ",", "}", ")", ",", "commonjs", ":", "commonjs", "(", "{", "extensions", "}", ")", ",", "resolve", ":", "resolve", "(", "{", "extensions", "}", ")", ",", "sizeSnapshot", ":", "sizeSnapshot", "(", "{", "printInfo", ":", "false", ",", "}", ")", ",", "analyzer", ":", "analyze", "(", "{", "filename", ":", "`stats/${", "name", "}.html`", ",", "title", ":", "`${", "name", "} size report`", ",", "sourcemap", ":", "true", ",", "template", ":", "'treemap'", ",", "}", ")", ",", "analyzerJSON", ":", "analyze", "(", "{", "sourcemap", ":", "true", ",", "json", ":", "true", ",", "filename", ":", "`stats/${", "name", "}.json`", ",", "}", ")", ",", "terser", ":", "terser", "(", "minifyConfig", "(", "{", "beautify", ":", "!", "!", "process", ".", "env", ".", "PRETTIFY", ",", "inline", ":", "!", "name", ".", "endsWith", "(", "'.umd'", ")", ",", "}", ")", "as", "any", ")", ",", "graph", ":", "graphPlugin", "(", "{", "output", ":", "'modules.dot'", ",", "exclude", ":", "'effector/package.json'", ",", "}", ")", ",", "json", ":", "json", "(", "{", "preferConst", ":", "true", ",", "indent", ":", "' '", ",", "}", ")", ",", "alias", ":", "alias", "(", "{", "entries", ":", "{", "effector", ":", "dir", "(", "'src/effector'", ")", ",", "}", ",", "}", ")", ",", "}", ")", ";", "export", "async", "function", "rollupEffector", "(", ")", "{", "const", "name", "=", "'effector'", ";", "await", "Promise", ".", "all", "(", "[", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.cjs.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.mjs`", ")", ",", "}", ",", "renderModuleGraph", ":", "true", ",", "inputExtension", ":", "'ts'", ",", "}", ")", ",", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/fork.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/fork.mjs`", ")", ",", "}", ",", "input", ":", "'fork'", ",", "inputExtension", ":", "'ts'", ",", "}", ")", ",", "createUmd", "(", "name", ",", "{", "external", ":", "externals", ",", "file", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.umd.js`", ")", ",", "umdName", ":", "name", ",", "globals", ":", "{", "}", ",", "extension", ":", "'ts'", ",", "}", ")", ",", "createCompat", "(", "name", ",", "'ts'", ")", ",", "]", ")", ";", "}", "export", "async", "function", "rollupEffectorDom", "(", "{", "name", "}", ")", "{", "await", "Promise", ".", "all", "(", "[", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.cjs.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.mjs`", ")", ",", "}", ",", "inputExtension", ":", "'ts'", ",", "}", ")", ",", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/server.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/server.mjs`", ")", ",", "}", ",", "input", ":", "'server'", ",", "inputExtension", ":", "'ts'", ",", "}", ")", ",", "createUmd", "(", "name", ",", "{", "external", ":", "externals", ",", "file", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.umd.js`", ")", ",", "umdName", ":", "name", ",", "globals", ":", "{", "effector", ":", "'effector'", ",", "}", ",", "extension", ":", "'ts'", ",", "bundleEffector", ":", "false", ",", "}", ")", ",", "]", ")", ";", "}", "export", "async", "function", "rollupEffectorReact", "(", ")", "{", "const", "name", "=", "'effector-react'", ";", "await", "Promise", ".", "all", "(", "[", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.cjs.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.mjs`", ")", ",", "}", ",", "inputExtension", ":", "'ts'", ",", "}", ")", ",", "createSSR", "(", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/scope.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/scope.mjs`", ")", ",", "}", ",", "}", ")", ",", "createUmd", "(", "name", ",", "{", "external", ":", "externals", ",", "file", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.umd.js`", ")", ",", "umdName", ":", "'effectorReact'", ",", "globals", ":", "{", "effector", ":", "'effector'", ",", "react", ":", "'React'", ",", "}", ",", "extension", ":", "'ts'", ",", "}", ")", ",", "createCompat", "(", "name", ",", "'ts'", ")", ",", "]", ")", ";", "async", "function", "createSSR", "(", "{", "file", ":", "{", "cjs", ",", "es", "}", ",", "}", ")", "{", "await", "Promise", ".", "all", "(", "[", "runBuild", "(", "cjs", ",", "'cjs'", ")", ",", "runBuild", "(", "es", ",", "'es'", ")", ",", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/ssr.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/ssr.mjs`", ")", ",", "}", ",", "input", ":", "'ssr'", ",", "inputExtension", ":", "'ts'", ",", "}", ")", ",", "]", ")", ";", "async", "function", "runBuild", "(", "file", ",", "format", ")", "{", "const", "plugins", "=", "getPlugins", "(", "name", ",", "{", "isEsm", ":", "format", "===", "'es'", "}", ")", ";", "const", "pluginList", "=", "[", "plugins", ".", "resolve", ",", "plugins", ".", "json", ",", "plugins", ".", "babel", ",", "plugins", ".", "sizeSnapshot", ",", "plugins", ".", "terser", ",", "plugins", ".", "analyzer", ",", "plugins", ".", "analyzerJSON", ",", "]", ";", "const", "build", "=", "await", "rollup", "(", "{", "onwarn", ",", "input", ":", "dir", "(", "`packages/${", "name", "}/scope.ts`", ")", ",", "external", ":", "externals", ",", "plugins", ":", "pluginList", ",", "}", ")", ";", "await", "build", ".", "write", "(", "{", "file", ",", "format", ",", "freeze", ":", "false", ",", "name", ",", "sourcemap", ":", "true", ",", "sourcemapPathTransform", ":", "getSourcemapPathTransform", "(", "name", ")", ",", "externalLiveBindings", ":", "format", "===", "'es'", ",", "}", ")", ";", "}", "}", "}", "export", "async", "function", "rollupEffectorVue", "(", ")", "{", "const", "name", "=", "'effector-vue'", ";", "await", "Promise", ".", "all", "(", "[", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.cjs.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.mjs`", ")", ",", "}", ",", "inputExtension", ":", "'ts'", ",", "}", ")", ",", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/composition.cjs.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/composition.mjs`", ")", ",", "}", ",", "input", ":", "'composition'", ",", "inputExtension", ":", "'ts'", ",", "replaceVueReactivity", ":", "true", ",", "}", ")", ",", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "cjs", ":", "dir", "(", "`npm/${", "name", "}/ssr.cjs.js`", ")", ",", "es", ":", "dir", "(", "`npm/${", "name", "}/ssr.mjs`", ")", ",", "}", ",", "input", ":", "'ssr'", ",", "inputExtension", ":", "'ts'", ",", "replaceVueReactivity", ":", "true", ",", "}", ")", ",", "createUmd", "(", "name", ",", "{", "external", ":", "externals", ",", "file", ":", "dir", "(", "`npm/${", "name", "}/${", "name", "}.umd.js`", ")", ",", "umdName", ":", "'effectorVue'", ",", "globals", ":", "{", "effector", ":", "'effector'", ",", "vue", ":", "'Vue'", ",", "}", ",", "extension", ":", "'ts'", ",", "}", ")", ",", "createCompat", "(", "name", ",", "'ts'", ")", ",", "]", ")", ";", "}", "async", "function", "createUmd", "(", "name", ",", "{", "external", ",", "file", ",", "umdName", ",", "globals", ",", "extension", "=", "'js'", ",", "bundleEffector", "=", "false", "}", ")", "{", "const", "plugins", "=", "getPlugins", "(", "`${", "name", "}.umd`", ")", ";", "const", "build", "=", "await", "rollup", "(", "{", "onwarn", ",", "input", ":", "dir", "(", "`packages/${", "name", "}/index.${", "extension", "}`", ")", ",", "plugins", ":", "[", "plugins", ".", "resolve", ",", "plugins", ".", "json", ",", "plugins", ".", "babel", ",", "bundleEffector", "&&", "plugins", ".", "alias", ",", "plugins", ".", "commonjs", ",", "plugins", ".", "sizeSnapshot", ",", "plugins", ".", "terser", ",", "plugins", ".", "analyzer", ",", "plugins", ".", "analyzerJSON", ",", "]", ".", "filter", "(", "Boolean", ")", ",", "external", ",", "}", ")", ";", "await", "build", ".", "write", "(", "{", "file", ",", "format", ":", "'umd'", ",", "freeze", ":", "false", ",", "name", ":", "umdName", ",", "sourcemap", ":", "true", ",", "globals", ",", "}", ")", ";", "}", "async", "function", "createCompat", "(", "name", ",", "extension", "=", "'js'", ")", "{", "const", "plugins", "=", "getPlugins", "(", "`${", "name", "}.compat`", ")", ";", "const", "{", "getAliases", "}", "=", "require", "(", "'../babel.config'", ")", ";", "const", "terserConfig", "=", "minifyConfig", "(", "{", "beautify", ":", "!", "!", "process", ".", "env", ".", "PRETTIFY", ",", "}", ")", ";", "const", "pluginList", "=", "[", "plugins", ".", "resolve", ",", "plugins", ".", "json", ",", "babel", "(", "{", "babelHelpers", ":", "'bundled'", ",", "extensions", ",", "skipPreflightCheck", ":", "true", ",", "exclude", ":", "/node_modules.*/", ",", "babelrc", ":", "false", ",", "presets", ":", "[", "extension", "===", "'js'", "?", "'@babel/preset-flow'", ":", "[", "'@babel/preset-typescript'", ",", "{", "isTSX", ":", "true", ",", "allExtensions", ":", "true", ",", "}", ",", "]", ",", "[", "'@babel/preset-react'", ",", "{", "useBuiltIns", ":", "false", "}", "]", ",", "[", "'@babel/preset-env'", ",", "{", "loose", ":", "true", ",", "useBuiltIns", ":", "'entry'", ",", "corejs", ":", "3", ",", "modules", ":", "false", ",", "shippedProposals", ":", "true", ",", "targets", ":", "compatTarget", ",", "}", ",", "]", ",", "]", ",", "plugins", ":", "[", "'@babel/plugin-proposal-export-namespace-from'", ",", "'@babel/plugin-proposal-optional-chaining'", ",", "'@babel/plugin-proposal-nullish-coalescing-operator'", ",", "[", "'@babel/plugin-proposal-class-properties'", ",", "{", "loose", ":", "true", "}", "]", ",", "[", "'babel-plugin-module-resolver'", ",", "{", "alias", ":", "getAliases", "(", "{", "isBuild", ":", "true", ",", "isTest", ":", "false", ",", "isCompat", ":", "true", ",", "isEsm", ":", "false", ",", "}", ")", ",", "loglevel", ":", "'silent'", ",", "}", ",", "]", ",", "]", ",", "}", ")", ",", "plugins", ".", "commonjs", ",", "plugins", ".", "sizeSnapshot", ",", "terser", "(", "{", "...", "terserConfig", ",", "parse", ":", "{", "...", "terserConfig", ".", "parse", ",", "ecma", ":", "5", ",", "}", ",", "compress", ":", "{", "...", "terserConfig", ".", "compress", ",", "directives", ":", "false", ",", "ecma", ":", "5", ",", "}", ",", "mangle", ":", "{", "...", "terserConfig", ".", "mangle", ",", "safari10", ":", "true", ",", "}", ",", "output", ":", "{", "...", "terserConfig", ".", "output", ",", "ecma", ":", "5", ",", "safari10", ":", "true", ",", "webkit", ":", "true", ",", "}", ",", "ecma", ":", "5", ",", "nameCache", ":", "compatNameCache", ",", "safari10", ":", "true", ",", "}", ")", ",", "plugins", ".", "analyzer", ",", "plugins", ".", "analyzerJSON", ",", "]", ";", "const", "build", "=", "await", "rollup", "(", "{", "onwarn", ",", "input", ":", "dir", "(", "`packages/${", "name", "}/index.${", "extension", "}`", ")", ",", "external", ":", "externals", ",", "plugins", ":", "pluginList", ",", "}", ")", ";", "await", "build", ".", "write", "(", "{", "file", ":", "dir", "(", "`npm/${", "name", "}/compat.js`", ")", ",", "format", ":", "'cjs'", ",", "freeze", ":", "false", ",", "name", ",", "sourcemap", ":", "true", ",", "sourcemapPathTransform", ":", "getSourcemapPathTransform", "(", "name", ")", ",", "externalLiveBindings", ":", "false", ",", "}", ")", ";", "}", "async", "function", "createEsCjs", "(", "name", ",", "{", "file", ":", "{", "es", ",", "cjs", "}", ",", "renderModuleGraph", "=", "false", ",", "input", "=", "'index'", ",", "inputExtension", "=", "'js'", ",", "replaceVueReactivity", "=", "false", ",", "}", ")", "{", "const", "pluginsCjs", "=", "getPlugins", "(", "input", "===", "'index'", "?", "name", ":", "input", ",", "{", "replaceVueNext", ":", "true", ",", "}", ")", ";", "const", "pluginListCjs", "=", "[", "pluginsCjs", ".", "resolve", ",", "pluginsCjs", ".", "json", ",", "pluginsCjs", ".", "babel", ",", "pluginsCjs", ".", "sizeSnapshot", ",", "pluginsCjs", ".", "terser", ",", "pluginsCjs", ".", "analyzer", ",", "pluginsCjs", ".", "analyzerJSON", ",", "]", ";", "const", "pluginsEsm", "=", "getPlugins", "(", "input", "===", "'index'", "?", "name", ":", "input", ",", "{", "isEsm", ":", "true", ",", "replaceVueReactivity", ",", "replaceVueNext", ":", "true", ",", "}", ")", ";", "const", "pluginListEsm", "=", "[", "pluginsEsm", ".", "resolve", ",", "pluginsEsm", ".", "json", ",", "pluginsEsm", ".", "babel", ",", "pluginsEsm", ".", "sizeSnapshot", ",", "pluginsEsm", ".", "terser", ",", "pluginsEsm", ".", "analyzer", ",", "pluginsEsm", ".", "analyzerJSON", ",", "]", ";", "if", "(", "renderModuleGraph", ")", "{", "pluginListCjs", ".", "push", "(", "graphPlugin", "(", "{", "output", ":", "'modules.dot'", ",", "exclude", ":", "'effector/package.json'", ",", "}", ")", ")", ";", "}", "const", "[", "buildCjs", ",", "buildEs", "]", "=", "await", "Promise", ".", "all", "(", "[", "rollup", "(", "{", "onwarn", ",", "input", ":", "dir", "(", "`packages/${", "name", "}/${", "input", "}.${", "inputExtension", "}`", ")", ",", "external", ":", "externals", ",", "plugins", ":", "pluginListCjs", ",", "}", ")", ",", "es", "&&", "rollup", "(", "{", "onwarn", ",", "input", ":", "dir", "(", "`packages/${", "name", "}/${", "input", "}.${", "inputExtension", "}`", ")", ",", "external", ":", "externals", ",", "plugins", ":", "pluginListEsm", ",", "}", ")", ",", "]", ")", ";", "await", "Promise", ".", "all", "(", "[", "buildCjs", ".", "write", "(", "{", "file", ":", "cjs", ",", "format", ":", "'cjs'", ",", "freeze", ":", "false", ",", "name", ",", "sourcemap", ":", "true", ",", "sourcemapPathTransform", ":", "getSourcemapPathTransform", "(", "name", ")", ",", "externalLiveBindings", ":", "false", ",", "}", ")", ",", "es", "&&", "buildEs", ".", "write", "(", "{", "file", ":", "es", ",", "format", ":", "'es'", ",", "freeze", ":", "false", ",", "name", ",", "sourcemap", ":", "true", ",", "sourcemapPathTransform", ":", "getSourcemapPathTransform", "(", "name", ")", ",", "}", ")", ",", "]", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
662
[ "const", "ORIGIN_EVENT", "=", "Symbol", ".", "for", "(", "'ctx#origin_event'", ")", ";", "const", "EVENT", "=", "Symbol", ".", "for", "(", "'ctx#event'", ")", ";", "const", "EVENT_PARSED", "=", "Symbol", ".", "for", "(", "'ctx#event_parsed'", ")", ";", "const", "PARSED_EVENT", "=", "Symbol", ".", "for", "(", "'ctx#parsed_body'", ")", ";", "const", "BODY_PARSED", "=", "Symbol", ".", "for", "(", "'ctx#body_parsed'", ")", ";", "const", "BODY", "=", "Symbol", ".", "for", "(", "'ctx#body'", ")", ";", "export", "class", "Request", "{", "originEvent", ";", "constructor", "(", "event", ")", "{", "this", ".", "originEvent", "=", "event", ";", "this", "[", "ORIGIN_EVENT", "]", "=", "event", ";", "this", "[", "PARSED_EVENT", "]", "=", "null", ";", "}", "get", "[", "EVENT", "]", "(", ")", "{", "if", "(", "!", "this", "[", "EVENT_PARSED", "]", ")", "{", "this", "[", "EVENT_PARSED", "]", "=", "typeof", "this", "[", "ORIGIN_EVENT", "]", "===", "'object'", "?", "this", "[", "ORIGIN_EVENT", "]", ":", "JSON", ".", "parse", "(", "this", "[", "ORIGIN_EVENT", "]", "||", "'{}'", ")", ";", "this", "[", "ORIGIN_EVENT", "]", "=", "null", ";", "}", "return", "this", "[", "EVENT_PARSED", "]", ";", "}", "get", "ip", "(", ")", "{", "return", "this", "[", "EVENT", "]", ".", "requestContext", ".", "identity", ".", "sourceIp", ";", "}", "get", "url", "(", ")", "{", "return", "this", "[", "EVENT", "]", ".", "path", ";", "}", "get", "path", "(", ")", "{", "return", "this", "[", "EVENT", "]", ".", "path", ";", "}", "get", "method", "(", ")", "{", "return", "this", "[", "EVENT", "]", ".", "httpMethod", ";", "}", "get", "headers", "(", ")", "{", "return", "this", "[", "EVENT", "]", ".", "headers", ";", "}", "get", "query", "(", ")", "{", "return", "this", "[", "EVENT", "]", ".", "queryStringParameters", ";", "}", "get", "body", "(", ")", "{", "if", "(", "!", "this", "[", "BODY_PARSED", "]", ")", "{", "if", "(", "this", "[", "EVENT", "]", ".", "isBase64Encoded", ")", "{", "this", "[", "BODY", "]", "=", "Buffer", ".", "from", "(", "this", "[", "EVENT", "]", ".", "body", ",", "'base64'", ")", ".", "toString", "(", ")", ";", "}", "else", "{", "this", "[", "BODY", "]", "=", "this", "[", "EVENT", "]", ".", "body", ";", "}", "this", "[", "BODY_PARSED", "]", "=", "true", ";", "}", "return", "this", "[", "BODY", "]", ";", "}", "}", "export", "class", "Response", "{", "statusCode", ";", "headers", ";", "body", ";", "constructor", "(", ")", "{", "this", ".", "statusCode", "=", "200", ";", "this", ".", "headers", "=", "{", "}", ";", "this", ".", "body", "=", "null", ";", "}", "}", "export", "class", "Context", "{", "req", ";", "request", ";", "res", ";", "response", ";", "statusCode", ";", "requestId", ";", "credentials", ";", "function", ";", "constructor", "(", "event", ",", "context", ")", "{", "this", ".", "req", "=", "this", ".", "request", "=", "new", "Request", "(", "event", ")", ";", "this", ".", "res", "=", "this", ".", "response", "=", "new", "Response", "(", ")", ";", "this", ".", "requestId", "=", "context", ".", "requestId", ";", "this", ".", "credentials", "=", "context", ".", "credentials", ";", "this", ".", "function", "=", "context", ".", "function", ";", "}", "get", "headers", "(", ")", "{", "return", "this", ".", "req", ".", "headers", ";", "}", "get", "method", "(", ")", "{", "return", "this", ".", "req", ".", "method", ";", "}", "get", "path", "(", ")", "{", "return", "this", ".", "req", ".", "path", ";", "}", "get", "query", "(", ")", "{", "return", "this", ".", "req", ".", "query", ";", "}", "get", "ip", "(", ")", "{", "return", "this", ".", "req", ".", "ip", ";", "}", "get", "url", "(", ")", "{", "return", "this", ".", "req", ".", "url", ";", "}", "get", "(", "key", ")", "{", "return", "this", ".", "headers", "[", "key", "]", ";", "}", "set", "type", "(", "value", ")", "{", "this", ".", "res", ".", "headers", "[", "'content-type'", "]", "=", "value", ";", "}", "get", "type", "(", ")", "{", "return", "this", ".", "res", ".", "headers", "[", "'content-type'", "]", ";", "}", "set", "body", "(", "value", ")", "{", "this", ".", "res", ".", "body", "=", "value", ";", "}", "get", "body", "(", ")", "{", "return", "this", ".", "res", ".", "body", ";", "}", "set", "status", "(", "code", ")", "{", "this", ".", "res", ".", "statusCode", "=", "code", ";", "}", "get", "status", "(", ")", "{", "return", "this", ".", "res", ".", "statusCode", ";", "}", "set", "(", "key", ",", "value", ")", "{", "this", ".", "res", ".", "headers", "[", "key", "]", "=", "value", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
663
[ "import", "{", "FAAS_ARGS_KEY", ",", "ServerlessLightRuntime", ",", "}", "from", "'@midwayjs/runtime-engine'", ";", "import", "{", "AWSContext", ",", "AWSHTTPEvent", "}", "from", "'./interface'", ";", "import", "{", "Application", ",", "HTTPRequest", ",", "HTTPResponse", ",", "}", "from", "'@midwayjs/serverless-http-parser'", ";", "const", "isOutputError", "=", "(", ")", "=>", "{", "return", "(", "process", ".", "env", ".", "SERVERLESS_OUTPUT_ERROR_STACK", "===", "'true'", "||", "[", "'local'", ",", "'development'", "]", ".", "includes", "(", "process", ".", "env", ".", "MIDWAY_SERVER_ENV", ")", "||", "[", "'local'", ",", "'development'", "]", ".", "includes", "(", "process", ".", "env", ".", "NODE_ENV", ")", ")", ";", "}", ";", "export", "class", "AWSRuntime", "extends", "ServerlessLightRuntime", "{", "app", ";", "respond", ";", "async", "init", "(", ")", "{", "this", ".", "app", "=", "new", "Application", "(", ")", ";", "}", "param", "handler", "asyncEvent", "(", "handler", ")", "{", "if", "(", "handler", ".", "constructor", ".", "name", "!==", "'AsyncFunction'", ")", "{", "throw", "new", "TypeError", "(", "'Must be an AsyncFunction'", ")", ";", "}", "return", "(", "event", "=", "{", "}", ",", "context", "?", ")", "=>", "{", "if", "(", "isHttpEvent", "(", "event", ")", ")", "{", "return", "this", ".", "wrapperWebInvoker", "(", "handler", ",", "event", ",", "context", ")", ";", "}", "return", "this", ".", "wrapperEventInvoker", "(", "handler", ",", "event", ",", "context", ")", ";", "}", ";", "}", "async", "wrapperWebInvoker", "(", "handler", ",", "event", ",", "context", ")", "{", "if", "(", "!", "this", ".", "respond", ")", "{", "this", ".", "respond", "=", "this", ".", "app", ".", "callback", "(", ")", ";", "}", "const", "newReq", "=", "new", "HTTPRequest", "(", "event", ",", "context", ")", ";", "const", "newRes", "=", "new", "HTTPResponse", "(", ")", ";", "return", "this", ".", "respond", ".", "apply", "(", "this", ".", "respond", ",", "[", "newReq", ",", "newRes", ",", "ctx", "=>", "{", "return", "this", ".", "invokeHandlerWrapper", "(", "ctx", ",", "async", "(", ")", "=>", "{", "const", "args", "=", "[", "ctx", "]", ";", "if", "(", "ctx", ".", "method", "===", "'GET'", ")", "{", "if", "(", "ctx", ".", "query", "&&", "ctx", ".", "query", "[", "FAAS_ARGS_KEY", "]", ")", "{", "args", ".", "push", "(", "ctx", ".", "query", "[", "FAAS_ARGS_KEY", "]", ")", ";", "}", "}", "else", "if", "(", "ctx", ".", "method", "===", "'POST'", ")", "{", "if", "(", "ctx", ".", "req", "&&", "ctx", ".", "req", ".", "body", "&&", "ctx", ".", "req", ".", "body", "[", "FAAS_ARGS_KEY", "]", ")", "{", "args", ".", "push", "(", "ctx", ".", "req", ".", "body", "[", "FAAS_ARGS_KEY", "]", ")", ";", "}", "}", "return", "handler", ".", "apply", "(", "handler", ",", "args", ")", ";", "}", ")", ".", "then", "(", "result", "=>", "{", "if", "(", "result", ")", "{", "ctx", ".", "body", "=", "result", ";", "}", "const", "data", "=", "ctx", ".", "body", ";", "let", "encoded", "=", "false", ";", "if", "(", "typeof", "data", "===", "'string'", ")", "{", "if", "(", "!", "ctx", ".", "type", ")", "{", "ctx", ".", "type", "=", "'text/plain'", ";", "}", "ctx", ".", "body", "=", "data", ";", "}", "else", "if", "(", "Buffer", ".", "isBuffer", "(", "data", ")", ")", "{", "encoded", "=", "true", ";", "if", "(", "!", "ctx", ".", "type", ")", "{", "ctx", ".", "type", "=", "'application/octet-stream'", ";", "}", "ctx", ".", "body", "=", "data", ".", "toString", "(", "'base64'", ")", ";", "}", "else", "if", "(", "typeof", "data", "===", "'object'", ")", "{", "if", "(", "!", "ctx", ".", "type", ")", "{", "ctx", ".", "type", "=", "'application/json'", ";", "}", "ctx", ".", "body", "=", "JSON", ".", "stringify", "(", "data", ")", ";", "}", "return", "{", "isBase64Encoded", ":", "encoded", ",", "statusCode", ":", "ctx", ".", "status", ",", "headers", ":", "ctx", ".", "res", ".", "headers", ",", "body", ":", "ctx", ".", "body", ",", "}", ";", "}", ")", ".", "catch", "(", "err", "=>", "{", "ctx", ".", "logger", ".", "error", "(", "err", ")", ";", "return", "{", "isBase64Encoded", ":", "false", ",", "statusCode", ":", "err", ".", "status", "??", "500", ",", "headers", ":", "{", "}", ",", "body", ":", "isOutputError", "(", ")", "?", "err", ".", "stack", ":", "'Internal Server Error'", ",", "}", ";", "}", ")", ";", "}", ",", "]", ")", ";", "}", "async", "wrapperEventInvoker", "(", "handler", ",", "event", ",", "context", ")", "{", "const", "args", "=", "[", "context", "]", ";", "if", "(", "event", "&&", "event", "[", "FAAS_ARGS_KEY", "]", ")", "{", "args", ".", "push", "(", "event", "[", "FAAS_ARGS_KEY", "]", ")", ";", "}", "else", "{", "args", ".", "push", "(", "event", ")", ";", "}", "return", "this", ".", "invokeHandlerWrapper", "(", "context", ",", "async", "(", ")", "=>", "{", "return", "handler", ".", "apply", "(", "handler", ",", "args", ")", ";", "}", ")", ";", "}", "getApplication", "(", ")", "{", "return", "this", ".", "app", ";", "}", "getFunctionName", "(", ")", "{", "return", "process", ".", "env", ".", "AWS_LAMBDA_FUNCTION_NAME", "||", "super", ".", "getFunctionName", "(", ")", ";", "}", "getFunctionServiceName", "(", ")", "{", "return", "super", ".", "getFunctionServiceName", "(", ")", ";", "}", "}", "function", "isHttpEvent", "(", "event", ")", "{", "return", "event", ".", "httpMethod", "&&", "event", ".", "headers", "&&", "event", ".", "requestContext", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, 37603, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, 0, null, 37603, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3016, null, null, null, null, null, null, null, null, null, null, 4671, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, 37603, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
664
[ "import", "{", "BaseRuntimeEngine", ",", "LightRuntime", "}", "from", "'@midwayjs/runtime-engine'", ";", "import", "{", "AWSRuntime", "}", "from", "'./runtime'", ";", "export", "{", "asyncWrapper", "}", "from", "'@midwayjs/runtime-engine'", ";", "export", "const", "start", "=", "async", "(", ")", "=>", "{", "if", "(", "!", "process", ".", "env", ".", "NODE_ENV", ")", "{", "process", ".", "env", ".", "NODE_ENV", "=", "'production'", ";", "}", "const", "runtimeEngine", "=", "new", "BaseRuntimeEngine", "(", ")", ";", "runtimeEngine", ".", "add", "(", "engine", "=>", "{", "engine", ".", "addBaseRuntime", "(", "new", "AWSRuntime", "(", ")", ")", ";", "}", ")", ";", "await", "runtimeEngine", ".", "ready", "(", ")", ";", "return", "runtimeEngine", ".", "getCurrentRuntime", "(", ")", "as", "LightRuntime", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, 46484, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
665
[ "import", "{", "Injectable", "}", "from", "'@angular/core'", ";", "import", "BigNumber", "from", "'bignumber.js'", ";", "import", "{", "Observable", "}", "from", "'rxjs'", ";", "import", "{", "IAllKey", "}", "from", "'../types/IAllKey'", ";", "declare", "var", "Bitcoin", ",", "Crypto", ";", "@", "Injectable", "(", "{", "providedIn", ":", "'root'", ",", "}", ")", "export", "class", "AllKeyService", "{", "constructor", "(", ")", "{", "}", "getData", "(", "page", ",", "limitPerPage", ")", "{", "return", "new", "Observable", "<", "IAllKey", "[", "]", ">", "(", "(", "observer", ")", "=>", "{", "const", "itesm", "=", "[", "]", ";", "const", "addresses", "=", "[", "]", ";", "for", "(", "let", "index", "=", "0", ";", "index", "<", "limitPerPage", ";", "index", "++", ")", "{", "const", "id", "=", "new", "BigNumber", "(", "page", ")", ".", "minus", "(", "1", ")", ".", "multipliedBy", "(", "limitPerPage", ")", ".", "plus", "(", "index", "+", "1", ")", ".", "toString", "(", "16", ")", ";", "const", "addressUnCompressed", "=", "this", ".", "getAddress", "(", "id", ",", "false", ")", ";", "const", "addressCompressed", "=", "this", ".", "getAddress", "(", "id", ",", "true", ")", ";", "const", "privateKey", "=", "this", ".", "getPrivateKey", "(", "id", ")", ";", "addresses", ".", "push", "(", "addressUnCompressed", ")", ";", "addresses", ".", "push", "(", "addressCompressed", ")", ";", "itesm", ".", "push", "(", "{", "id", ",", "privateKey", ",", "addressUnCompressed", ",", "addressUnCompressedBalance", ":", "null", ",", "addressUnCompressedReceived", ":", "null", ",", "addressCompressed", ",", "addressCompressedBalance", ":", "null", ",", "addressCompressedReceived", ":", "null", ",", "}", ")", ";", "}", "observer", ".", "next", "(", "itesm", ")", ";", "}", ")", ";", "}", "private", "getAddress", "(", "id", ",", "compressed", ")", "{", "const", "bytes", "=", "Crypto", ".", "util", ".", "hexToBytes", "(", "id", ")", ";", "const", "btcKey", "=", "new", "Bitcoin", ".", "ECKey", "(", "bytes", ")", ";", "btcKey", ".", "compressed", "=", "compressed", ";", "const", "address", "=", "btcKey", ".", "getBitcoinAddress", "(", ")", ".", "toString", "(", ")", ";", "return", "address", ";", "}", "private", "getPrivateKey", "(", "id", ")", "{", "const", "bytes", "=", "Crypto", ".", "util", ".", "hexToBytes", "(", "id", ".", "toString", "(", ")", ")", ";", "const", "btcKey", "=", "new", "Bitcoin", ".", "ECKey", "(", "bytes", ")", ";", "const", "privateKey", "=", "btcKey", ".", "getExportedPrivateKey", "(", ")", ";", "return", "privateKey", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 18, null, 2, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, 396, null, null, null, null, 5, null, null, null, null, null, 5, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
666
[ "import", "{", "HttpClient", "}", "from", "'@angular/common/http'", ";", "import", "{", "Injectable", "}", "from", "'@angular/core'", ";", "import", "{", "Observable", "}", "from", "'rxjs'", ";", "import", "{", "map", ",", "shareReplay", "}", "from", "'rxjs/operators'", ";", "@", "Injectable", "(", "{", "providedIn", ":", "'root'", ",", "}", ")", "export", "class", "BalanceService", "{", "constructor", "(", "private", "_httpClient", ")", "{", "}", "getBalance", "(", "addresses", ")", "{", "const", "requestUrl", "=", "`https://blockchain.info/balance?cors=true&active=${", "addresses", ".", "join", "(", "','", ")", "}`", ";", "const", "obser", "=", "this", ".", "_httpClient", ".", "get", "<", "any", ">", "(", "requestUrl", ")", ";", "return", "obser", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 160, null, null, null, 18, null, 5, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 18, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
667
[ "import", "{", "Component", ",", "ChangeDetectorRef", ",", "OnInit", "}", "from", "'@angular/core'", ";", "import", "{", "ActivatedRoute", ",", "Router", "}", "from", "'@angular/router'", ";", "import", "BigNumber", "from", "'bignumber.js'", ";", "import", "{", "of", "as", "observableOf", "}", "from", "'rxjs'", ";", "import", "{", "catchError", ",", "map", "}", "from", "'rxjs/operators'", ";", "import", "{", "AllKeyService", "}", "from", "'../services/all-key.service'", ";", "import", "{", "BalanceService", "}", "from", "'../services/balance.service'", ";", "import", "{", "IAllKey", "}", "from", "'../types/IAllKey'", ";", "@", "Component", "(", "{", "selector", ":", "'app-home'", ",", "templateUrl", ":", "'./home.component.html'", ",", "styleUrls", ":", "[", "'./home.component.scss'", "]", ",", "}", ")", "export", "class", "HomeComponent", "implements", "OnInit", "{", "displayedColumns", ":", "string", "[", "]", "=", "[", "'privateKey'", ",", "'addressUnCompressed'", ",", "'addressUnCompressedBalance'", ",", "'addressUnCompressedReceived'", ",", "'addressCompressed'", ",", "'addressCompressedBalance'", ",", "'addressCompressedReceived'", ",", "]", ";", "data", ":", "IAllKey", "[", "]", "=", "[", "]", ";", "maxNumber", "=", "new", "BigNumber", "(", "'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'", ",", "16", ")", ";", "page", "=", "'1'", ";", "limitPerPage", "=", "16", ";", "resultsLength", "=", "this", ".", "maxNumber", ".", "toString", "(", "10", ")", ";", "maxPage", "=", "this", ".", "maxNumber", ".", "dividedBy", "(", "this", ".", "limitPerPage", ")", ".", "toFixed", "(", "0", ")", ";", "isLoadingResults", "=", "true", ";", "isError", "=", "false", ";", "constructor", "(", "private", "allKeyService", ",", "private", "cdr", ",", "private", "route", ",", "private", "router", ",", "private", "balanceService", ")", "{", "}", "ngOnInit", "(", ")", "{", "this", ".", "route", ".", "queryParamMap", ".", "subscribe", "(", "(", "params", ")", "=>", "{", "this", ".", "page", "=", "params", ".", "get", "(", "'page'", ")", "||", "'1'", ";", "this", ".", "getData", "(", ")", ";", "}", ")", ";", "}", "onOlder", "(", ")", "{", "this", ".", "page", "=", "new", "BigNumber", "(", "this", ".", "page", ")", ".", "minus", "(", "1", ")", ".", "toString", "(", "10", ")", ";", "if", "(", "this", ".", "page", "===", "'0'", ")", "{", "this", ".", "page", "=", "'1'", ";", "}", "this", ".", "router", ".", "navigate", "(", "[", "'/home'", "]", ",", "{", "queryParams", ":", "{", "page", ":", "this", ".", "page", "}", "}", ")", ";", "}", "onNewer", "(", ")", "{", "this", ".", "page", "=", "new", "BigNumber", "(", "this", ".", "page", ")", ".", "plus", "(", "1", ")", ".", "toString", "(", "10", ")", ";", "if", "(", "new", "BigNumber", "(", "this", ".", "page", ")", ".", "isGreaterThan", "(", "this", ".", "maxPage", ")", ")", "{", "this", ".", "page", "=", "this", ".", "maxPage", ";", "}", "this", ".", "router", ".", "navigate", "(", "[", "'/home'", "]", ",", "{", "queryParams", ":", "{", "page", ":", "this", ".", "page", "}", "}", ")", ";", "}", "getData", "(", ")", "{", "this", ".", "isLoadingResults", "=", "true", ";", "this", ".", "data", "=", "[", "]", ";", "this", ".", "allKeyService", ".", "getData", "(", "this", ".", "page", ",", "this", ".", "limitPerPage", ")", ".", "pipe", "(", "map", "(", "(", "data", ")", "=>", "{", "this", ".", "isLoadingResults", "=", "false", ";", "this", ".", "isError", "=", "false", ";", "return", "data", ";", "}", ")", ",", "catchError", "(", "(", "err", ")", "=>", "{", "console", ".", "error", "(", "err", ")", ";", "this", ".", "isLoadingResults", "=", "false", ";", "this", ".", "isError", "=", "true", ";", "return", "observableOf", "(", "[", "]", ")", ";", "}", ")", ")", ".", "subscribe", "(", "async", "(", "data", ")", "=>", "{", "this", ".", "data", "=", "data", ";", "const", "addresses", "=", "[", "]", ";", "for", "(", "const", "key", "in", "data", ")", "{", "const", "item", "=", "data", "[", "key", "]", ";", "addresses", ".", "push", "(", "item", ".", "addressCompressed", ")", ";", "addresses", ".", "push", "(", "item", ".", "addressUnCompressed", ")", ";", "}", "const", "balanceList", "=", "await", "this", ".", "balanceService", ".", "getBalance", "(", "addresses", ")", ".", "toPromise", "(", ")", ";", "this", ".", "data", "=", "this", ".", "data", ".", "map", "(", "(", "item", ")", "=>", "{", "item", ".", "addressCompressedBalance", "=", "this", ".", "getBalance", "(", "item", ".", "addressCompressed", ",", "balanceList", ",", "'final_balance'", ")", ";", "item", ".", "addressCompressedReceived", "=", "this", ".", "getBalance", "(", "item", ".", "addressCompressed", ",", "balanceList", ",", "'total_received'", ")", ";", "item", ".", "addressUnCompressedBalance", "=", "this", ".", "getBalance", "(", "item", ".", "addressUnCompressed", ",", "balanceList", ",", "'final_balance'", ")", ";", "item", ".", "addressUnCompressedReceived", "=", "this", ".", "getBalance", "(", "item", ".", "addressUnCompressed", ",", "balanceList", ",", "'total_received'", ")", ";", "return", "item", ";", "}", ")", ";", "}", ")", ";", "}", "getBalance", "(", "address", ",", "balanceList", ",", "type", ")", "{", "const", "balance", "=", "balanceList", "[", "address", "]", ";", "return", "balance", "?", "balance", "[", "type", "]", ":", "'Error'", ";", "}", "ngAfterViewChecked", "(", ")", "{", "this", ".", "cdr", ".", "detectChanges", "(", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, 170, null, null, 179, null, null, 55, null, null, 0, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, 2113, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 2, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null ]
668
[ "import", "{", "Pipe", ",", "PipeTransform", "}", "from", "'@angular/core'", ";", "@", "Pipe", "(", "{", "name", ":", "'balance'", ",", "pure", ":", "false", ",", "}", ")", "export", "class", "BalancePipe", "implements", "PipeTransform", "{", "transform", "(", "value", ")", "{", "return", "value", "!==", "null", "?", "parseFloat", "(", "value", ".", "toString", "(", ")", ")", "/", "Math", ".", "pow", "(", "10", ",", "8", ")", "+", "' BTC'", ":", "'Loading...'", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
669
[ "export", "const", "environment", "=", "{", "production", ":", "false", "}", ";" ]
[ null, null, 6, null, null, null, null, null, null, null ]
670
[ "import", "{", "BalancePipe", "}", "from", "'./balance.pipe'", ";", "describe", "(", "'BalancePipe'", ",", "(", ")", "=>", "{", "it", "(", "'create an instance'", ",", "(", ")", "=>", "{", "const", "pipe", "=", "new", "BalancePipe", "(", ")", ";", "expect", "(", "pipe", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
671
[ "import", "{", "TestBed", "}", "from", "'@angular/core/testing'", ";", "import", "{", "AllKeyService", "}", "from", "'./all-key.service'", ";", "describe", "(", "'AllKeyService'", ",", "(", ")", "=>", "{", "let", "service", ";", "beforeEach", "(", "(", ")", "=>", "{", "TestBed", ".", "configureTestingModule", "(", "{", "}", ")", ";", "service", "=", "TestBed", ".", "inject", "(", "AllKeyService", ")", ";", "}", ")", ";", "it", "(", "'should be created'", ",", "(", ")", "=>", "{", "expect", "(", "service", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
672
[ "import", "{", "TestBed", "}", "from", "'@angular/core/testing'", ";", "import", "{", "BalanceService", "}", "from", "'./balance.service'", ";", "describe", "(", "'BalanceService'", ",", "(", ")", "=>", "{", "let", "service", ";", "beforeEach", "(", "(", ")", "=>", "{", "TestBed", ".", "configureTestingModule", "(", "{", "}", ")", ";", "service", "=", "TestBed", ".", "inject", "(", "BalanceService", ")", ";", "}", ")", ";", "it", "(", "'should be created'", ",", "(", ")", "=>", "{", "expect", "(", "service", ")", ".", "toBeTruthy", "(", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
673
[ "export", "const", "environment", "=", "{", "production", ":", "true", "}", ";" ]
[ null, null, 6, null, null, null, null, null, null, null ]
674
[ "import", "{", "curry", "}", "from", "'@arrows/composition/curry'", ";", "type", "_CharAt", "=", "(", "index", ":", "number", ",", "str", ":", "string", ")", "=>", "string", ";", "type", "_CharAt2", "=", "(", "index", ":", "number", ")", "=>", "(", "str", ":", "string", ")", "=>", "string", ";", "type", "CharAt", "=", "_CharAt", "&", "_CharAt2", ";", "const", "_charAt", "=", "(", "index", ",", "str", ")", "=>", "str", ".", "charAt", "(", "index", ")", ";", "param", "index", "param", "str", "returns", "const", "charAt", "=", "curry", "(", "_charAt", ")", ";", "export", "{", "charAt", "}", ";", "export", "default", "charAt", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, 3, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
675
[ "import", "{", "curry", "}", "from", "'@arrows/composition/curry'", ";", "type", "_CharCodeAt", "=", "(", "index", ":", "number", ",", "str", ":", "string", ")", "=>", "number", ";", "type", "_CharCodeAt2", "=", "(", "index", ":", "number", ")", "=>", "(", "str", ":", "string", ")", "=>", "number", ";", "type", "CharCodeAt", "=", "_CharCodeAt", "&", "_CharCodeAt2", ";", "const", "_charCodeAt", "=", "(", "index", ",", "str", ")", "=>", "str", ".", "charCodeAt", "(", "index", ")", ";", "param", "index", "param", "str", "returns", "const", "charCodeAt", "=", "curry", "(", "_charCodeAt", ")", ";", "export", "{", "charCodeAt", "}", ";", "export", "default", "charCodeAt", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, 3, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
676
[ "import", "{", "curry", "}", "from", "'@arrows/composition/curry'", ";", "type", "_CodePointAt", "=", "(", "pos", ":", "number", ",", "str", ":", "string", ")", "=>", "number", "|", "undefined", ";", "type", "_CodePointAt2", "=", "(", "pos", ":", "number", ")", "=>", "(", "str", ":", "string", ")", "=>", "number", "|", "undefined", ";", "type", "CodePointAt", "=", "_CodePointAt", "&", "_CodePointAt2", ";", "const", "_codePointAt", "=", "(", "pos", ",", "str", ")", "=>", "str", ".", "codePointAt", "(", "pos", ")", ";", "param", "pos", "param", "str", "returns", "const", "codePointAt", "=", "curry", "(", "_codePointAt", ")", ";", "export", "{", "codePointAt", "}", ";", "export", "default", "codePointAt", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, 3, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
677
[ "import", "{", "curry", "}", "from", "'@arrows/composition/curry'", ";", "type", "_Concat", "=", "(", "strToAdd", ":", "string", ",", "str", ":", "string", ")", "=>", "string", ";", "type", "_Concat2", "=", "(", "strToAdd", ":", "string", ")", "=>", "(", "str", ":", "string", ")", "=>", "string", ";", "type", "Concat", "=", "_Concat", "&", "_Concat2", ";", "const", "_concat", "=", "(", "strToAdd", ",", "str", ")", "=>", "str", ".", "concat", "(", "strToAdd", ")", ";", "param", "strToAdd", "param", "str", "returns", "const", "concat", "=", "curry", "(", "_concat", ")", ";", "export", "{", "concat", "}", ";", "export", "default", "concat", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6888, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
678
[ "function", "range", "(", "from", ",", "to", ")", ";", "function", "range", "(", "from", ",", "to", ")", "{", "if", "(", "typeof", "from", "!==", "\"number\"", "||", "typeof", "to", "!==", "\"number\"", ")", "{", "throw", "Error", "(", "\"range() expects exactly 2 numbers\"", ")", ";", "}", "const", "values", "=", "[", "]", ";", "for", "(", "let", "i", "=", "from", ";", "i", "<", "to", ";", "i", "++", ")", "{", "values", ".", "push", "(", "i", ")", ";", "}", "return", "values", ";", "}", "console", ".", "log", "(", "range", "(", "0", ",", "5", ")", ")", ";" ]
[ null, 5, null, 3, null, 3, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
679
[ "const", "mode", "=", "process", ".", "env", ".", "NODE_ENV", "===", "'production'", "?", "'production'", ":", "'development'", ";", "const", "client", "=", "{", "mode", ",", "name", ":", "'client'", ",", "target", ":", "'web'", ",", "entry", ":", "'./src/client.ts'", ",", "output", ":", "{", "path", ":", "__dirname", "+", "'/dist/client'", ",", "filename", ":", "'main.js'", ",", "}", ",", "resolve", ":", "{", "extensions", ":", "[", "'.ts'", ",", "'.tsx'", ",", "'.js'", "]", ",", "}", ",", "module", ":", "{", "rules", ":", "[", "{", "test", ":", "/\\.tsx?$/", ",", "loader", ":", "'ts-loader'", "}", ",", "]", ",", "}", ",", "}", ";", "const", "server", "=", "{", "mode", ",", "name", ":", "'server'", ",", "target", ":", "'node'", ",", "dependencies", ":", "[", "client", ".", "name", "]", ",", "entry", ":", "'./src/server.ts'", ",", "node", ":", "{", "__filename", ":", "false", ",", "__dirname", ":", "false", ",", "}", ",", "output", ":", "{", "path", ":", "__dirname", "+", "'/dist/server'", ",", "filename", ":", "'main.js'", ",", "libraryTarget", ":", "'commonjs2'", ",", "}", ",", "resolve", ":", "{", "extensions", ":", "[", "'.ts'", ",", "'.tsx'", ",", "'.js'", "]", ",", "}", ",", "module", ":", "{", "rules", ":", "[", "{", "test", ":", "/\\.tsx?$/", ",", "loader", ":", "'ts-loader'", "}", ",", "]", ",", "}", ",", "}", ";", "export", "=", "[", "client", ",", "server", "]", ";" ]
[ null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
680
[ "export", "function", "delayedPromise", "(", ")", "{", "return", "new", "Promise", "<", "void", ">", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "setTimeout", "(", "(", ")", "=>", "{", "console", ".", "log", "(", "`2. calling resolve()`", ")", ";", "resolve", "(", ")", ";", "}", ",", "1000", ")", ";", "}", ")", ";", "}", "async", "function", "callDelayedPromise", "(", ")", "{", "console", ".", "log", "(", "`1. before calling delayedPromise`", ")", ";", "await", "delayedPromise", "(", ")", ";", "console", ".", "log", "(", "`3. after calling delayedPromise`", ")", ";", "}", "function", "errorPromise", "(", ")", "{", "return", "new", "Promise", "<", "string", ">", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "setTimeout", "(", "(", ")", "=>", "{", "console", ".", "log", "(", "`2. calling reject()`", ")", ";", "reject", "(", "\"promise rejected\"", ")", ";", "}", ",", "1000", ")", ";", "}", ")", ";", "}", "async", "function", "callErrorPromise", "(", ")", "{", "try", "{", "console", ".", "log", "(", "`1. calling errorPromise()`", ")", ";", "await", "errorPromise", "(", ")", ";", "}", "catch", "(", "error", ")", "{", "console", ".", "log", "(", "`3. await threw : ${", "error", "}`", ")", ";", "}", "}", "function", "promiseWithValues", "(", ")", "{", "return", "new", "Promise", "<", "string", "[", "]", ">", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "resolve", "(", "[", "\"first\"", ",", "\"second\"", "]", ")", ";", "}", ")", ";", "}", "async", "function", "getValuesFromPromise", "(", ")", "{", "let", "values", "=", "await", "promiseWithValues", "(", ")", ";", "for", "(", "let", "value", "of", "values", ")", "{", "console", ".", "log", "(", "`value : ${", "value", "}`", ")", ";", "}", "}", "getValuesFromPromise", "(", ")", ";" ]
[ null, null, 7, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
681
[ "import", "{", "delayedPromise", "}", "from", "\"./async_and_await\"", ";", "function", "invokeAsync", "(", "success", ",", "failure", ")", "{", "}", "function", "usingCallbacks", "(", ")", "{", "function", "afterCallbackSuccess", "(", ")", "{", "}", "function", "afterCallbackFailure", "(", ")", "{", "}", "invokeAsync", "(", "afterCallbackSuccess", ",", "afterCallbackFailure", ")", ";", "}", "function", "usingPromises", "(", ")", "{", "delayedPromise", "(", ")", ".", "then", "(", "(", ")", "=>", "{", "}", ")", ".", "catch", "(", "(", ")", "=>", "{", "}", ")", ";", "}", "async", "function", "usingAsync", "(", ")", "{", "try", "{", "await", "delayedPromise", "(", ")", ";", "}", "catch", "(", "error", ")", "{", "}", "}" ]
[ null, null, null, null, null, null, null, null, 4, null, 4, null, 4, null, null, null, null, 4, null, null, null, null, 4, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
682
[ "function", "delayedResponseWithCallback", "(", "callback", ")", "{", "function", "executeAfterTimeout", "(", ")", "{", "console", ".", "log", "(", "`5. executeAfterTimeout()`", ")", ";", "callback", "(", ")", ";", "}", "console", ".", "log", "(", "`2. calling setTimeout`", ")", ";", "setTimeout", "(", "executeAfterTimeout", ",", "1000", ")", ";", "console", ".", "log", "(", "`3. after calling setTimeout`", ")", ";", "}", "function", "callDelayedAndWait", "(", ")", "{", "function", "afterWait", "(", ")", "{", "console", ".", "log", "(", "`6. afterWait()`", ")", ";", "}", "console", ".", "log", "(", "`1. calling delayedResponseWithCallback`", ")", ";", "delayedResponseWithCallback", "(", "afterWait", ")", ";", "console", ".", "log", "(", "`4. after calling delayedResponseWithCallback`", ")", ";", "}", "callDelayedAndWait", "(", ")", ";" ]
[ null, 4, null, 4, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
683
[ "import", "*", "as", "fs", "from", "\"fs\"", ";", "fs", ".", "readFile", "(", "\"./test1.txt\"", ",", "(", "err", ",", "data", ")", "=>", "{", "if", "(", "err", ")", "{", "console", ".", "log", "(", "`an error occurred : ${", "err", "}`", ")", ";", "}", "else", "{", "console", ".", "log", "(", "`test1.txt contents : ${", "data", "}`", ")", ";", "fs", ".", "readFile", "(", "\"./test2.txt\"", ",", "(", "err", ",", "data", ")", "=>", "{", "if", "(", "err", ")", "{", "console", ".", "log", "(", "`an error occurred : ${", "err", "}`", ")", ";", "}", "else", "{", "console", ".", "log", "(", "`test2.txt contents : ${", "data", "}`", ")", ";", "fs", ".", "readFile", "(", "\"./test3.txt\"", ",", "(", "err", ",", "data", ")", "=>", "{", "if", "(", "err", ")", "{", "console", ".", "log", "(", "`an error occurred : ${", "err", "}`", ")", ";", "}", "else", "{", "console", ".", "log", "(", "`test3.txt contents : ${", "data", "}`", ")", ";", "}", "}", ")", ";", "}", "}", ")", ";", "}", "}", ")", ";", "fs", ".", "promises", ".", "readFile", "(", "\"./test1.txt\"", ")", ".", "then", "(", "(", "value", ")", "=>", "{", "console", ".", "log", "(", "`ps test1.txt read : ${", "value", "}`", ")", ";", "return", "fs", ".", "promises", ".", "readFile", "(", "\"./test2.txt\"", ")", ";", "}", ")", ".", "then", "(", "(", "value", ")", "=>", "{", "console", ".", "log", "(", "`ps test2.txt read : ${", "value", "}`", ")", ";", "return", "fs", ".", "promises", ".", "readFile", "(", "\"./test3.txt\"", ")", ";", "}", ")", ".", "then", "(", "(", "value", ")", "=>", "{", "console", ".", "log", "(", "`ps test3.txt read : ${", "value", "}`", ")", ";", "}", ")", ".", "catch", "(", "(", "error", ")", "=>", "{", "console", ".", "log", "(", "`an error occurred : ${", "error", "}`", ")", ";", "}", ")", ";", "function", "fnDelayedPromise", "(", "resolve", ",", "reject", ")", "{", "function", "afterTimeout", "(", ")", "{", "resolve", "(", ")", ";", "}", "setTimeout", "(", "afterTimeout", ",", "1000", ")", ";", "}", "function", "delayedResponsePromise", "(", ")", "{", "return", "new", "Promise", "<", "void", ">", "(", "fnDelayedPromise", ")", ";", "}", "function", "delayedPromise", "(", ")", "{", "return", "new", "Promise", "<", "void", ">", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "function", "afterTimeout", "(", ")", "{", "resolve", "(", ")", ";", "}", "setTimeout", "(", "afterTimeout", ",", "1000", ")", ";", "}", ")", ";", "}", "delayedPromise", "(", ")", ".", "then", "(", "(", ")", "=>", "{", "console", ".", "log", "(", "`delayed promise returned`", ")", ";", "}", ")", ".", "catch", "(", "(", ")", "=>", "{", "console", ".", "log", "(", "`an error occurred`", ")", ";", "}", ")", ";", "function", "errorPromise", "(", ")", "{", "return", "new", "Promise", "<", "void", ">", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "console", ".", "log", "(", "`2. calling reject()`", ")", ";", "reject", "(", ")", ";", "}", ")", ";", "}", "function", "promiseReturningString", "(", "throwError", ")", "{", "return", "new", "Promise", "<", "string", ">", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "if", "(", "throwError", ")", "{", "reject", "(", "101", ")", ";", "}", "resolve", "(", "`resolve with message`", ")", ";", "}", ")", ";", "}", "console", ".", "log", "(", "`1. calling promiseReturningString`", ")", ";", "promiseReturningString", "(", "false", ")", ".", "then", "(", "(", "returnValue", ")", "=>", "{", "console", ".", "log", "(", "`2. returnedValue : ${", "returnValue", "}`", ")", ";", "}", ")", ".", "catch", "(", "(", "errorCode", ")", "=>", "{", "console", ".", "log", "(", "`this is not called`", ")", ";", "}", ")", ";", "console", ".", "log", "(", "`1. calling promiseReturningString (force error)`", ")", ";", "promiseReturningString", "(", "true", ")", ".", "then", "(", "(", "returnValue", ")", "=>", "{", "console", ".", "log", "(", "`this is not called`", ")", ";", "}", ")", ".", "catch", "(", "(", "errorCode", ")", "=>", "{", "console", ".", "log", "(", "`2. caught : ${", "errorCode", "}`", ")", ";", "}", ")", ";", "interface", "IConnection", "{", "server", ":", "string", ";", "port", ":", "number", ";", "}", "interface", "IError", "{", "code", ":", "number", ";", "message", ":", "string", ";", "}", "interface", "IDataRow", "{", "id", ":", "number", ";", "name", ":", "string", ";", "surname", ":", "string", ";", "}", "function", "complexPromise", "(", "connection", ",", "accessKey", ")", "{", "return", "new", "Promise", "<", "IDataRow", "[", "]", ">", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "}", ")", ";", "}", "complexPromise", "(", "{", "server", ":", "\"test\"", ",", "port", ":", "4200", "}", ",", "\"abcd\"", ")", ".", "then", "(", "(", "rows", ")", "=>", "{", "}", ")", ".", "catch", "(", "(", "error", ")", "=>", "{", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, 243, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 243, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 243, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 12, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, 4, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 8, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 810, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 2325, null, null, null, null, null, null ]
684
[ "import", "{", "PrismaClient", "}", "from", "'@prisma/client'", ";", "async", "function", "main", "(", ")", "{", "const", "prisma", "=", "new", "PrismaClient", "(", ")", ";", "const", "result", "=", "await", "prisma", ".", "atAtIdNamed", ".", "findUnique", "(", "{", "where", ":", "{", "namedConstraintId", ":", "{", "key1", ":", "'data'", ",", "key2", ":", "2", ",", "}", ",", "}", ",", "}", ")", ";", "const", "result2", "=", "await", "prisma", ".", "atAtId", ".", "findUnique", "(", "{", "where", ":", "{", "key1_key2", ":", "{", "key1", ":", "'data'", ",", "key2", ":", "2", ",", "}", ",", "}", ",", "}", ")", ";", "const", "result3", "=", "await", "prisma", ".", "atAtUniqueNamed", ".", "findUnique", "(", "{", "where", ":", "{", "namedConstraintUnique", ":", "{", "key1", ":", "'data'", ",", "key2", ":", "2", ",", "}", ",", "}", ",", "}", ")", ";", "const", "result4", "=", "await", "prisma", ".", "atAtUnique", ".", "findUnique", "(", "{", "where", ":", "{", "key1_key2", ":", "{", "key1", ":", "'data'", ",", "key2", ":", "2", ",", "}", ",", "}", ",", "}", ")", ";", "}", "main", "(", ")", ".", "catch", "(", "(", "e", ")", "=>", "{", "console", ".", "error", "(", "e", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
685
[ "import", "{", "Rule", ",", "Outcome", "}", "from", "\"@siteimprove/alfa-act\"", ";", "import", "{", "Future", "}", "from", "\"@siteimprove/alfa-future\"", ";", "public", "export", "interface", "Handler", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "{", "(", "input", ",", "rules", ",", "outcomes", ",", "message", ")", ":", "Future", ".", "Maybe", "<", "string", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 804, null, 114, null, 114, null, 2, null, null, null, null, null, null, null, null, null, null ]
686
[ "import", "{", "Audit", ",", "Oracle", ",", "Outcome", ",", "Rule", "}", "from", "\"@siteimprove/alfa-act\"", ";", "import", "{", "Future", "}", "from", "\"@siteimprove/alfa-future\"", ";", "import", "{", "None", "}", "from", "\"@siteimprove/alfa-option\"", ";", "import", "{", "Predicate", "}", "from", "\"@siteimprove/alfa-predicate\"", ";", "import", "{", "Result", ",", "Err", "}", "from", "\"@siteimprove/alfa-result\"", ";", "import", "{", "Sequence", "}", "from", "\"@siteimprove/alfa-sequence\"", ";", "import", "{", "Handler", "}", "from", "\"./handler\"", ";", "const", "{", "or", "}", "=", "Predicate", ";", "public", "export", "class", "Assertion", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "{", "public", "static", "of", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "(", "input", ",", "rules", ",", "handlers", "=", "[", "]", ",", "options", "=", "{", "}", ")", "{", "return", "new", "Assertion", "(", "input", ",", "Array", ".", "from", "(", "rules", ")", ",", "Array", ".", "from", "(", "handlers", ")", ",", "options", ")", ";", "}", "private", "readonly", "_input", ":", "I", ";", "private", "readonly", "_rules", ":", "Array", "<", "Rule", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ">", ";", "private", "readonly", "_handlers", ":", "Array", "<", "Handler", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ">", ";", "private", "readonly", "_options", ":", "Assertion", ".", "Options", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ";", "private", "constructor", "(", "input", ",", "rules", ",", "handlers", ",", "options", ")", "{", "this", ".", "_input", "=", "input", ";", "this", ".", "_rules", "=", "rules", ";", "this", ".", "_handlers", "=", "handlers", ";", "this", ".", "_options", "=", "options", ";", "}", "public", "get", "to", "(", ")", ":", "this", "{", "return", "this", ";", "}", "public", "get", "be", "(", ")", ":", "this", "{", "return", "this", ";", "}", "public", "accessible", "(", ")", "{", "const", "{", "filter", "=", "(", ")", "=>", "true", ",", "filterCantTell", "=", "(", ")", "=>", "false", ",", "oracle", "=", "(", ")", "=>", "Future", ".", "now", "(", "None", ")", ",", "}", "=", "{", "...", "this", ".", "_options", ",", "}", ";", "return", "Audit", ".", "of", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "(", "this", ".", "_input", ",", "this", ".", "_rules", ",", "oracle", ")", ".", "evaluate", "(", ")", ".", "flatMap", "(", "(", "outcomes", ")", "=>", "{", "const", "suspicious", "=", "Sequence", ".", "from", "(", "outcomes", ")", ".", "filter", "(", "or", "(", "Outcome", ".", "isFailed", ",", "Outcome", ".", "isCantTell", ")", ")", ";", "const", "failures", "=", "suspicious", ".", "filter", "(", "(", "outcome", ")", "=>", "Outcome", ".", "isFailed", "(", "outcome", ")", "&&", "filter", "(", "outcome", ")", ")", ";", "const", "failuresCount", "=", "failures", ".", "size", ";", "const", "failuresOutcome", "=", "failuresCount", "===", "1", "?", "\"outcome was\"", ":", "\"outcomes were\"", ";", "const", "failuresMessage", "=", "`${", "failuresCount", "} failed ${", "failuresOutcome", "} found.`", ";", "const", "cantTell", "=", "suspicious", ".", "filter", "(", "(", "outcome", ")", "=>", "Outcome", ".", "isCantTell", "(", "outcome", ")", "&&", "filterCantTell", "(", "outcome", ")", ")", ";", "const", "cantTellCount", "=", "cantTell", ".", "size", ";", "const", "cantTellOutcome", "=", "cantTellCount", "===", "1", "?", "\"outcome was\"", ":", "\"outcomes were\"", ";", "const", "cantTellMessage", "=", "`${", "cantTellCount", "} \"can't Tell\" ${", "cantTellOutcome", "} found.`", ";", "const", "message", "=", "failuresMessage", "+", "\" \"", "+", "cantTellMessage", ";", "if", "(", "failuresCount", "+", "cantTellCount", "===", "0", ")", "{", "return", "Future", ".", "now", "(", "Result", ".", "of", "(", "message", ")", ")", ";", "}", "return", "this", ".", "_handlers", ".", "reduce", "(", "(", "message", ",", "handler", ")", "=>", "message", ".", "flatMap", "(", "(", "message", ")", "=>", "{", "const", "future", "=", "handler", "(", "this", ".", "_input", ",", "this", ".", "_rules", ",", "failures", ",", "message", ")", ";", "if", "(", "Future", ".", "isFuture", "(", "future", ")", ")", "{", "return", "future", ";", "}", "return", "Future", ".", "now", "(", "future", ")", ";", "}", ")", ",", "Future", ".", "now", "(", "message", ")", ")", ".", "map", "(", "(", "message", ")", "=>", "Err", ".", "of", "(", "message", ")", ")", ";", "}", ")", ";", "}", "}", "public", "export", "namespace", "Assertion", "{", "export", "interface", "Options", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "{", "/**\n * Predicate for filtering outcomes that should count towards an assertion\n * failure.; only failed outcomes matching this filter will be reported.\n * If left unset, all failed outcomes will be reported\n */", "readonly", "filter", "?", ":", "Predicate", "<", "Outcome", ".", "Failed", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ">", ";", "/**\n * Predicate for filtering cantTell outcome.\n * If left unset, no cantTell outcome will be reported.\n */", "readonly", "filterCantTell", "?", ":", "Predicate", "<", "Outcome", ".", "CantTell", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ">", ";", "/**\n * Passing an oracle to the rules evaluation.\n */", "readonly", "oracle", "?", ":", "Oracle", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2069, null, null, null, null, null, null, null, null, null, null, 804, null, 114, null, 114, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 804, null, 13, null, 13, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1091, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 334, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
687
[ "import", "{", "Rule", "}", "from", "\"@siteimprove/alfa-act\"", ";", "import", "{", "Assertion", "}", "from", "\"./assertion\"", ";", "import", "{", "Handler", "}", "from", "\"./handler\"", ";", "public", "export", "class", "Asserter", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "{", "public", "static", "of", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "(", "rules", ",", "handlers", "=", "[", "]", ",", "options", "=", "{", "}", ")", "{", "return", "new", "Asserter", "(", "Array", ".", "from", "(", "rules", ")", ",", "Array", ".", "from", "(", "handlers", ")", ",", "options", ")", ";", "}", "private", "readonly", "_rules", ":", "Array", "<", "Rule", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ">", ";", "private", "readonly", "_handlers", ":", "Array", "<", "Handler", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ">", ";", "private", "readonly", "_options", ":", "Asserter", ".", "Options", "<", "I", ",", "T", ",", "Q", ",", "S", ">", ";", "private", "constructor", "(", "rules", ",", "handlers", ",", "options", ")", "{", "this", ".", "_rules", "=", "rules", ";", "this", ".", "_handlers", "=", "handlers", ";", "this", ".", "_options", "=", "options", ";", "}", "public", "readonly", "expect", "=", "(", "input", ",", "options", "=", "{", "}", ")", "=>", "Assertion", ".", "of", "(", "input", ",", "this", ".", "_rules", ",", "this", ".", "_handlers", ",", "{", "...", "this", ".", "_options", ",", "...", "options", ",", "}", ")", ";", "}", "public", "export", "namespace", "Asserter", "{", "export", "interface", "Options", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "extends", "Assertion", ".", "Options", "<", "I", ",", "T", ",", "Q", ",", "S", ">", "{", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, 114, null, 114, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 13, null, 13, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 804, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
688
[ "import", "{", "Diagnostic", ",", "Question", ",", "Rule", "}", "from", "\"@siteimprove/alfa-act\"", ";", "import", "{", "Result", ",", "Err", "}", "from", "\"@siteimprove/alfa-result\"", ";", "export", "const", "Pass", "=", "(", "uri", ")", "=>", "Rule", ".", "Atomic", ".", "of", "<", "string", ",", "string", ">", "(", "{", "uri", ",", "evaluate", "(", "input", ")", "{", "return", "{", "applicability", "(", ")", "{", "return", "[", "input", "]", ";", "}", ",", "expectations", "(", ")", "{", "return", "{", "1", ":", "Result", ".", "of", "(", "Diagnostic", ".", "of", "(", "\"Success!\"", ")", ")", ",", "}", ";", "}", ",", "}", ";", "}", ",", "}", ")", ";", "export", "const", "Fail", "=", "(", "uri", ")", "=>", "Rule", ".", "Atomic", ".", "of", "<", "string", ",", "string", ">", "(", "{", "uri", ",", "evaluate", "(", "input", ")", "{", "return", "{", "applicability", "(", ")", "{", "return", "[", "input", "]", ";", "}", ",", "expectations", "(", ")", "{", "return", "{", "1", ":", "Err", ".", "of", "(", "Diagnostic", ".", "of", "(", "\"Failure!\"", ")", ")", ",", "}", ";", "}", ",", "}", ";", "}", ",", "}", ")", ";", "export", "const", "CantTell", "=", "(", "uri", ")", "=>", "Rule", ".", "Atomic", ".", "of", "<", "string", ",", "string", ",", "{", "\"is-passed\"", ":", "[", "\"boolean\"", ",", "boolean", "]", ";", "}", ">", "(", "{", "uri", ",", "evaluate", "(", "input", ")", "{", "return", "{", "applicability", "(", ")", "{", "return", "[", "input", "]", ";", "}", ",", "expectations", "(", "target", ")", "{", "const", "isPassed", "=", "Question", ".", "of", "<", "\"boolean\"", ",", "string", ",", "string", ",", "boolean", ",", "\"is-passed\"", ">", "(", "\"boolean\"", ",", "\"is-passed\"", ",", "Diagnostic", ".", "of", "(", "\"Does the rule pass?\"", ")", ",", "target", ",", "target", ")", ";", "return", "{", "1", ":", "isPassed", ".", "map", "(", "(", "passed", ")", "=>", "passed", "?", "Result", ".", "of", "(", "Diagnostic", ".", "of", "(", "\"Success!\"", ")", ")", ":", "Err", ".", "of", "(", "Diagnostic", ".", "of", "(", "\"Failure!\"", ")", ")", ")", ",", "}", ";", "}", ",", "}", ";", "}", ",", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
689
[ "import", "{", "Future", "}", "from", "\"@siteimprove/alfa-future\"", ";", "import", "{", "Option", "}", "from", "\"@siteimprove/alfa-option\"", ";", "import", "{", "test", "}", "from", "\"@siteimprove/alfa-test\"", ";", "import", "{", "Asserter", "}", "from", "\"../src/asserter\"", ";", "import", "{", "CantTell", ",", "Fail", ",", "Pass", "}", "from", "\"./fixture/rule\"", ";", "test", "(", "\"#expect() returns an ok when no rules fail\"", ",", "async", "(", "t", ")", "=>", "{", "const", "{", "expect", "}", "=", "Asserter", ".", "of", "(", "[", "Pass", "(", "\"pass\"", ")", "]", ")", ";", "const", "result", "=", "await", "expect", "(", "\"foo\"", ")", ".", "to", ".", "be", ".", "accessible", "(", ")", ";", "t", ".", "equal", "(", "result", ".", "isOk", "(", ")", ",", "true", ")", ";", "}", ")", ";", "test", "(", "\"#expect() returns an error when a rule fails\"", ",", "async", "(", "t", ")", "=>", "{", "const", "{", "expect", "}", "=", "Asserter", ".", "of", "(", "[", "Pass", "(", "\"pass\"", ")", ",", "Fail", "(", "\"fail\"", ")", "]", ")", ";", "const", "result", "=", "await", "expect", "(", "\"foo\"", ")", ".", "to", ".", "be", ".", "accessible", "(", ")", ";", "t", ".", "equal", "(", "result", ".", "isErr", "(", ")", ",", "true", ")", ";", "}", ")", ";", "test", "(", "\"#expect() allows filtering of failed outcomes\"", ",", "async", "(", "t", ")", "=>", "{", "const", "{", "expect", "}", "=", "Asserter", ".", "of", "(", "[", "Pass", "(", "\"pass\"", ")", ",", "Fail", "(", "\"good\"", ")", "]", ",", "[", "]", ",", "{", "filter", ":", "(", "outcome", ")", "=>", "outcome", ".", "rule", ".", "uri", "!==", "\"good\"", ",", "}", ")", ";", "const", "result", "=", "await", "expect", "(", "\"foo\"", ")", ".", "to", ".", "be", ".", "accessible", "(", ")", ";", "t", ".", "equal", "(", "result", ".", "isOk", "(", ")", ",", "true", ")", ";", "}", ")", ";", "test", "(", "\"#expect() allows to reject cantTell outcomes\"", ",", "async", "(", "t", ")", "=>", "{", "const", "{", "expect", "}", "=", "Asserter", ".", "of", "(", "[", "Pass", "(", "\"pass\"", ")", ",", "CantTell", "(", "\"maybe\"", ")", "]", ",", "[", "]", ",", "{", "filterCantTell", ":", "(", ")", "=>", "true", ",", "}", ")", ";", "const", "result", "=", "await", "expect", "(", "\"foo\"", ")", ".", "to", ".", "be", ".", "accessible", "(", ")", ";", "t", ".", "equal", "(", "result", ".", "isErr", "(", ")", ",", "true", ")", ";", "}", ")", ";", "test", "(", "\"#expect() accepts an oracle\"", ",", "async", "(", "t", ")", "=>", "{", "const", "{", "expect", "}", "=", "Asserter", ".", "of", "(", "[", "Pass", "(", "\"pass\"", ")", ",", "CantTell", "(", "\"maybe\"", ")", "]", ",", "[", "]", ",", "{", "oracle", ":", "(", "_", ",", "question", ")", "=>", "Future", ".", "now", "(", "Option", ".", "of", "(", "true", ")", ")", ",", "}", ")", ";", "const", "result", "=", "await", "expect", "(", "\"foo\"", ")", ".", "to", ".", "be", ".", "accessible", "(", ")", ";", "t", ".", "equal", "(", "result", ".", "isOk", "(", ")", ",", "true", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
690
[ "import", "React", ",", "{", "useEffect", ",", "useRef", "}", "from", "'react'", ";", "import", "*", "as", "ReactDOM", "from", "'react-dom'", ";", "import", "{", "keys", ",", "EuiText", "}", "from", "'@elastic/eui'", ";", "import", "'./_ui_ace_keyboard_mode.scss'", ";", "const", "OverlayText", "=", "(", ")", "=>", "(", "<", ">", "<", "EuiText", "size", "=", "\"s\"", ">", "Press", "Enter", "to", "start", "editing", ".", "<", "/EuiText>", "<", "EuiText", "size", "=", "\"s\"", ">", "When", "you", "&", "rsquo", ";", "re", "done", ",", "press", "Escape", "to", "stop", "editing", ".", "<", "/EuiText>", "<", "/>);", "export", "function", "useUIAceKeyboardMode", "(", "aceTextAreaElement", ")", "{", "const", "overlayMountNode", "=", "useRef", "<", "HTMLDivElement", "|", "null", ">", "(", "null", ")", ";", "const", "autoCompleteVisibleRef", "=", "useRef", "<", "boolean", ">", "(", "false", ")", ";", "useEffect", "(", "(", ")", "=>", "{", "function", "onDismissOverlay", "(", "event", ")", "{", "if", "(", "event", ".", "key", "===", "keys", ".", "ENTER", ")", "{", "event", ".", "preventDefault", "(", ")", ";", "aceTextAreaElement", "!", ".", "focus", "(", ")", ";", "}", "}", "function", "enableOverlay", "(", ")", "{", "if", "(", "overlayMountNode", ".", "current", ")", "{", "overlayMountNode", ".", "current", ".", "focus", "(", ")", ";", "}", "}", "const", "isAutoCompleteVisible", "=", "(", ")", "=>", "{", "const", "autoCompleter", "=", "document", ".", "querySelector", "<", "HTMLDivElement", ">", "(", "'.ace_autocomplete'", ")", ";", "if", "(", "!", "autoCompleter", ")", "{", "return", "false", ";", "}", "return", "autoCompleter", ".", "style", ".", "display", "!==", "'none'", ";", "}", ";", "const", "documentKeyDownListener", "=", "(", ")", "=>", "{", "autoCompleteVisibleRef", ".", "current", "=", "isAutoCompleteVisible", "(", ")", ";", "}", ";", "const", "aceKeydownListener", "=", "(", "event", ")", "=>", "{", "if", "(", "event", ".", "key", "===", "keys", ".", "ESCAPE", "&&", "!", "autoCompleteVisibleRef", ".", "current", ")", "{", "event", ".", "preventDefault", "(", ")", ";", "event", ".", "stopPropagation", "(", ")", ";", "enableOverlay", "(", ")", ";", "}", "}", ";", "if", "(", "aceTextAreaElement", ")", "{", "overlayMountNode", ".", "current", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "overlayMountNode", ".", "current", ".", "className", "=", "'kbnUiAceKeyboardHint'", ";", "overlayMountNode", ".", "current", ".", "setAttribute", "(", "'role'", ",", "'application'", ")", ";", "overlayMountNode", ".", "current", ".", "tabIndex", "=", "0", ";", "overlayMountNode", ".", "current", ".", "addEventListener", "(", "'focus'", ",", "enableOverlay", ")", ";", "overlayMountNode", ".", "current", ".", "addEventListener", "(", "'keydown'", ",", "onDismissOverlay", ")", ";", "ReactDOM", ".", "render", "(", "<", "OverlayText", "/>, overlayMountNode.current);", "aceTextAreaElement", ".", "parentElement", "!", ".", "insertBefore", "(", "overlayMountNode", ".", "current", ",", "aceTextAreaElement", ")", ";", "aceTextAreaElement", ".", "setAttribute", "(", "'tabindex'", ",", "'-1'", ")", ";", "document", ".", "addEventListener", "(", "'keydown'", ",", "documentKeyDownListener", ",", "{", "capture", ":", "true", "}", ")", ";", "aceTextAreaElement", ".", "addEventListener", "(", "'keydown'", ",", "aceKeydownListener", ")", ";", "}", "return", "(", ")", "=>", "{", "if", "(", "aceTextAreaElement", ")", "{", "document", ".", "removeEventListener", "(", "'keydown'", ",", "documentKeyDownListener", ",", "{", "capture", ":", "true", "}", ")", ";", "aceTextAreaElement", ".", "removeEventListener", "(", "'keydown'", ",", "aceKeydownListener", ")", ";", "const", "textAreaContainer", "=", "aceTextAreaElement", ".", "parentElement", ";", "if", "(", "textAreaContainer", "&&", "textAreaContainer", ".", "contains", "(", "overlayMountNode", ".", "current", "!", ")", ")", "{", "textAreaContainer", ".", "removeChild", "(", "overlayMountNode", ".", "current", "!", ")", ";", "}", "}", "}", ";", "}", ",", "[", "aceTextAreaElement", "]", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
691
[ "import", "{", "EuiCallOut", ",", "EuiSpacer", "}", "from", "'@elastic/eui'", ";", "import", "React", ",", "{", "Fragment", "}", "from", "'react'", ";", "import", "{", "Error", "}", "from", "'../types'", ";", "interface", "Props", "{", "title", ":", "React", ".", "ReactNode", ";", "error", ":", "Error", ";", "actions", "?", ":", "JSX", ".", "Element", ";", "}", "export", "const", "SectionError", "=", "(", "{", "title", ",", "error", ",", "actions", ",", "...", "rest", "}", ")", "=>", "{", "const", "{", "error", ":", "errorString", ",", "cause", ",", "message", ",", "}", "=", "error", ";", "return", "(", "<", "EuiCallOut", "title", "=", "{", "title", "}", "color", "=", "\"danger\"", "iconType", "=", "\"alert\"", "{", "...", "rest", "}", ">", "{", "cause", "?", "message", "||", "errorString", ":", "<", "p", ">", "{", "message", "||", "errorString", "}", "<", "/p>}", "{", "cause", "&&", "(", "<", "Fragment", ">", "<", "EuiSpacer", "size", "=", "\"s\"", "/", ">", "<", "ul", ">", "{", "cause", ".", "map", "(", "(", "causeMsg", ",", "i", ")", "=>", "(", "<", "li", "key", "=", "{", "i", "}", ">", "{", "causeMsg", "}", "<", "/li>))}", "<", "/ul>", "<", "/Fragment>)}", "{", "actions", "?", "actions", ":", "null", "}", "<", "/EuiCallOut>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 97, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
692
[ "import", "{", "EuiSpacer", ",", "EuiEmptyPrompt", ",", "EuiPageContent", "}", "from", "'@elastic/eui'", ";", "import", "React", "from", "'react'", ";", "import", "{", "APP_WRAPPER_CLASS", "}", "from", "'../../../../../../src/core/public'", ";", "import", "{", "Error", "}", "from", "'../types'", ";", "interface", "Props", "{", "title", ":", "React", ".", "ReactNode", ";", "error", "?", ":", "Error", ";", "actions", "?", ":", "JSX", ".", "Element", ";", "isCentered", "?", ":", "boolean", ";", "}", "export", "const", "PageError", "=", "(", "{", "title", ",", "error", ",", "actions", ",", "isCentered", ",", "...", "rest", "}", ")", "=>", "{", "const", "errorString", "=", "error", "?.", "error", ";", "const", "cause", "=", "error", "?.", "cause", ";", "const", "message", "=", "error", "?.", "message", ";", "const", "errorContent", "=", "(", "<", "EuiPageContent", "verticalPosition", "=", "\"center\"", "horizontalPosition", "=", "\"center\"", "color", "=", "\"danger\"", ">", "<", "EuiEmptyPrompt", "title", "=", "{", "<", "h2", ">", "{", "title", "}", "<", "/h2>} body={error && (<>", "{", "cause", "?", "(", "message", "||", "errorString", ")", ":", "(", "<", "p", "className", "=", "\"eui-textBreakWord\"", ">", "{", "message", "||", "errorString", "}", "<", "/p>)}", "{", "cause", "&&", "(", "<", ">", "<", "EuiSpacer", "size", "=", "\"s\"", "/", ">", "<", "ul", ">", "{", "cause", ".", "map", "(", "(", "causeMsg", ",", "i", ")", "=>", "(", "<", "li", "key", "=", "{", "i", "}", ">", "{", "causeMsg", "}", "<", "/li>))}", "<", "/ul>", "<", "/>)}", "<", "/>)} iconType=\"alert\" actions={actions} {...rest}/", ">", "<", "/EuiPageContent>);", "if", "(", "isCentered", ")", "{", "return", "<", "div", "className", "=", "{", "APP_WRAPPER_CLASS", "}", ">", "{", "errorContent", "}", "<", "/div>;", "}", "return", "errorContent", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 97, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
693
[ "interface", "ParsedError", "{", "message", ":", "string", ";", "cause", ":", "string", "[", "]", ";", "}", "export", "const", "getEsCause", "=", "(", "obj", "=", "{", "}", ",", "causes", "=", "[", "]", ")", ":", "string", "[", "]", "=>", "{", "const", "updated", "=", "[", "...", "causes", "]", ";", "if", "(", "obj", ".", "caused_by", ")", "{", "updated", ".", "push", "(", "obj", ".", "caused_by", ".", "reason", ")", ";", "return", "getEsCause", "(", "obj", ".", "caused_by", ",", "updated", ")", ";", "}", "return", "updated", ".", "filter", "(", "Boolean", ")", ";", "}", ";", "export", "const", "parseEsError", "=", "(", "err", ")", ":", "ParsedError", "=>", "{", "try", "{", "const", "{", "error", "}", "=", "JSON", ".", "parse", "(", "err", ")", ";", "const", "cause", "=", "getEsCause", "(", "error", ")", ";", "return", "{", "message", ":", "error", ".", "reason", ",", "cause", ",", "}", ";", "}", "catch", "(", "e", ")", "{", "return", "{", "message", ":", "err", ",", "cause", ":", "[", "]", ",", "}", ";", "}", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
694
[ "import", "{", "parseEsError", "}", "from", "'./es_error_parser'", ";", "describe", "(", "'ES error parser'", ",", "(", ")", "=>", "{", "test", "(", "'should return all the cause of the error'", ",", "(", ")", "=>", "{", "const", "esError", "=", "`{\n \"error\": {\n \"reason\": \"Houston we got a problem\",\n \"caused_by\": {\n \"reason\": \"First reason\",\n \"caused_by\": {\n \"reason\": \"Second reason\",\n \"caused_by\": {\n \"reason\": \"Third reason\"\n }\n }\n }\n }\n }`", ";", "const", "parsedError", "=", "parseEsError", "(", "esError", ")", ";", "expect", "(", "parsedError", ".", "message", ")", ".", "toEqual", "(", "'Houston we got a problem'", ")", ";", "expect", "(", "parsedError", ".", "cause", ")", ".", "toEqual", "(", "[", "'First reason'", ",", "'Second reason'", ",", "'Third reason'", "]", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
695
[ "import", "{", "errors", "}", "from", "'@elastic/elasticsearch'", ";", "import", "{", "IKibanaResponse", ",", "KibanaResponseFactory", "}", "from", "'kibana/server'", ";", "import", "{", "getEsCause", "}", "from", "'./es_error_parser'", ";", "interface", "EsErrorHandlerParams", "{", "error", ":", "errors", ".", "ElasticsearchClientError", ";", "response", ":", "KibanaResponseFactory", ";", "handleCustomError", "?", ":", "(", ")", "=>", "IKibanaResponse", "<", "any", ">", ";", "}", "throws", "export", "const", "handleEsError", "=", "(", "{", "error", ",", "response", ",", "handleCustomError", ",", "}", ")", ":", "IKibanaResponse", "=>", "{", "if", "(", "error", ".", "name", "===", "'ResponseError'", ")", "{", "if", "(", "typeof", "handleCustomError", "===", "'function'", ")", "{", "return", "handleCustomError", "(", ")", ";", "}", "const", "{", "statusCode", ",", "body", "}", "=", "error", "as", "errors", ".", "ResponseError", ";", "return", "response", ".", "customError", "(", "{", "statusCode", ":", "statusCode", "!", ",", "body", ":", "{", "message", ":", "body", "?.", "error", "?.", "reason", "||", "body", "?.", "error", "?.", "caused_by", "?.", "reason", "||", "error", ".", "message", "||", "'Unknown error'", ",", "attributes", ":", "{", "error", ":", "body", "?.", "error", ",", "causes", ":", "body", "?.", "error", "?.", "caused_by", "?", "getEsCause", "(", "body", ".", "error", ")", ":", "undefined", ",", "}", ",", "}", ",", "}", ")", ";", "}", "throw", "error", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
696
[ "import", "{", "errors", "}", "from", "'@elastic/elasticsearch'", ";", "import", "{", "kibanaResponseFactory", "as", "response", "}", "from", "'src/core/server'", ";", "import", "{", "handleEsError", "}", "from", "'./handle_es_error'", ";", "const", "{", "ResponseError", "}", "=", "errors", ";", "const", "anyObject", "=", "{", "}", ";", "describe", "(", "'handleEsError'", ",", "(", ")", "=>", "{", "test", "(", "'top-level reason is an empty string'", ",", "(", ")", "=>", "{", "const", "emptyReasonError", "=", "new", "ResponseError", "(", "{", "warnings", ":", "[", "]", ",", "meta", ":", "anyObject", ",", "body", ":", "{", "error", ":", "{", "root_cause", ":", "[", "]", ",", "type", ":", "'search_phase_execution_exception'", ",", "reason", ":", "''", ",", "phase", ":", "'fetch'", ",", "grouped", ":", "true", ",", "failed_shards", ":", "[", "]", ",", "caused_by", ":", "{", "type", ":", "'too_many_buckets_exception'", ",", "reason", ":", "'This is the nested reason'", ",", "max_buckets", ":", "100", ",", "}", ",", "}", ",", "}", ",", "statusCode", ":", "503", ",", "headers", ":", "{", "}", ",", "}", ")", ";", "const", "{", "payload", ",", "status", "}", "=", "handleEsError", "(", "{", "error", ":", "emptyReasonError", ",", "response", "}", ")", ";", "expect", "(", "payload", ".", "message", ")", ".", "toEqual", "(", "'This is the nested reason'", ")", ";", "expect", "(", "status", ")", ".", "toBe", "(", "503", ")", ";", "}", ")", ";", "test", "(", "'empty error'", ",", "(", ")", "=>", "{", "const", "{", "payload", ",", "status", "}", "=", "handleEsError", "(", "{", "error", ":", "new", "ResponseError", "(", "{", "body", ":", "{", "}", ",", "statusCode", ":", "400", ",", "headers", ":", "{", "}", ",", "meta", ":", "anyObject", ",", "warnings", ":", "[", "]", ",", "}", ")", ",", "response", ",", "}", ")", ";", "expect", "(", "payload", ")", ".", "toEqual", "(", "{", "attributes", ":", "{", "causes", ":", "undefined", ",", "error", ":", "undefined", "}", ",", "message", ":", "'{}'", ",", "}", ")", ";", "expect", "(", "status", ")", ".", "toBe", "(", "400", ")", ";", "}", ")", ";", "test", "(", "'unknown object'", ",", "(", ")", "=>", "{", "expect", "(", "(", ")", "=>", "handleEsError", "(", "{", "error", ":", "anyObject", ",", "response", "}", ")", ")", ".", "toThrow", "(", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
697
[ "type", "StringValues", "=", "Array", "<", "{", "startIndex", ":", "number", ";", "endIndex", ":", "number", ";", "}", ">", ";", "interface", "ParseResult", "{", "stringValues", ":", "StringValues", ";", "}", "const", "JSON_COLON", "=", "':'", ";", "const", "JSON_STRING_DELIMITER", "=", "'\"'", ";", "const", "JSON_STRING_ESCAPE", "=", "'\\\\'", ";", "/**\n * Accepts JSON (as a string) and extracts the positions of all JSON string\n * values.\n *\n * For example:\n *\n * '{ \"my_string_value\": \"is this\", \"my_number_value\": 42 }'\n *\n * Would extract one result:\n *\n * [ { startIndex: 21, endIndex: 29 } ]\n *\n * This result maps to `\"is this\"` from the example JSON.\n *\n */", "export", "const", "extractJSONStringValues", "=", "(", "input", ")", ":", "ParseResult", "=>", "{", "let", "position", "=", "0", ";", "let", "currentStringStartPos", ";", "let", "isInsideString", "=", "false", ";", "const", "stringValues", "=", "[", "]", ";", "function", "read", "(", ")", "{", "return", "input", "[", "position", "]", ";", "}", "function", "peekNextNonWhitespace", "(", ")", "{", "let", "peekPosition", "=", "position", "+", "1", ";", "while", "(", "peekPosition", "<", "input", ".", "length", ")", "{", "const", "peekChar", "=", "input", "[", "peekPosition", "]", ";", "if", "(", "peekChar", ".", "match", "(", "/[^\\s\\r\\n]/", ")", ")", "{", "return", "peekChar", ";", "}", "++", "peekPosition", ";", "}", "}", "function", "advance", "(", ")", "{", "++", "position", ";", "}", "while", "(", "position", "<", "input", ".", "length", ")", "{", "const", "char", "=", "read", "(", ")", ";", "if", "(", "!", "isInsideString", ")", "{", "if", "(", "char", "===", "JSON_STRING_DELIMITER", ")", "{", "currentStringStartPos", "=", "position", ";", "isInsideString", "=", "true", ";", "}", "}", "else", "{", "if", "(", "char", "===", "JSON_STRING_ESCAPE", ")", "{", "advance", "(", ")", ";", "}", "else", "if", "(", "char", "===", "JSON_STRING_DELIMITER", ")", "{", "if", "(", "peekNextNonWhitespace", "(", ")", "!==", "JSON_COLON", ")", "{", "stringValues", ".", "push", "(", "{", "startIndex", ":", "currentStringStartPos", "!", ",", "endIndex", ":", "position", ",", "}", ")", ";", "}", "isInsideString", "=", "false", ";", "}", "}", "advance", "(", ")", ";", "}", "return", "{", "stringValues", "}", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, 2, null, null, null, null, null, null, 895, null, null, 2, null, null, null, null, null, null, 3, null, null, null, null, 3, null, null, 8, null, null, null, null, 0, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
698
[ "import", "_", "from", "'lodash'", ";", "import", "collapsingTests", "from", "'./__fixtures__/utils_string_collapsing.txt'", ";", "import", "expandingTests", "from", "'./__fixtures__/utils_string_expanding.txt'", ";", "import", "*", "as", "utils", "from", "'./index'", ";", "import", "{", "extractJSONStringValues", "}", "from", "'./parser'", ";", "describe", "(", "'JSON to XJSON conversion tools'", ",", "(", ")", "=>", "{", "it", "(", "'will collapse multiline strings'", ",", "(", ")", "=>", "{", "const", "multiline", "=", "'{ \"foo\": \"\"\"bar\\nbaz\"\"\" }'", ";", "expect", "(", "utils", ".", "collapseLiteralStrings", "(", "multiline", ")", ")", ".", "toEqual", "(", "'{ \"foo\": \"bar\\\\nbaz\" }'", ")", ";", "}", ")", ";", "it", "(", "'will collapse multiline strings with CRLF endings'", ",", "(", ")", "=>", "{", "const", "multiline", "=", "'{ \"foo\": \"\"\"bar\\r\\nbaz\"\"\" }'", ";", "expect", "(", "utils", ".", "collapseLiteralStrings", "(", "multiline", ")", ")", ".", "toEqual", "(", "'{ \"foo\": \"bar\\\\r\\\\nbaz\" }'", ")", ";", "}", ")", ";", "describe", "(", "'JSON string values parser'", ",", "(", ")", "=>", "{", "test", "(", "'correctly extracts JSON string values'", ",", "(", ")", "=>", "{", "const", "json", "=", "{", "myString", ":", "'string'", ",", "notAString", ":", "1", ",", "myStringArray", ":", "[", "'a'", ",", "1", ",", "'test'", ",", "{", "nestedString", ":", "'string'", "}", "]", ",", "}", ";", "const", "jsonString", "=", "JSON", ".", "stringify", "(", "json", ")", ";", "const", "{", "stringValues", "}", "=", "extractJSONStringValues", "(", "jsonString", ")", ";", "expect", "(", "stringValues", ".", "length", ")", ".", "toBe", "(", "4", ")", ";", "expect", "(", "jsonString", ".", "substring", "(", "stringValues", "[", "0", "]", ".", "startIndex", ",", "stringValues", "[", "0", "]", ".", "endIndex", "+", "1", ")", ")", ".", "toBe", "(", "'\"string\"'", ")", ";", "expect", "(", "jsonString", ".", "substring", "(", "stringValues", "[", "1", "]", ".", "startIndex", ",", "stringValues", "[", "1", "]", ".", "endIndex", "+", "1", ")", ")", ".", "toBe", "(", "'\"a\"'", ")", ";", "expect", "(", "jsonString", ".", "substring", "(", "stringValues", "[", "2", "]", ".", "startIndex", ",", "stringValues", "[", "2", "]", ".", "endIndex", "+", "1", ")", ")", ".", "toBe", "(", "'\"test\"'", ")", ";", "expect", "(", "jsonString", ".", "substring", "(", "stringValues", "[", "3", "]", ".", "startIndex", ",", "stringValues", "[", "3", "]", ".", "endIndex", "+", "1", ")", ")", ".", "toBe", "(", "'\"string\"'", ")", ";", "}", ")", ";", "}", ")", ";", "}", ")", ";", "_", ".", "each", "(", "collapsingTests", ".", "split", "(", "/^=+$/m", ")", ",", "function", "(", "fixture", ")", "{", "if", "(", "fixture", ".", "trim", "(", ")", "===", "''", ")", "{", "return", ";", "}", "fixture", "=", "fixture", ".", "split", "(", "/^-+$/m", ")", ";", "const", "name", "=", "fixture", "[", "0", "]", ".", "trim", "(", ")", ";", "const", "expanded", "=", "fixture", "[", "1", "]", ".", "trim", "(", ")", ";", "const", "collapsed", "=", "fixture", "[", "2", "]", ".", "trim", "(", ")", ";", "test", "(", "'Literal collapse - '", "+", "name", ",", "function", "(", ")", "{", "expect", "(", "utils", ".", "collapseLiteralStrings", "(", "expanded", ")", ")", ".", "toEqual", "(", "collapsed", ")", ";", "}", ")", ";", "}", ")", ";", "_", ".", "each", "(", "expandingTests", ".", "split", "(", "/^=+$/m", ")", ",", "function", "(", "fixture", ")", "{", "if", "(", "fixture", ".", "trim", "(", ")", "===", "''", ")", "{", "return", ";", "}", "fixture", "=", "fixture", ".", "split", "(", "/^-+$/m", ")", ";", "const", "name", "=", "fixture", "[", "0", "]", ".", "trim", "(", ")", ";", "const", "collapsed", "=", "fixture", "[", "1", "]", ".", "trim", "(", ")", ";", "const", "expanded", "=", "fixture", "[", "2", "]", ".", "trim", "(", ")", ";", "test", "(", "'Literal expand - '", "+", "name", ",", "function", "(", ")", "{", "expect", "(", "utils", ".", "expandLiteralStrings", "(", "collapsed", ")", ")", ".", "toEqual", "(", "expanded", ")", ";", "}", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
699
[ "import", "{", "useState", ",", "useCallback", ",", "useRef", "}", "from", "'react'", ";", "export", "interface", "Content", "<", "T", "=", "any", ">", "{", "isValid", ":", "boolean", "|", "undefined", ";", "validate", "(", ")", ":", "Promise", "<", "boolean", ">", ";", "getData", "(", ")", ":", "T", ";", "}", "type", "Contents", "<", "T", ">", "=", "{", "[", "K", "in", "keyof", "T", "]", ":", "Content", ";", "}", ";", "interface", "Validation", "<", "T", "extends", "object", ">", "{", "isValid", ":", "boolean", "|", "undefined", ";", "contents", ":", "{", "[", "K", "in", "keyof", "T", "]", ":", "boolean", "|", "undefined", ";", "}", ";", "}", "export", "interface", "HookProps", "<", "T", "extends", "object", ">", "{", "defaultValue", "?", ":", "T", ";", "onChange", "?", ":", "(", "output", ":", "Content", "<", "T", ">", ")", "=>", "void", ";", "}", "export", "interface", "MultiContent", "<", "T", "extends", "object", ">", "{", "updateContentAt", ":", "(", "id", ":", "keyof", "T", ",", "content", ":", "Content", ")", "=>", "void", ";", "saveSnapshotAndRemoveContent", ":", "(", "id", ":", "keyof", "T", ")", "=>", "void", ";", "getData", ":", "(", ")", "=>", "T", ";", "getSingleContentData", ":", "<", "K", "extends", "keyof", "T", ">", "(", "contentId", ":", "K", ")", "=>", "T", "[", "K", "]", ";", "validate", ":", "(", ")", "=>", "Promise", "<", "boolean", ">", ";", "validation", ":", "Validation", "<", "T", ">", ";", "}", "export", "function", "useMultiContent", "<", "T", "extends", "object", ">", "(", "{", "defaultValue", ",", "onChange", ",", "}", ")", "{", "/**\n * Each content validity is kept in this state. When updating a content with \"updateContentAt()\", we\n * update the state validity and trigger a re-render.\n */", "const", "[", "validation", ",", "setValidation", "]", "=", "useState", "<", "Validation", "<", "T", ">", ">", "(", "{", "isValid", ":", "true", ",", "contents", ":", "{", "}", ",", "}", "as", "Validation", "<", "T", ">", ")", ";", "/**\n * The updated data where a content current data is merged when it unmounts\n */", "const", "[", "stateData", ",", "setStateData", "]", "=", "useState", "<", "T", ">", "(", "defaultValue", "??", "(", "{", "}", "as", "T", ")", ")", ";", "/**\n * A map object of all the active content(s) present in the DOM. In a multi step\n * form wizard, there is only 1 content at the time in the DOM, but in long vertical\n * flow content, multiple content could be present.\n * When a content unmounts it will remove itself from this map.\n */", "const", "contents", "=", "useRef", "<", "Contents", "<", "T", ">", ">", "(", "{", "}", "as", "Contents", "<", "T", ">", ")", ";", "const", "updateContentDataAt", "=", "useCallback", "(", "function", "(", "updatedData", ")", "{", "setStateData", "(", "(", "prev", ")", "=>", "(", "{", "...", "prev", ",", "...", "updatedData", ",", "}", ")", ")", ";", "}", ",", "[", "]", ")", ";", "/**\n * Read the multi content data.\n */", "const", "getData", "=", "useCallback", "(", "(", ")", ":", "T", "=>", "{", "/**\n * If there is one or more active content(s) in the DOM, and it is valid,\n * we read its data and merge it into our stateData before returning it.\n */", "const", "activeContentData", "=", "{", "}", ";", "for", "(", "const", "[", "id", ",", "_content", "]", "of", "Object", ".", "entries", "(", "contents", ".", "current", ")", ")", "{", "if", "(", "validation", ".", "contents", "[", "id", "as", "keyof", "T", "]", "!==", "false", ")", "{", "const", "contentData", "=", "(", "_content", "as", "Content", ")", ".", "getData", "(", ")", ";", "(", "_content", "as", "Content", ")", ".", "getData", "=", "(", ")", "=>", "contentData", ";", "activeContentData", "[", "id", "as", "keyof", "T", "]", "=", "contentData", ";", "}", "}", "return", "{", "...", "stateData", ",", "...", "activeContentData", ",", "}", ";", "}", ",", "[", "stateData", ",", "validation", "]", ")", ";", "/**\n * Read a single content data.\n */", "const", "getSingleContentData", "=", "useCallback", "(", "<", "K", "extends", "keyof", "T", ">", "(", "contentId", ")", ":", "T", "[", "K", "]", "=>", "{", "if", "(", "contents", ".", "current", "[", "contentId", "]", ")", "{", "return", "contents", ".", "current", "[", "contentId", "]", ".", "getData", "(", ")", ";", "}", "return", "stateData", "[", "contentId", "]", ";", "}", ",", "[", "stateData", "]", ")", ";", "const", "updateContentValidity", "=", "useCallback", "(", "(", "updatedData", ")", ":", "boolean", "|", "undefined", "=>", "{", "let", "isAllContentValid", "=", "validation", ".", "isValid", ";", "setValidation", "(", "(", "prev", ")", "=>", "{", "if", "(", "Object", ".", "entries", "(", "updatedData", ")", ".", "every", "(", "(", "[", "contentId", ",", "isValid", "]", ")", "=>", "prev", ".", "contents", "[", "contentId", "as", "keyof", "T", "]", "===", "isValid", ")", ")", "{", "isAllContentValid", "=", "prev", ".", "isValid", ";", "return", "prev", ";", "}", "const", "nextContentsValidityState", "=", "{", "...", "prev", ".", "contents", ",", "...", "updatedData", ",", "}", ";", "isAllContentValid", "=", "Object", ".", "values", "(", "nextContentsValidityState", ")", ".", "some", "(", "(", "_isValid", ")", "=>", "_isValid", "===", "undefined", ")", "?", "undefined", ":", "Object", ".", "values", "(", "nextContentsValidityState", ")", ".", "every", "(", "Boolean", ")", ";", "return", "{", "isValid", ":", "isAllContentValid", ",", "contents", ":", "nextContentsValidityState", ",", "}", ";", "}", ")", ";", "return", "isAllContentValid", ";", "}", ",", "[", "validation", ".", "isValid", "]", ")", ";", "/**\n * Validate the content(s) currently in the DOM\n */", "const", "validate", "=", "useCallback", "(", "async", "(", ")", "=>", "{", "if", "(", "Object", ".", "keys", "(", "contents", ".", "current", ")", ".", "length", "===", "0", ")", "{", "return", "Boolean", "(", "validation", ".", "isValid", ")", ";", "}", "const", "updatedValidation", "=", "{", "}", "as", "{", "[", "key", "in", "keyof", "T", "]", "?", ":", "boolean", "|", "undefined", ";", "}", ";", "for", "(", "const", "[", "id", ",", "_content", "]", "of", "Object", ".", "entries", "(", "contents", ".", "current", ")", ")", "{", "const", "isValid", "=", "await", "(", "_content", "as", "Content", ")", ".", "validate", "(", ")", ";", "(", "_content", "as", "Content", ")", ".", "validate", "=", "async", "(", ")", "=>", "isValid", ";", "updatedValidation", "[", "id", "as", "keyof", "T", "]", "=", "isValid", ";", "}", "return", "Boolean", "(", "updateContentValidity", "(", "updatedValidation", ")", ")", ";", "}", ",", "[", "validation", ".", "isValid", ",", "updateContentValidity", "]", ")", ";", "/**\n * Update a content. It replaces the content in our \"contents\" map and update\n * the state validation object.\n */", "const", "updateContentAt", "=", "useCallback", "(", "function", "(", "contentId", ",", "content", ")", "{", "contents", ".", "current", "[", "contentId", "]", "=", "content", ";", "const", "updatedValidity", "=", "{", "[", "contentId", "]", ":", "content", ".", "isValid", "}", "as", "{", "[", "key", "in", "keyof", "T", "]", ":", "boolean", "|", "undefined", ";", "}", ";", "const", "isValid", "=", "updateContentValidity", "(", "updatedValidity", ")", ";", "if", "(", "onChange", "!==", "undefined", ")", "{", "onChange", "(", "{", "isValid", ",", "validate", ",", "getData", ",", "}", ")", ";", "}", "}", ",", "[", "updateContentValidity", ",", "onChange", ",", "getData", ",", "validate", "]", ")", ";", "/**\n * When a content unmounts we want to save its current data state so we will be able\n * to provide it as \"defaultValue\" the next time the component is mounted.\n */", "const", "saveSnapshotAndRemoveContent", "=", "useCallback", "(", "function", "(", "contentId", ")", "{", "if", "(", "contents", ".", "current", "[", "contentId", "]", ")", "{", "const", "updatedData", "=", "{", "[", "contentId", "]", ":", "contents", ".", "current", "[", "contentId", "]", ".", "getData", "(", ")", ",", "}", "as", "{", "[", "key", "in", "keyof", "T", "]", "?", ":", "any", ";", "}", ";", "updateContentDataAt", "(", "updatedData", ")", ";", "delete", "contents", ".", "current", "[", "contentId", "]", ";", "}", "}", ",", "[", "updateContentDataAt", "]", ")", ";", "return", "{", "getData", ",", "getSingleContentData", ",", "validate", ",", "validation", ",", "updateContentAt", ",", "saveSnapshotAndRemoveContent", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]