JS language shims used by Zillow
npm install zillow-js-shims> JS language shims used by Zillow
Just require/import zillow-js-shims, and the environment will be shimmed.
``js`
import 'zillow-js-shims';
- es5-shim
- es5-sham
- es6-shim
- Function.prototype.name
- Array.prototype.includes (ES7/ES2016)
- Object.entries (ES8/ES2017)
- Object.values (ES8/ES2017)
- String.prototype.padStart (ES8/ES2017)
- String.prototype.padEnd (ES8/ES2017)
- Promise.prototype.finally (Stage 4, ES2018)
- Array.prototype.flat (Stage 3, ES2019 candidate)
- Array.prototype.flatMap (Stage 3, ES2019 candidate)
- Symbol.prototype.description (Stage 3, ES2019 candidate)
- String.prototype.matchAll (Stage 3, ES2019 candidate)
If you do not need to support older browsers, you can pick a subset of ES versions to target. For example, if you don't support pre-ES5 browsers, you can start your shims with ES2015 by requiring/importing the specific target file. This will shim the environment for that version and upward.
`js`
import 'zillow-js-shims/target/es2015';
- zillow-js-shims/target/es5 (default)zillow-js-shims/target/es2015
- zillow-js-shims/target/es2016
- zillow-js-shims/target/es2017
- zillow-js-shims/target/es2018
- zillow-js-shims/target/es2019`
-
[1]: https://npmjs.org/package/zillow-js-shims
[2]: http://versionbadg.es/zillow/js-shims.svg