Added lume.pick() to README

This commit is contained in:
rxi 2015-05-09 15:42:38 +01:00
parent 044141fefa
commit 6dec4a8f56

View File

@ -252,6 +252,12 @@ values the keys.
lume.invert({a = "x", b = "y"}) -- returns {x = "a", y = "b"} lume.invert({a = "x", b = "y"}) -- returns {x = "a", y = "b"}
``` ```
### lume.pick(t, ...)
Returns a copy of the table filtered to only contain values for the given keys
```lua
lume.pick({ a = 1, b = 2, c = 3 }, "a", "c") -- Returns { a = 1, c = 3 }
```
### lume.keys(t) ### lume.keys(t)
Returns an array containing each key of the table. Returns an array containing each key of the table.