Add types for clean-regexp

This commit is contained in:
Dimitri Benin
2018-12-12 02:13:13 +01:00
parent 10739f8bd4
commit 1721361171
4 changed files with 44 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import cleanRegexp = require('clean-regexp');
// $ExpectType string
cleanRegexp('[0-9]');
cleanRegexp('[^0-9]');
cleanRegexp('[a-zA-Z0-9_]');
cleanRegexp('[a-z0-9_]', 'i');
cleanRegexp('[^a-zA-Z0-9_]');
cleanRegexp('[^a-z0-9_]', 'i');
cleanRegexp('[a-zA-Z\\d_]');
cleanRegexp('[^a-zA-Z\\d_]');
cleanRegexp('[0-9]+\\.[a-zA-Z0-9_]?');
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for clean-regexp 1.0
// Project: https://github.com/samverschueren/clean-regexp#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = cleanRegexp;
declare function cleanRegexp(regexp: string, flags?: string): string;
+23
View 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",
"clean-regexp-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }