ts-replace-all
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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-all

Usage

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.

Package Sidebar

Install

npm i ts-replace-all

Weekly Downloads

52,808

Version

1.0.0

License

MIT

Unpacked Size

1.91 kB

Total Files

4

Last publish

Collaborators

  • linusu