0.3.0 • Published 6 years ago

all-filler v0.3.0

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

all-filler

Cross-platform fill function based on Array.prototype.fill for arrays or strings

npm install all-filler

Usage

const fill = require("all-filler")

strings

fill("012", 7) // "777"
fill("012", 7, -1) // "017"
fill("012", 7, 0, 1) // "712"

arrays

fill([0, 1, 2], 7) // [7, 7, 7]
fill([0, 1, 2], 7, -1) // [0, 1, 7]
fill([0, 1, 2], 7, 0, 1) // [7, 1, 2]