svizzle
svizzle copied to clipboard
/utils: add all missing `Array` generics
-
investigate which functions of [1] are not covered by functions accepting iterables in
lamb
or@svizzle/utils
-
for those having a correspondent function in
@svizzle/utils
[2], make sure they have@see
pointing to the correspondentArray
method -
provide the missing ones as generics (
e.g. splice
) with tests as usual so that we can see how they work
-
-
for all of them, make sure their name explicitly refer to a array input (e.g.
split
seems too generic)
(if needed, split this task in 2+ PRs)
[1] Possibly missing String
generics
Array.prototype.copyWithin()
Array.prototype.entries()
Array.prototype.every()
Array.prototype.fill()
Array.prototype.filter()
Array.prototype.find()
Array.prototype.findIndex()
Array.prototype.flat()
Array.prototype.flatMap()
Array.prototype.forEach()
Array.from()
Array.prototype.indexOf()
Array.isArray()
Array.prototype.keys()
Array.prototype.lastIndexOf()
Array.prototype.map()
Array.of()
Array.prototype.pop()
Array.prototype.push()
Array.prototype.reduce()
Array.prototype.reduceRight()
Array.prototype.reverse()
Array.prototype.shift()
Array.prototype.slice()
Array.prototype.some()
Array.prototype.sort()
Array.prototype.splice()
Array.prototype.toLocaleString()
Array.prototype.toString()
Array.prototype.unshift()
Array.prototype.values()
[2] Existing Array
generics
method | current name | new name |
---|---|---|
Array.prototype.concat | concat | |
Array.prototype.includes | includes | arrayIncludes |
Array.prototype.join | join | [remove?](https://ascartabelli.github.io/lamb/module-lamb.html#joinWith) |