mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
add path-to-regexp definition.
This commit is contained in:
parent
95d860879f
commit
84a60d89c5
16
path-to-regexp/path-to-regexp-tests.ts
Normal file
16
path-to-regexp/path-to-regexp-tests.ts
Normal 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
path-to-regexp/path-to-regexp.d.ts
vendored
Normal file
20
path-to-regexp/path-to-regexp.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user