diff --git a/path-to-regexp/path-to-regexp-tests.ts b/path-to-regexp/path-to-regexp-tests.ts new file mode 100644 index 0000000000..ef622c6027 --- /dev/null +++ b/path-to-regexp/path-to-regexp-tests.ts @@ -0,0 +1,16 @@ +/// + +import pathToRegexp = require('path-to-regexp'); + +var keys: string[] = []; +var re = pathToRegexp('/foo/:bar', keys); + +re = pathToRegexp('/foo/:bar', keys, { + sensitive: true, + strict: false, + end: true +}); + +re = pathToRegexp('/foo/:bar', keys, { + sensitive: true +}); \ No newline at end of file diff --git a/path-to-regexp/path-to-regexp.d.ts b/path-to-regexp/path-to-regexp.d.ts new file mode 100644 index 0000000000..1cea46d85c --- /dev/null +++ b/path-to-regexp/path-to-regexp.d.ts @@ -0,0 +1,20 @@ +// Type definitions for path-to-regexp v1.0.3 +// Project: https://github.com/pillarjs/path-to-regexp +// Definitions by: xica +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "path-to-regexp" { + + function pathToRegexp(path: string, keys: string[], options?: pathToRegexp.Options): RegExp; + + module pathToRegexp { + + interface Options { + sensitive?: boolean; + strict?: boolean; + end?: boolean; + } + } + + export = pathToRegexp; +}