cxmeel / sift

Immutable data library for Luau.
https://csqrl.github.io/sift/
MIT License
62 stars 10 forks source link

v0.0.2 #4

Closed cxmeel closed 2 years ago

cxmeel commented 2 years ago

Handle Holes in Arguments

Patched an issue in Array.concat(Deep), Dictionary.merge(Deep) and Set.merge where they would stop at a nil value in the arguments. This closes #3.

This is because, when using ipairs, it automatically assumes the end of the array has been reached when it hits a nil value.

The new implementation uses select to process the vararg (...) in order to continue processing even if a nil value is present.

Out of Bound Indices

Array.insert will now properly handle out of bound indices.

An index of 0 will cause items to be inserted at the end of the array (since arrays are 1-indexed in Luau).

An index of length+1 will also allow values to be inserted at the end of the array. Indices of length+2 or greater will be ignored and return the original array (I'm open to changing this behaviour to throw if requested!).

Bump Package Versions

Bump Tooling Versions

Reselim commented 2 years ago

Thanks for the fix!