mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat: Add is‑regex v1.0 (#45252)
This commit is contained in:
parent
8d8b587aae
commit
16ea51cd4f
11
types/is-regex/index.d.ts
vendored
Normal file
11
types/is-regex/index.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Type definitions for is-regex 1.0
|
||||
// Project: https://github.com/ljharb/is-regex
|
||||
// Definitions by: Jordan Harband <https://github.com/ljharb>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Returns whether the value is a valid `RegExp` object with the `[[RegExpMatcher]]` internal slot.
|
||||
*/
|
||||
declare function isRegex(value: any): value is RegExp;
|
||||
export = isRegex;
|
||||
7
types/is-regex/is-regex-tests.ts
Normal file
7
types/is-regex/is-regex-tests.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import isRegExp = require('is-regex');
|
||||
|
||||
declare var any: unknown;
|
||||
|
||||
if (isRegExp(any)) {
|
||||
any; // $ExpectType RegExp
|
||||
}
|
||||
19
types/is-regex/tsconfig.json
Normal file
19
types/is-regex/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["ES2015"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"is-regex-tests.ts",
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
1
types/is-regex/tslint.json
Normal file
1
types/is-regex/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user