2.0.1 • Published 3 years ago

put-after v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Put after Travis CI Build Status

Put an element after another element.

NPM Badge

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.