3.2.0 • Published 2 years ago

just-insert v3.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

just-insert

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-insert
yarn add just-insert

Inserts a sub-array into an array starting at the given index. Returns a copy

import insert from 'just-insert';

insert([1, 2, 5, 6], ['a', 'c', 'e'], 2); // [1, 2, 'a', 'c', 'e', 5, 6]
insert([1, 2, 5, 6], 'a', 2); // [1, 2, 'a', 5, 6]
insert([1, 2, 5, 6], ['a', 'c', 'e'], 0); // ['a', 'c', 'e', 1, 2, 5, 6]
insert([1, 2, 5, 6], ['a', 'c', 'e']); // ['a', 'c', 'e', 1, 2, 5, 6]
3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.3.0

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.0.0

8 years ago