forked from NvChad/NvChad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from deptno/feature/navigate-between-react-nati…
…ve-siblings feature/navigate between react native siblings
- Loading branch information
Showing
7 changed files
with
119 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
---every fn(all each items) == true | ||
---@param fn function(a):b | ||
---@param tlb table | ||
---@return boolean | ||
local some = function (fn, tlb) | ||
assert(type(fn) == "function", "fn: function") | ||
assert(type(tlb) == "table", "tlb: table(list)") | ||
|
||
local ret = {} | ||
|
||
for _, v in ipairs(tlb) do | ||
if not fn(v) then | ||
return false | ||
end | ||
end | ||
|
||
return true | ||
end | ||
|
||
return some |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
---is_equal curring (x) => (y) => x == y | ||
---@param v any | ||
---@return function (yy) => boolean | ||
local is_equal = function (v) | ||
return function(vv) | ||
return vv == v | ||
end | ||
end | ||
|
||
return is_equal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
---slice make table<a> subset | ||
---@param startIndex number index | ||
---@param endIndex number index | ||
---@param tlb table list | ||
---@return table | ||
local slice = function (startIndex, endIndex, tlb) | ||
assert(type(startIndex) == "number", "startIndex: number") | ||
assert(type(endIndex) == "number", "endIndex: number") | ||
assert(type(tlb) == "table", "tlb: table(list)") | ||
|
||
local ret = {} | ||
|
||
for i, v in ipairs(tlb) do | ||
if i >= startIndex and i <= endIndex then | ||
table.insert(ret, v) | ||
end | ||
end | ||
|
||
return ret | ||
end | ||
|
||
return slice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
---some atleast one item meets fn(item) == true | ||
---@param fn function(a):b | ||
---@param tlb table | ||
---@return boolean | ||
local some = function (fn, tlb) | ||
assert(type(fn) == "function", "fn: function") | ||
assert(type(tlb) == "table", "tlb: table(list)") | ||
|
||
local ret = {} | ||
|
||
for _, v in ipairs(tlb) do | ||
if fn(v) then | ||
return true | ||
end | ||
end | ||
|
||
return false | ||
end | ||
|
||
return some |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters