2.0.1 • Published 3 years ago
put-after v2.0.1
Put after
Put an element after another element.
Install
npm install put-after
Usage
const putAfter = require("put-after")
putAfter("ac", "a", "b")
//=> 'abc'
putAfter(["a", "c"], "a", "b")
//=> ['a', 'b', 'c']
API
putAfter(source, find, add)
source
Type: string | array
The element to search.
find
Type: string | number
The search key. Can be a specific part of the element or an index.
add
Type: any
The element to add.