mirror of
https://github.com/dzeiocom/libs.git
synced 2025-07-25 14:29:51 +00:00
fix: when path is empty it should return the current object
Signed-off-by: Avior <git@avior.me>
This commit is contained in:
@ -511,11 +511,9 @@ describe('object get', () => {
|
||||
})
|
||||
|
||||
it('object get should return undefined', () => {
|
||||
expect(() => {
|
||||
objectGet({a: { b: [{ c: 'pouet' }]}}, [])
|
||||
}).toThrow()
|
||||
expect(() => {
|
||||
objectGet({a: { b: [{ c: 'pouet' }]}}, '')
|
||||
}).toThrow()
|
||||
expect(objectGet({a: 'pouet'}, []))
|
||||
.toEqual({a: 'pouet'})
|
||||
expect(objectGet({a: 'pouet'}, ''))
|
||||
.toEqual({a: 'pouet'})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user