allow spec.map to work with an empty map
See original GitHub issuespec.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:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the same issue as https://github.com/prayerslayer/js.spec/issues/40
@arichiardi found that clojure is OK with optional-only map specs: https://github.com/prayerslayer/js.spec/issues/40#issuecomment-321199533
Should be fixed with #41 thanks to @mattbishop