Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for iterators, global, and browser environment missing #138

Open
tshinnic opened this issue Mar 4, 2019 · 2 comments
Open

Comments

@tshinnic
Copy link

tshinnic commented Mar 4, 2019

README.md mentions some features only in passing, without supporting documentation, thus leaving some features 'hidden' and unusable.

It mentions ES2015 support and documents many of the added APIs, but not all. Surprised at no mention of iterators I still found them supported in the code.

Return possibilities

  'Map Iterator'
  'Set Iterator'
  'Array Iterator'
  'String Iterator'

should be documented, though it may be hard to come up with easily understood examples on when these values are encountered. A combination of built-in objects and method calls ...?

    assert(type(new Map()).entries() === 'Map Iterator')
    assert(type(new Set()).entries() === 'Set Iterator')

While spelunking I found these browser/DOM-related values in the code:

return value notes on source
'global' (browser) window , (node) global , others...
'Location' window.location
'Document' window.document
'MimeTypeArray' window.navigator.mimeTypes
'PluginArray' window.navigator.plugins
'HTMLQuoteElement' (IE fix) HTMLElement HTMLElement BLOCKQUOTE
'HTMLTableDataCellElement' (W3C vs. WhatWG fix) HTMLElement TD
'HTMLTableHeaderCellElement' (W3C vs. WhatWG fix) HTMLElement TH

After much scrolling of doc/code windows I think the above are all the missing parts.

If the mentions in passing of "global object", "iterators", "browsers" and "HTML elements" in README.md can be matched up with documented type string return values then readers will know how to use all the features this package provides.

@keithamus
Copy link
Member

@tshinnic a lot of these rely on the browsers Symbol.toStringTag value on each implementation, which is why they're not so well documented here.

It looks like you've done a great job documenting some of these already - so if you'd like to PR what you have so far that'd be a great start to documenting all of this!

@IanKemp
Copy link

IanKemp commented Jan 13, 2020

boolean is also missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants