type-detect
type-detect copied to clipboard
[documentation] state all the possible types in Readme
hi all, This library introduces some types that don't exist in ES5 and I found it slightly annoying to do a guesswork, which type starts with capital letter and which does not.
I couldn't find the list of types in Chai documentation website. Even if it's there hidden somewhere, it would be nice to add the list of all types that this library produces in this library's README.
For example (with correct capitalisation):
-
string
<< lowercase -
Object
<< uppercase -
Function
<< uppercase -
boolean
<< lowercase - ...
and so on..
What do you think?
Essentially everything that is a primitive value should have a lowercase name, and everything else should be title case. So the only lowercase types should be number
, boolean
, string
, null
, undefined
. But I would be happy to see this documented in the readme, would you like to submit a PR?
Hi Keith, thank you for a quick response. You pretty much distilled it, if we mentioned those 5 and that the rest is title case, that could be it. If you have commit rights, maybe it would be quicker if you dropped it into readme?
I do have commit rights, but I would much rather see a healthy community where people have a chance to contribute in ways that they see meaningful - so please, if you would be so kind as to raise a PR documenting this how you feel it is important, that'd be awesome 💯
Would be even better if the module contained a list of constants defining each type, so I could just do expect(result).to.be.a(TypeDetect.NUMBER)
. Never made a PR to a public repo before but I'll add this to my todo list!