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.

56 lines
2.0 KiB

  1. # object.values <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. [![browser support][testling-svg]][testling-url]
  8. An ES2017 spec-compliant `Object.values` shim. Invoke its "shim" method to shim `Object.values` if it is unavailable or noncompliant.
  9. 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 [spec](https://tc39.github.io/ecma262/#sec-object.values).
  10. Most common usage:
  11. ```js
  12. var assert = require('assert');
  13. var values = require('object.values');
  14. var obj = { a: 1, b: 2, c: 3 };
  15. var expected = [1, 2, 3];
  16. if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
  17. // for environments with Symbol support
  18. var sym = Symbol();
  19. obj[sym] = 4;
  20. obj.d = sym;
  21. expected.push(sym);
  22. }
  23. assert.deepEqual(values(obj), expected);
  24. if (!Object.values) {
  25. values.shim();
  26. }
  27. assert.deepEqual(Object.values(obj), expected);
  28. ```
  29. ## Tests
  30. Simply clone the repo, `npm install`, and run `npm test`
  31. [package-url]: https://npmjs.com/package/object.values
  32. [npm-version-svg]: https://versionbadg.es/es-shims/Object.values.svg
  33. [deps-svg]: https://david-dm.org/es-shims/Object.values.svg
  34. [deps-url]: https://david-dm.org/es-shims/Object.values
  35. [dev-deps-svg]: https://david-dm.org/es-shims/Object.values/dev-status.svg
  36. [dev-deps-url]: https://david-dm.org/es-shims/Object.values#info=devDependencies
  37. [testling-svg]: https://ci.testling.com/es-shims/Object.values.png
  38. [testling-url]: https://ci.testling.com/es-shims/Object.values
  39. [npm-badge-png]: https://nodei.co/npm/object.values.png?downloads=true&stars=true
  40. [license-image]: https://img.shields.io/npm/l/object.values.svg
  41. [license-url]: LICENSE
  42. [downloads-image]: https://img.shields.io/npm/dm/object.values.svg
  43. [downloads-url]: https://npm-stat.com/charts.html?package=object.values