Giter Site home page Giter Site logo

jokeyrhyme / is-es5-supported Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 80 KB

does this JavaScript environment conform to ECMAScript 5?

License: BSD 2-Clause "Simplified" License

JavaScript 71.42% HTML 28.58%
ecmascript ecmascript5 feature-detection javascript

is-es5-supported's Introduction

is-es5-supported.js npm module Travis CI Status

does this JavaScript environment conform to ECMAScript 5?

What is this?

I made this after reading Kangax's terrific ES5 compatibility table. Rather than feature-detect every single piece of ECMAScript 5, I've selected the smallest number of tests to identify non-conformant JavaScript environments.

parseInt() ignores leading zeros

  • after this test, we get a false in most old browsers

Strict Mode

  • after this test, we get a false in Internet Explorer 9 and environments or apps that load ES5-shim

Date.prototype.toISOString

  • after this test, we get a false in EJS

Job done!

Supported Environments

I've manually tested in a range of environments:

  • true: Node.js (0.12), Chrome (43), Safari (8), Firefox (38), Internet Explorer (10, 11), Edge

  • false: Internet Explorer (6, 7, 8, 9)

Usage

  • CommonJS (e.g. Node.js, Browserify, etc) use index.js
var isES5Supported = require('is-es5-supported');
console.log(isES5Supported); // `true` or `false`
<script src="dist/index.js"></script>
<script>
console.log(isES5Supported); // `true` or `false`
</script>

Known Issues

  • this approach does assume correlations between the 3 included tests and the rest of the ECMASCript 5 implementation, which might not return correct results in exotic environments

  • Internet Explorer 10 Platform Preview 2 will get a false (who cares?)

is-es5-supported's People

Contributors

greenkeeper[bot] avatar jokeyrhyme avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

is-es5-supported's Issues

An in-range update of browserify is breaking the build 🚨

Version 14.2.0 of browserify just got published.

Branch Build failing 🚨
Dependency browserify
Current Version 14.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As browserify is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 5 commits .

  • 18e1d65 14.2.0
  • 0e1a7a0 add cli support for --transform-key to support mode's like production/staging/etc..
  • a5aa660 Merge pull request #1701 from wogsland/doc-fix
  • ae281bc Fixed documentation formatting that was bugging me
  • fe8c57b async test for node 7

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-import is breaking the build 🚨

Version 2.4.0 of eslint-plugin-import just got published.

Branch Build failing 🚨
Dependency eslint-plugin-import
Current Version 2.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-import is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 10 commits.

  • 44ca158 update utils changelog
  • a3728d7 bump eslint-module-utils to v2.1.0
  • 3e29169 bump v2.4.0
  • ea9c92c Merge pull request #737 from kevin940726/master
  • 8f9b403 fix typos, enforce type of array of strings in allow option
  • 95315e0 update CHANGELOG.md
  • 28e1623 eslint-module-utils: filePath in parserOptions (#840)
  • 2f690b4 update CI to build on Node 6+7 (#846)
  • 7d41745 write doc, add two more tests
  • dedfb11 add allow glob for rule no-unassigned-import, fix #671

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-node is breaking the build 🚨

Version 5.2.1 of eslint-plugin-node was just published.

Branch Build failing 🚨
Dependency eslint-plugin-node
Current Version 5.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 3 commits.

  • ad1f15a 5.2.1
  • 2aaa994 Fix: support negative patterns in files field
  • 155f714 Chore: fix a small misspelling. (#95)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of browserify is breaking the build 🚨

The devDependency browserify was updated from 16.3.0 to 16.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

browserify is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 5 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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.