mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Flatten at paths parameter (#4431)
* Enable at tests * Flatten at paths parameter
This commit is contained in:
committed by
John-David Dalton
parent
1011cfdf4c
commit
e5f840745b
3
at.js
3
at.js
@@ -1,4 +1,5 @@
|
||||
import baseAt from './.internal/baseAt.js'
|
||||
import baseFlatten from './.internal/baseFlatten.js'
|
||||
|
||||
/**
|
||||
* Creates an array of values corresponding to `paths` of `object`.
|
||||
@@ -15,6 +16,6 @@ import baseAt from './.internal/baseAt.js'
|
||||
* at(object, ['a[0].b.c', 'a[1]'])
|
||||
* // => [3, 4]
|
||||
*/
|
||||
const at = (...paths) => baseAt(paths)
|
||||
const at = (object, ...paths) => baseAt(object, baseFlatten(paths, 1))
|
||||
|
||||
export default at
|
||||
|
||||
Reference in New Issue
Block a user