1.0.0 • Published 6 years ago
ts-replace-all v1.0.0
String#replaceAll polyfill for TypeScript
This package includes the core-js polyfill for String#replaceAll, along with TypeScript typings.
The replaceAll function is defined in this TC39 proposal.
Installation
npm install --save ts-replace-allUsage
import 'ts-replace-all'
'test'.replaceAll('t', '1')
'test'.replaceAll('t', () => '2')
'test'.replaceAll(/t/g, '3')
'test'.replaceAll(/t/g, () => '4')API
The API specification is available in the TC39 proposal.
1.0.0
6 years ago