Immutable data library for Luau (Roblox).
Heavily based on @freddylist's Llama library, which is no longer maintained.
Documentation, powered by moonwave, is available at https://csqrl.github.io/sift.
For the time being, releases will remain at v0.x, and Sift should not be considered 100% stable. This is in line with the Semantic Versioning 2.0.0 specification.
- Breaking changes may occur when the minor version is incremented.
- The patch version will be incremented for additions, non-breaking changes, and bug fixes.
This will remain the same until v1.x.
Sift is available from Wally, Itch.io, the Roblox Library, and GitHub releases.
While Sift is 100% free and open source, if you feel like sponsoring, Sift is also available on Itch.io.
Wally is a CLI package manager (much like NPM, Yarn or Cargo) for Roblox by @UpliftGames. Find out more at https://github.com/upliftgames/wally.
# wally.toml
[dependencies]
Sift = "csqrl/[email protected]"
$ wally install
You shouldn't need to use Sift in TypeScript. Sift essentially brings the power of TypeScript's Array, Object and Set methods to Luau.
See more on MDN:
Grab a copy from the Roblox Library or GitHub releases, and drop it into Studio.
As per the recommendations in Llama's README, the following changes have been made:
- Sift utilises native Luau types. Llama used @osyrisrblx/t for type checking, which meant that types were only checked at runtime.
- Sift will not check types at runtime. If you're using the library wrong, you'll get errors at runtime anyway!
- Organised tests.
*.spec
files are now alongside their source files, making it easier to locate them. - Documentation is now generated using @upliftgames' moonwave (Docusaurus). This makes it quick and easy to add new documentation, and provides a pleasant experience for the user.
at
: Get an element at a specific index (negative indices are supported).freeze
: Freeze an array.freezeDeep
: Freeze an array and all nested arrays.shuffle
: Shuffle the elements of an array to a random order.
entries
: Get the entries of a dictionary as an array of key-value pairs.freeze
: Freeze a dictionary.freezeDeep
: Freeze a dictionary and all nested dictionaries.fromEntries
: Create a dictionary from an array of key-value pairs.
count
: Get the number of elements in a set.