JSPM

  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q25159F
  • License MIT

A lightweight polyfill lib.

Package Exports

  • hpolyfill

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hpolyfill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

HPolyfill

This is a lightweight(less than 10KB after minimization) polyfill lib which includes some common polyfills.

Usage

You can just simply include it in your HTML file to get the polyfills:

<script type="text/javascript" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/hpolyfill@latest/dist/index.js"></script>
<script type="text/javascript" crossorigin="anonymous" src="https://unpkg.com/hpolyfill@latest/dist/index.js"></script>

Polyfill list

  • Set
    • basic functionality
    • constructor arguments
    • set.add() returns this
    • convert -0 key into +0
    • set.forEach()
    • set.delete()
    • set.clear()
    • set.size
    • set[Symbol.iterator]()
  • Map
    • basic functionality
    • constructor arguments
    • map.set() returns this
    • convert -0 key into +0
    • map.forEach()
    • map.delete()
    • map.clear()
    • map.size
    • map[Symbol.iterator]()
  • Promise
    • basic functionality
    • Promise.all()
    • Promise.race()
    • Promise.resolve()
    • Promise.reject()
    • promise.finally()
  • Array
    • Array.from()
    • Array.of()
    • array.indexOf() supports NaN
    • array.includes()
    • array.fill()
    • array.find()
    • array.findIndex()
    • array.flat()
    • array.flatMap()
    • array.keys()
    • array.values()
    • array.entries()
    • array[Symbol.iterator]()
  • Object
    • Object.assign()
    • Object.is()
    • Object.keys()
    • Object.values()
    • Object.entries()
  • Number
    • Number.isNaN()
    • Number.isFinite()
  • String
    • String.raw()
    • string.includes()
    • string.repeat()
    • string.startsWith()
    • string.endsWith()
    • string.padStart()
    • string.padEnd()
    • string[Symbol.iterator]()
  • Symbol
    • basic functionality
    • Symbol.for()
    • Symbol.keyFor()
    • Symbol.iterator
  • RAF
    • requestAnimationFrame()
    • cancelAnimationFrame()
  • Performance
    • performance.now()

ps

If you find any problem or something necessary not included in this lib, feel free to open an issue.