web 3d图形渲染器
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.

73 lines
3.4 KiB

  1. [`core-js-compat` package](https://github.com/zloirock/core-js/tree/master/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 or object of minimum environment versions to support
  8. filter: /^(es|web)\./, // optional filter - string-prefix, regexp or list of modules
  9. version: '3.10', // used `core-js` version, by default - the latest
  10. });
  11. console.log(targets);
  12. /* =>
  13. {
  14. 'es.symbol.match-all': { ios: '12.2-12.4' },
  15. 'es.array.unscopables.flat': { ios: '12.2-12.4' },
  16. 'es.array.unscopables.flat-map': { ios: '12.2-12.4' },
  17. 'es.math.hypot': { chrome: '77' },
  18. 'es.promise.all-settled': { firefox: '69', ios: '12.2-12.4' },
  19. 'es.promise.finally': { ios: '12.2-12.4' },
  20. 'es.string.match-all': { chrome: '77', firefox: '69', ios: '12.2-12.4' },
  21. 'es.string.replace': { firefox: '69', ios: '12.2-12.4' },
  22. 'es.typed-array.float32-array': { ios: '12.2-12.4' },
  23. 'es.typed-array.float64-array': { ios: '12.2-12.4' },
  24. 'es.typed-array.int8-array': { ios: '12.2-12.4' },
  25. 'es.typed-array.int16-array': { ios: '12.2-12.4' },
  26. 'es.typed-array.int32-array': { ios: '12.2-12.4' },
  27. 'es.typed-array.uint8-array': { ios: '12.2-12.4' },
  28. 'es.typed-array.uint8-clamped-array': { ios: '12.2-12.4' },
  29. 'es.typed-array.uint16-array': { ios: '12.2-12.4' },
  30. 'es.typed-array.uint32-array': { ios: '12.2-12.4' },
  31. 'es.typed-array.from': { ios: '12.2-12.4' },
  32. 'es.typed-array.of': { ios: '12.2-12.4' },
  33. 'web.dom-collections.iterator': { ios: '12.2-12.4' },
  34. 'web.immediate': { chrome: '77', firefox: '69', ios: '12.2-12.4' },
  35. 'web.url': { ios: '12.2-12.4' },
  36. 'web.url.to-json': { ios: '12.2-12.4' },
  37. 'web.url-search-params': { ios: '12.2-12.4' }
  38. }
  39. */
  40. ```
  41. Additional API:
  42. ```js
  43. // equals of of the method from the example above
  44. require('core-js-compat/compat')({ targets, filter, version }); // => { list: Array<ModuleName>, targets: { [ModuleName]: { [EngineName]: EngineVersion } } }
  45. // or
  46. require('core-js-compat').compat({ targets, filter, version }); // => { list: Array<ModuleName>, targets: { [ModuleName]: { [EngineName]: EngineVersion } } }
  47. // full compat data:
  48. require('core-js-compat/data'); // => { [ModuleName]: { [EngineName]: EngineVersion } }
  49. // or
  50. require('core-js-compat').data; // => { [ModuleName]: { [EngineName]: EngineVersion } }
  51. // map of modules by `core-js` entry points:
  52. require('core-js-compat/entries'); // => { [EntryPoint]: Array<ModuleName> }
  53. // or
  54. require('core-js-compat').entries; // => { [EntryPoint]: Array<ModuleName> }
  55. // full list of modules:
  56. require('core-js-compat/modules'); // => Array<ModuleName>
  57. // or
  58. require('core-js-compat').modules; // => Array<ModuleName>
  59. // the subset of modules which available in the passed `core-js` version:
  60. require('core-js-compat/get-modules-list-for-target-version')('3.3'); // => Array<ModuleName>
  61. // or
  62. require('core-js-compat').getModulesListForTargetVersion('3.3'); // => Array<ModuleName>
  63. ```
  64. 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).