Package Exports
- array-replace
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (array-replace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
array-replace 
Replace array values with String.prototype.replace
Install
$ npm install --save array-replaceUsage
const arrayReplace = require('array-replace');
const arr = [
'foo',
'bar'
];
arrayReplace(arr, 'fo', 'y');
//=> ['yo', 'bar']
arrayReplace(arr, 'fo', str => str.toUpperCase());
//=> ['FOo', 'bar']API
arrayReplace(input, search, replace)
Returns a new array.
input
Required
Type: array
The array to replace values in.
search
Required
Type: string or regexp
Search for matching substring that will be replaced.
replace
Required
Type: string or function
Replacing the matching substring.
Related
- key-replace - Replace object keys with
String.prototype.replace
License
MIT © Andreas Gillström