Merge pull request #3874 from xica/feature/pathToRegexp

add path-to-regexp definition.
This commit is contained in:
Masahiro Wakame
2015-03-21 11:31:39 +09:00
2 changed files with 36 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
/// <reference path='path-to-regexp.d.ts' />
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
});
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for path-to-regexp v1.0.3
// Project: https://github.com/pillarjs/path-to-regexp
// Definitions by: xica <https://github.com/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;
}