diff --git a/src/index.spec.ts b/src/index.spec.ts index ffd092f..d0dd420 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -161,7 +161,7 @@ describe("path-to-regexp", () => { const toPath = compile("{/:foo}+"); expect(() => { - toPath({ foo: [1, "a"] }); + toPath({ foo: [1, "a"] as any }); }).toThrow(new TypeError('Expected "foo/0" to be a string')); }); diff --git a/src/index.ts b/src/index.ts index e0165ea..3f0721a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -328,7 +328,7 @@ export function parse(str: string, options: ParseOptions = {}): TokenData { /** * Compile a string to a template function for the path. */ -export function compile

( +export function compile

( path: Path, options: CompileOptions = {}, ) {