Skip to content

LinusU/ts-replace-all

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

String#replaceAll polyfill for TypeScript

Resources

Stars

Watchers

Forks

Packages

No packages published