Merge pull request #21598 from dex4er/nodejs-string

node: String object has additional ESNEXT methods
This commit is contained in:
Armando Aguirre
2017-12-01 14:19:41 -08:00
committed by GitHub
2 changed files with 18 additions and 0 deletions

View File

@@ -68,6 +68,14 @@ interface SymbolConstructor {
}
declare var Symbol: SymbolConstructor;
// Node.js ESNEXT support
interface String {
/** Removes whitespace from the left end of a string. */
trimLeft(): string;
/** Removes whitespace from the right end of a string. */
trimRight(): string;
}
/************************************************
* *
* GLOBAL *

View File

@@ -3751,3 +3751,13 @@ namespace module_tests {
const m1: Module = new Module("moduleId");
const m2: Module = new Module.Module("moduleId");
}
////////////////////////////////////////////////////
/// Node.js ESNEXT Support
////////////////////////////////////////////////////
namespace esnext_string_tests {
const s: string = 'foo';
const s1: string = s.trimLeft();
const s2: string = s.trimRight();
}