chore(multi-key-map/README): sync with USAGE
This commit is contained in:
parent
a584daa92d
commit
8f4dae3134
@ -21,15 +21,20 @@ import { MultiKeyMap } from '@vates/multi-key-map'
|
|||||||
|
|
||||||
const map = new MultiKeyMap()
|
const map = new MultiKeyMap()
|
||||||
|
|
||||||
|
const OBJ = {}
|
||||||
map.set([], 0)
|
map.set([], 0)
|
||||||
map.set(['foo'], 1)
|
map.set(['foo'], 1)
|
||||||
map.set(['foo', 'bar'], 2)
|
map.set(['foo', 'bar'], 2)
|
||||||
map.set(['bar', 'foo'], 3)
|
map.set(['bar', 'foo'], 3)
|
||||||
|
map.set([OBJ], 4)
|
||||||
|
map.set([{}], 5)
|
||||||
|
|
||||||
map.get([]) // 0
|
map.get([]) // 0
|
||||||
map.get(['foo']) // 1
|
map.get(['foo']) // 1
|
||||||
map.get(['foo', 'bar']) // 2
|
map.get(['foo', 'bar']) // 2
|
||||||
map.get(['bar', 'foo']) // 3
|
map.get(['bar', 'foo']) // 3
|
||||||
|
map.get([OBJ]) // 4
|
||||||
|
map.get([{}]) // undefined
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributions
|
## Contributions
|
||||||
|
Loading…
Reference in New Issue
Block a user