mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[parents] Add parents@1.0.1 definition
This commit is contained in:
parent
eab01caa91
commit
69b5719e32
17
types/parents/index.d.ts
vendored
Normal file
17
types/parents/index.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Type definitions for parents 1.0
|
||||
// Project: https://github.com/substack/node-parents
|
||||
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Return an array of the parent directories of 'dir', including and starting with 'dir'.
|
||||
* If a dir isn't specified, process.cwd() will be used.
|
||||
* Optionally specify an 'opts.platform' to control whether the separator and
|
||||
* paths works the unixy way with '/' or the windowsy way where sometimes things use '/' and
|
||||
* sometimes they use '\\' and also there are leading drive letters and other exotic features.
|
||||
* If 'opts.platform' isn't specified, 'process.platform' will be used.
|
||||
* Anything that matches /^win/ will use the windowsy behavior.
|
||||
*/
|
||||
declare function parents(dir?: string, opts?: { platform?: string }): string[];
|
||||
|
||||
export = parents;
|
||||
9
types/parents/parents-tests.ts
Normal file
9
types/parents/parents-tests.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import parents = require("parents");
|
||||
|
||||
function test(): string[] {
|
||||
const res1 = parents("root/user/projects/ts");
|
||||
const res2 = parents("root\\user\\projects\\ts", { platform: "win" });
|
||||
const res3 = parents();
|
||||
const res4 = parents(undefined);
|
||||
return res1 || res2 || res3 || res4;
|
||||
}
|
||||
23
types/parents/tsconfig.json
Normal file
23
types/parents/tsconfig.json
Normal 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",
|
||||
"parents-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/parents/tslint.json
Normal file
1
types/parents/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user