char/avril

(wip) why'd you have to go and make things so complicaaaaated?

git clone https://git.t4t.associates/char/avril

Charlotte Somport URLPattern extension to typescript5553f00

main
863 B21 linesraw
1declare module "ext:core/ops" {
2  export type PatternComponent =
3    | "protocol"
4    | "username"
5    | "password"
6    | "hostname"
7    | "port"
8    | "pathname"
9    | "search"
10    | "hash";
11  export type PatternInit = Partial<Record<PatternComponent | "baseURL", string>>;
12  export type PatternInput = string | PatternInit;
13  export type NativeComponent = [pattern: string, regexp: string, names: string[], flags: string];
14
15  export function op_urlpattern_parse(
16    args: [input: PatternInput, base: string | null, ignoreCase: boolean],
17  ): [pattern: [components: NativeComponent[], hasRegExpGroups: boolean], error: null] | [pattern: null, error: string];
18  export function op_urlpattern_match_input(
19    args: [input: PatternInput, base: string | null],
20  ): [values: Record<PatternComponent, string> | null, error: null] | [values: null, error: string];
21}