-
I have code that uses New user here so maybe I've missed something! Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
gruhn
May 16, 2024
Replies: 1 comment 3 replies
-
If your keys are strings, you can use const arbitraryMap = fc.dictionary(fc.string(), fc.nat())
.map(dict => new Map(Object.entries(dict)))
console.log( fc.sample(arbitraryMap, 5) ) Map(1) { 'CxbD!_' => 1135090401 },
Map(3) { 'q`' => 2113644272, ' x&~' => 27, '~}!t|z~y' => 25 },
Map(1) { '_#3' => 1738777444 },
Map(4) {
'|call}&b #' => 9,
'\\^!+L(' => 28,
'' => 1752156948,
'c' => 163999411
},
Map(7) {
'I>U){' => 1984610647,
'KEeeK' => 1524839195,
'sAZ' => 937344058,
'' => 529998270,
'Gd2#<=ZHr}' => 1135358149,
'a;kS4rzo' => 1594872950,
':(' => 641853712
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
dpnova
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If your keys are strings, you can use
fc.dictionary
. For example