You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.4 KiB

4 years ago
  1. [`core-js-compat` package](https://github.com/zloirock/core-js/packages/core-js-compat) contains data about the necessity of [`core-js`](https://github.com/zloirock/core-js) modules and API for getting a list of required core-js modules by browserslist query.
  2. ```js
  3. const {
  4. list, // array of required modules
  5. targets, // object with targets for each module
  6. } = require('core-js-compat')({
  7. targets: '> 2.5%', // browserslist query
  8. filter: /^(es|web)\./, // optional filter - string-prefix, regexp or list of modules
  9. });
  10. console.log(targets);
  11. /* =>
  12. {
  13. 'es.symbol.description': { ios: '12.2-12.4' },
  14. 'es.symbol.match-all': { ios: '12.2-12.4' },
  15. 'es.array.reverse': { ios: '12.2-12.4' },
  16. 'es.array.unscopables.flat': { ios: '12.2-12.4' },
  17. 'es.array.unscopables.flat-map': { ios: '12.2-12.4' },
  18. 'es.array-buffer.slice': { ios: '12.2-12.4' },
  19. 'es.global-this': { ios: '12.2-12.4' },
  20. 'es.json.stringify': { ios: '12.2-12.4' },
  21. 'es.math.hypot': { chrome: '77' },
  22. 'es.object.from-entries': { ios: '12.2-12.4' },
  23. 'es.promise.all-settled': { firefox: '69', ios: '12.2-12.4' },
  24. 'es.promise.finally': { ios: '12.2-12.4' },
  25. 'es.string.match-all': { chrome: '77', firefox: '69', ios: '12.2-12.4' },
  26. 'es.string.replace': { firefox: '69', ios: '12.2-12.4' },
  27. 'es.string.trim': { ios: '12.2-12.4' },
  28. 'es.string.trim-end': { ios: '12.2-12.4' },
  29. 'es.typed-array.float32-array': { ios: '12.2-12.4' },
  30. 'es.typed-array.float64-array': { ios: '12.2-12.4' },
  31. 'es.typed-array.int8-array': { ios: '12.2-12.4' },
  32. 'es.typed-array.int16-array': { ios: '12.2-12.4' },
  33. 'es.typed-array.int32-array': { ios: '12.2-12.4' },
  34. 'es.typed-array.uint8-array': { ios: '12.2-12.4' },
  35. 'es.typed-array.uint8-clamped-array': { ios: '12.2-12.4' },
  36. 'es.typed-array.uint16-array': { ios: '12.2-12.4' },
  37. 'es.typed-array.uint32-array': { ios: '12.2-12.4' },
  38. 'es.typed-array.from': { ios: '12.2-12.4' },
  39. 'es.typed-array.of': { ios: '12.2-12.4' },
  40. 'web.dom-collections.iterator': { ios: '12.2-12.4' },
  41. 'web.immediate': { chrome: '77', firefox: '69', ios: '12.2-12.4' },
  42. 'web.queue-microtask': { ios: '12.2-12.4' },
  43. 'web.url': { ios: '12.2-12.4' },
  44. 'web.url.to-json': { ios: '12.2-12.4' },
  45. 'web.url-search-params': { ios: '12.2-12.4' }
  46. }
  47. */
  48. ```
  49. If you want to add new / update data about modules required for target engines, [follow this instruction](https://github.com/zloirock/core-js/blob/master/CONTRIBUTING.md#updating-core-js-compat-data).