diff --git a/types/contains-path/contains-path-tests.ts b/types/contains-path/contains-path-tests.ts new file mode 100644 index 0000000000..896cf86fe4 --- /dev/null +++ b/types/contains-path/contains-path-tests.ts @@ -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 diff --git a/types/contains-path/index.d.ts b/types/contains-path/index.d.ts new file mode 100644 index 0000000000..7d607c0cbb --- /dev/null +++ b/types/contains-path/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for contains-path 1.0 +// Project: https://github.com/jonschlinkert/contains-path +// Definitions by: 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; + } +} diff --git a/types/contains-path/tsconfig.json b/types/contains-path/tsconfig.json new file mode 100644 index 0000000000..5302a9a8e0 --- /dev/null +++ b/types/contains-path/tsconfig.json @@ -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" + ] +} diff --git a/types/contains-path/tslint.json b/types/contains-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/contains-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }