question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allow spec.map to work with an empty map

See original GitHub issue

spec.map("sth", {})

throws the error Cannot use Keys spec without keys.

Well, it’s the same as spec.object

But it would be nice to do something like this: spec.map("sth", {[optional]: {a: spec.string}})

So I think there should just be no checking for empty maps, it’s ok when they are empty.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mattbishopcommented, Aug 9, 2017
0reactions
prayerslayercommented, Aug 13, 2017

Should be fixed with #41 thanks to @mattbishop

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing with an empty array when using .map() in React
map ((item, i) => { return( .... Doing . map() on empty array will not produces an error, but will return an empty...
Read more >
FAQ - SpecMap
SpecMap is designed to work with either the Agile or Scrum templates, and requires certain fields to be present in TFS. SpecMap does...
Read more >
Setting up the Specular Map | Substance Painter - YouTube
Links:TexConv Converter:https://vvvv.org/contribution/texconvgui Google Drive Link with all the Substance Painter ...
Read more >
Using Maps in Typespecs - Crevalle
Summary: We look at some examples of how to typespec maps that are passed as ... Keys aside from :email and :age are...
Read more >
Create an Empty Map in Java - Baeldung
We can create an empty Map using the emptyMap() method provided by the Java Collections module. This will form an empty Map that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found