Property 'trimLeft' does not exist on type 'string'. Lib: ["dom", "es2018"]

Include the library "es2019.string". Update your copy of Typescript if there is no such library. It is rather new and did not exist when this question was asked.


Update the typescript library to "typescript": "~3.6.2". Include "es2019" in the tsconfig.json lib's array. It will work.

"target": "es2015",
"typeRoots": [
  "node_modules/@types"
],
"lib": [
  "es2018",
  "es2019",
  "dom"
]