Merge pull request #31657 from BendingBender/contains-path

[contains-path] Add types
This commit is contained in:
Wesley Wigham
2018-12-24 21:16:33 -08:00
committed by GitHub
4 changed files with 48 additions and 0 deletions
@@ -0,0 +1,5 @@
import containsPath = require('contains-path');
containsPath('foo/bar', 'foo'); // $ExpectType boolean
containsPath('foo/bar', 'FOO', { nocase: true }); // $ExpectType boolean
containsPath('foobar', 'foo', { partialMatch: true }); // $ExpectType boolean
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for contains-path 1.0
// Project: https://github.com/jonschlinkert/contains-path
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = containsPath;
declare function containsPath(
filepath: string,
substr: string,
options?: containsPath.Options
): boolean;
declare namespace containsPath {
interface Options {
nocase?: boolean;
partialMatch?: boolean;
}
}
+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",
"contains-path-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }