-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom function support for case matching
Update readome Move types out to type files
- Loading branch information
1 parent
d62b931
commit 4c2d18b
Showing
8 changed files
with
366 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type FunctionType< | ||
T extends Record<string, unknown> = Record<string, unknown>, | ||
> = ( | ||
val: unknown, | ||
ctx: T, | ||
matched: string, | ||
) => unknown; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export type ArgType = number | string; | ||
|
||
export type FuncParamType = "num" | "str" | "key" | "bool" | "fn"; | ||
|
||
/** | ||
* A map of functions, how many args and their types they take, and their names | ||
*/ | ||
export interface FUNCSMapType { | ||
[func_name: string]: { | ||
arg_count: number; | ||
arg_types: [ | ||
(FuncParamType)[], | ||
(FuncParamType)[]?, | ||
]; | ||
// deno-lint-ignore no-explicit-any | ||
func: (...args: any) => boolean; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.