mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-08 18:34:06 +08:00
Merge pull request #24657 from jewbre/feature/types-for-escape-regexp
Types for escape-regexp 0.0
This commit is contained in:
22
types/escape-regexp/escape-regexp-tests.ts
Normal file
22
types/escape-regexp/escape-regexp-tests.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import escapeRegExp = require('escape-regexp');
|
||||
|
||||
// $ExpectType string
|
||||
escapeRegExp('aaa');
|
||||
|
||||
// $ExpectError
|
||||
escapeRegExp();
|
||||
|
||||
// $ExpectError
|
||||
escapeRegExp({});
|
||||
|
||||
// $ExpectError
|
||||
escapeRegExp(1);
|
||||
|
||||
// $ExpectError
|
||||
escapeRegExp([]);
|
||||
|
||||
// $ExpectError
|
||||
escapeRegExp(null);
|
||||
|
||||
// $ExpectError
|
||||
escapeRegExp(undefined);
|
||||
9
types/escape-regexp/index.d.ts
vendored
Normal file
9
types/escape-regexp/index.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Type definitions for escape-regexp 0.0
|
||||
// Project: https://www.npmjs.com/package/escape-regexp
|
||||
// Definitions by: Vilim Stubičan <https://github.com/jewbre>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
declare function escapeRegExp(str: string): string;
|
||||
|
||||
export = escapeRegExp;
|
||||
23
types/escape-regexp/tsconfig.json
Normal file
23
types/escape-regexp/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"escape-regexp-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/escape-regexp/tslint.json
Normal file
1
types/escape-regexp/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user