Git Product home page Git Product logo

es-shim's Introduction

ES-shim

Simpleness ES5,6 shim for client javascript.

You can use some ES5 or ES6 features in old browsers,like Promise JSON Array.prototype.forEach String.prototyp.repeat etc.


Why ES-shim ?

ES5-shim,ES6-shim are can't decomposed and complicated.

ES-shim is decomposed and simpler and more applied to actual projects.


How to use ?

<script src="es.js"></script>
<script src="array.js"></script> <!-- The Array's ES5,6 features are availabled -->

Supported Features

Array

  • Array.from
  • Array.of
  • Array.prototype.copyWithin
  • Array.prototype.fill
  • Array.prototype.find
  • Array.prototype.findIndex
  • Array.prototype.keys
  • Array.prototype.entries
  • Array.prototype.values
  • Array.isArray
  • Array.prototype.every
  • Array.prototype.filter
  • Array.prototype.forEach
  • Array.prototype.indexOf
  • Array.prototype.lastIndexOf
  • Array.prototype.map
  • Array.prototype.some
  • Array.prototype.reduce
  • Array.prototype.reduceRight
  • Array.prototype.unshift fix bug

Boolean

  • Boolean.prototype.toJSON

Date

  • Date.now
  • Date.toISOString
  • Date.toJSON

Function

  • Function.prototype.bind

Math

  • Math.acosh
  • Math.asinh
  • Math.atanh
  • Math.cbrt
  • Math.clz32
  • Math.cosh
  • Math.expm1
  • Math.hypot
  • Math.log2
  • Math.log10
  • Math.log1p
  • Math.sign
  • Math.sinh
  • Math.tanh
  • Math.trunc
  • Math.imul
  • Math.fround
  • Math.round fix bug

Number

  • Number.prototype.toJSON
  • Number.prototype.toFixed fix bug
  • Number.MAX_SAFE_INTEGER
  • Number.MIN_SAFE_INTEGER
  • Number.EPSILON
  • Number.parseInt
  • Number.parseFloat
  • Number.isFinite
  • Number.isNaN
  • Number.isInteger
  • Number.isSafeInteger

Regexp

Object

  • Object.keys
  • Object.create
  • Object.defineProperty

defineProperty and create is not a standard implementation,just a basic function imitation.

  • Object.is
  • Object.assign

String

  • String.prototype.trim
  • String.prototype.toJSON
  • String.fromCodePoint
  • String.raw
  • String.prototype.codePointAt
  • String.prototype.repeat
  • String.prototype.startsWith
  • String.prototype.endsWith
  • String.prototype.includes

Promise

  • Promise.prototype.catch
  • Promise.prototype.then
  • Promise.reject
  • Promise.resolve
  • Promise.race
  • Promise.all

JSON

  • JSON.parse
  • JSON.stringify

License

MIT License

es-shim's People

Contributors

xiaojue avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.