🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

find-replace

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-replace

Find and replace items of an array

0.2.1
Source
npm
Version published
Weekly downloads
3.1M
-17.78%
Maintainers
1
Weekly downloads
 
Created
Source

view on npm npm module downloads per month Build Status Dependency Status

find-replace

Find and replace items in an array.

Example

> findReplace = require("find-replace");

> findReplace([ 1, 2, 3], 2, "two")
[ 1, 'two', 3 ]

> findReplace([ 1, 2, 3], 2, [ "two", "zwei" ])
[ 1, [ 'two', 'zwei' ], 3 ]

> findReplace([ 1, 2, 3], 2, "two", "zwei")
[ 1, 'two', 'zwei', 3 ]

findReplace(array, valueTest, [...replaceWith]) ⇒ array

Kind: Exported function

ParamTypeDescription
arrayarraythe input array
valueTestvalueTesta query to match the value you're looking for
[...replaceWith]anyoptional replacement items

© 2015 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.

Keywords

find

FAQs

Package last updated on 10 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts