From e36486c4e84bd14f79d761e63de2bf1e198cccfc Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Tue, 21 Nov 2017 11:23:55 +0100 Subject: [PATCH] padLeft/padRight are defined in es2017.string lib already --- types/node/index.d.ts | 6 +----- types/node/node-tests.ts | 16 +--------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 72e7cdbe30..61fd375e6f 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -68,12 +68,8 @@ interface SymbolConstructor { } declare var Symbol: SymbolConstructor; -// Node.js ES2017 and ESNEXT support +// Node.js ESNEXT support interface String { - /** Pads the current string with another string (repeated, if needed) so that the resulting string reaches the given length. The padding is applied from the start (left) of the current string. */ - padStart(targetLength?: number, padString?: string): string; - /** Pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string. */ - padEnd(targetLength?: number, padString?: string): string; /** Removes whitespace from the left end of a string. */ trimLeft(): string; /** Removes whitespace from the right end of a string. */ diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 34bba1f7ba..d85a2574db 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -3752,25 +3752,11 @@ namespace module_tests { const m2: Module = new Module.Module("moduleId"); } -//////////////////////////////////////////////////// -/// Node.js ES2017 Support -//////////////////////////////////////////////////// - -namespace es2017_tests { - const s: string = 'foo'; - const s1: string = s.padStart(); - const s11: string = s.padStart(10); - const s12: string = s.padStart(10, 'x'); - const s2: string = s.padEnd(); - const s21: string = s.padEnd(10); - const s22: string = s.padEnd(10, 'x'); -} - //////////////////////////////////////////////////// /// Node.js ESNEXT Support //////////////////////////////////////////////////// -namespace esnext_tests { +namespace esnext_string_tests { const s: string = 'foo'; const s1: string = s.trimLeft(); const s2: string = s.trimRight();