租房小程序前端代码
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.3 KiB

2 months ago
  1. # es-object-atoms <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
  2. [![github actions][actions-image]][actions-url]
  3. [![coverage][codecov-image]][codecov-url]
  4. [![License][license-image]][license-url]
  5. [![Downloads][downloads-image]][downloads-url]
  6. [![npm badge][npm-badge-png]][package-url]
  7. ES Object-related atoms: Object, ToObject, RequireObjectCoercible.
  8. ## Example
  9. ```js
  10. const assert = require('assert');
  11. const $Object = require('es-object-atoms');
  12. const ToObject = require('es-object-atoms/ToObject');
  13. const RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
  14. assert.equal($Object, Object);
  15. assert.throws(() => ToObject(null), TypeError);
  16. assert.throws(() => ToObject(undefined), TypeError);
  17. assert.throws(() => RequireObjectCoercible(null), TypeError);
  18. assert.throws(() => RequireObjectCoercible(undefined), TypeError);
  19. assert.deepEqual(RequireObjectCoercible(true), true);
  20. assert.deepEqual(ToObject(true), Object(true));
  21. const obj = {};
  22. assert.equal(RequireObjectCoercible(obj), obj);
  23. assert.equal(ToObject(obj), obj);
  24. ```
  25. ## Tests
  26. Simply clone the repo, `npm install`, and run `npm test`
  27. ## Security
  28. Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
  29. [package-url]: https://npmjs.org/package/es-object-atoms
  30. [npm-version-svg]: https://versionbadg.es/ljharb/es-object-atoms.svg
  31. [deps-svg]: https://david-dm.org/ljharb/es-object-atoms.svg
  32. [deps-url]: https://david-dm.org/ljharb/es-object-atoms
  33. [dev-deps-svg]: https://david-dm.org/ljharb/es-object-atoms/dev-status.svg
  34. [dev-deps-url]: https://david-dm.org/ljharb/es-object-atoms#info=devDependencies
  35. [npm-badge-png]: https://nodei.co/npm/es-object-atoms.png?downloads=true&stars=true
  36. [license-image]: https://img.shields.io/npm/l/es-object-atoms.svg
  37. [license-url]: LICENSE
  38. [downloads-image]: https://img.shields.io/npm/dm/es-object.svg
  39. [downloads-url]: https://npm-stat.com/charts.html?package=es-object-atoms
  40. [codecov-image]: https://codecov.io/gh/ljharb/es-object-atoms/branch/main/graphs/badge.svg
  41. [codecov-url]: https://app.codecov.io/gh/ljharb/es-object-atoms/
  42. [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-object-atoms
  43. [actions-url]: https://github.com/ljharb/es-object-atoms/actions