0.1.6 • Published 4 years ago

is-es2015 v0.1.6

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

is-es2015

This module exports, as ESM or CJS, just the following:

/^class\b/.test(class{})

The goal of this module is to understand if the current environment is running transpiled code or not.

... and why is that relevant?

Because transpiled code can be untrusted due various transpilers out there, meaning some expected feature such as native classes extends, species, etc, might not work as expected.

If this module returns true, your code targets at least ES2015, but if it returns false, your code is likely running to target IE11 or lower.

import isES2015 from 'is-es2015';

export default isES2015 ?
  class Celebrate {} :
  function PoorThing() {}
;
0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.0

4 years ago