mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Added lume.invert()
This commit is contained in:
parent
b4bea5f4e0
commit
8a76fd7595
@ -115,6 +115,13 @@ an error is raised,
|
||||
lume.reduce({1, 2, 3}, function(a, b) return a + b end) -- Returns 6
|
||||
```
|
||||
|
||||
### lume.invert(t)
|
||||
Returns a copy of the table where the keys have become the values and the
|
||||
values the keys.
|
||||
```lua
|
||||
lume.invert({a = "x", b = "y"}) -- returns {x = "a", y = "b"}
|
||||
```
|
||||
|
||||
### lume.set(t [, retainkeys])
|
||||
Returns a copy of the `t` table with all the duplicate values removed. If
|
||||
`retainkeys` is true the table is not treated as an array and retains its
|
||||
|
Loading…
Reference in New Issue
Block a user