From 52670470e34ab31afd946cc34939661574792ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=E1=BA=A3i?= Date: Tue, 10 Apr 2018 03:52:55 +0700 Subject: [PATCH] Change type of path.sep and path.delimiter in @types/node (#24833) * Update type of path.sep and path.delimiter * Change `path.sep` to `'\\' | '/'` * Change `path.delimiter` to `';' | ':'` * Update index.d.ts * Change types of path.sep and path.delimiter in types/node/{v8,v6} * Change types of path.sep and path.delimiter in types/node/v7 --- types/node/index.d.ts | 5 +++-- types/node/v6/index.d.ts | 5 +++-- types/node/v7/index.d.ts | 5 +++-- types/node/v8/index.d.ts | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 3404e37d46..2522d51f54 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -20,6 +20,7 @@ // Klaus Meinhardt // Huw // Nicolas Even +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** inspector module types */ @@ -4683,11 +4684,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index f38cdf01dd..ed9949a9ac 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -6,6 +6,7 @@ // Thomas Bouldin // Sebastian Silbermann // Alorel +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -3003,11 +3004,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 896b5a887f..950e143536 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -6,6 +6,7 @@ // Christian Vaagland Tellnes // Wilco Bakker // Sebastian Silbermann +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -3092,11 +3093,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). * diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 164df0a960..28bc5dc779 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -19,6 +19,7 @@ // Alberto Schiabel // Huw // Nicolas Even +// Hoàng Văn Khải // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -4662,11 +4663,11 @@ declare module "path" { /** * The platform-specific file separator. '\\' or '/'. */ - export var sep: string; + export var sep: '\\' | '/'; /** * The platform-specific file delimiter. ';' or ':'. */ - export var delimiter: string; + export var delimiter: ';' | ':'; /** * Returns an object from a path string - the opposite of format(). *