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.

44 lines
1.8 KiB

  1. # object.fromentries <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
  2. [![dependency status][deps-svg]][deps-url]
  3. [![dev dependency status][dev-deps-svg]][dev-deps-url]
  4. [![License][license-image]][license-url]
  5. [![Downloads][downloads-image]][downloads-url]
  6. [![npm badge][npm-badge-png]][package-url]
  7. An ES spec-proposal-compliant `Object.fromEntries` shim. Invoke its "shim" method to shim `Object.fromEntries` if it is unavailable or noncompliant.
  8. This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [proposed spec](https://tc39.github.io/proposal-object-from-entries/).
  9. Most common usage:
  10. ```js
  11. var assert = require('assert');
  12. var fromEntries = require('object.fromentries');
  13. var obj = { a: 1, b: 2, c: 3 };
  14. var actual = fromEntries(Object.entries(obj));
  15. assert.deepEqual(obj, actual);
  16. if (!Object.fromEntries) {
  17. fromEntries.shim();
  18. }
  19. assert.deepEqual(Object.fromEntries(Object.entries(obj)), obj);
  20. ```
  21. ## Tests
  22. Simply clone the repo, `npm install`, and run `npm test`
  23. [package-url]: https://npmjs.com/package/object.fromentries
  24. [npm-version-svg]: https://versionbadg.es/es-shims/Object.fromEntries.svg
  25. [deps-svg]: https://david-dm.org/es-shims/Object.fromEntries.svg
  26. [deps-url]: https://david-dm.org/es-shims/Object.fromEntries
  27. [dev-deps-svg]: https://david-dm.org/es-shims/Object.fromEntries/dev-status.svg
  28. [dev-deps-url]: https://david-dm.org/es-shims/Object.fromEntries#info=devDependencies
  29. [npm-badge-png]: https://nodei.co/npm/object.fromentries.png?downloads=true&stars=true
  30. [license-image]: https://img.shields.io/npm/l/object.fromentries.svg
  31. [license-url]: LICENSE
  32. [downloads-image]: https://img.shields.io/npm/dm/object.fromentries.svg
  33. [downloads-url]: https://npm-stat.com/charts.html?package=object.fromentries