poorlyfills

0.1.2 • Public • Published

poorlyfills

License: ISC Build Status Coverage Status donate

Simplified, partial, and poor ES6 collections polyfills, targeting IE9+ and older mobile browsers.

  • Map based on double private arrays and indexOf(...) quirks
  • Set based on a map with same values as keys
  • WeakMap based on a configurable, not enumerable, not writable, unique id property
  • WeakSet based on a WeakMap and a simple true value per each key

All collections are missing constructor functionality and Symbols features.

How To

The index.js file is an ES2015 module you can include in your projects as such:

import {Map, Set, WeakMap, WeakSet} from 'poorlyfills';

The native Map, Set, WeakMap, and Weakset will always be preferred over the fallback.

If you'd like to simply include this package on your Web pages, you can do it via unpkg:

<!doctype html>
<script src="https://unpkg.com/poorlyfills@latest/min.js"></script>

Compatibility

You can test compatibility as both ES2015 module and ES5 transpiled code for IE9+.

... but why ...

After this tweet, and this request, and after writing myself these partial polyfills dunno how many times, I've decided to make it an official, fully test covered, package.

Package Sidebar

Install

npm i poorlyfills

Weekly Downloads

1

Version

0.1.2

License

ISC

Unpacked Size

7.01 kB

Total Files

5

Last publish

Collaborators

  • webreflection