mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Add types for is-obj and is-regexp (#30571)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
4d24ec8a7e
commit
502207021b
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for is-obj 1.0
|
||||
// Project: https://github.com/sindresorhus/is-obj#readme
|
||||
// Definitions by: Emily Marigold Klassen <https://github.com/forivall>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = isObj;
|
||||
|
||||
declare function isObj(x: any): x is object;
|
||||
@@ -0,0 +1,10 @@
|
||||
import isObj = require('is-obj');
|
||||
|
||||
isObj({foo: 'bar'});
|
||||
// => true
|
||||
|
||||
isObj([1, 2, 3]);
|
||||
// => true
|
||||
|
||||
isObj('foo');
|
||||
// => false
|
||||
@@ -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",
|
||||
"is-obj-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for is-regexp 2.0
|
||||
// Project: https://github.com/sindresorhus/is-regexp#readme
|
||||
// Definitions by: Emily Marigold Klassen <https://github.com/forivall>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export = isRegexp;
|
||||
|
||||
declare function isRegexp(input: any): input is RegExp;
|
||||
@@ -0,0 +1,10 @@
|
||||
import isRegexp = require('is-regexp');
|
||||
|
||||
isRegexp('unicorn');
|
||||
// => false
|
||||
|
||||
isRegexp(/unicorn/);
|
||||
// => true
|
||||
|
||||
isRegexp(new RegExp('unicorn'));
|
||||
// => true
|
||||
@@ -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",
|
||||
"is-regexp-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user