Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Add aliases for array, dictionary, and set methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cxmeel committed Mar 14, 2024
1 parent 0d8a693 commit 77a310c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/Array/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@ local array = {
zipAll = require("./zipAll"),
}

array.join = array.concat
array.merge = array.concat
array.append = array.push
array.prepend = array.unshift
array.indexOf = array.find
array.has = array.includes
array.contains = array.includes
array.isArray = array.is

return array
3 changes: 3 additions & 0 deletions src/Dictionary/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ local dictionary = {
pick = require("./pick"),
}

dictionary.join = dictionary.merge
dictionary.joinDeep = dictionary.mergeDeep

return dictionary
5 changes: 5 additions & 0 deletions src/Set/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ local set = {
toArray = require("./toArray"),
}

set.fromList = set.fromArray
set.join = set.merge
set.subtract = set.delete
set.union = set.merge

return set
15 changes: 13 additions & 2 deletions src/init.luau
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
local Util = require("@Sift/Util")

--[=[
@class Sift
@class Sift
Sift is a library for working with immutable data structures. It provides a collection of methods for working with arrays, dictionaries and sets.
Sift is a library for working with immutable data structures. It provides a collection of methods for working with arrays, dictionaries and sets.
]=]
local sift = {
None = require("@Sift/None"),
Expand All @@ -17,4 +17,15 @@ local sift = {
normalizeIndex = Util.normalizeIndex,
}

sift.List = sift.Array

--- @prop Array Array
--- @within Sift

--- @prop Dictionary Dictionary
--- @within Sift

--- @prop Set Set
--- @within Sift

return sift

0 comments on commit 77a310c

Please sign in to comment.