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

55 lines
2.1 KiB

3 months ago
  1. # es-errors <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. A simple cache for a few of the JS Error constructors.
  8. ## Example
  9. ```js
  10. const assert = require('assert');
  11. const Base = require('es-errors');
  12. const Eval = require('es-errors/eval');
  13. const Range = require('es-errors/range');
  14. const Ref = require('es-errors/ref');
  15. const Syntax = require('es-errors/syntax');
  16. const Type = require('es-errors/type');
  17. const URI = require('es-errors/uri');
  18. assert.equal(Base, Error);
  19. assert.equal(Eval, EvalError);
  20. assert.equal(Range, RangeError);
  21. assert.equal(Ref, ReferenceError);
  22. assert.equal(Syntax, SyntaxError);
  23. assert.equal(Type, TypeError);
  24. assert.equal(URI, URIError);
  25. ```
  26. ## Tests
  27. Simply clone the repo, `npm install`, and run `npm test`
  28. ## Security
  29. Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
  30. [package-url]: https://npmjs.org/package/es-errors
  31. [npm-version-svg]: https://versionbadg.es/ljharb/es-errors.svg
  32. [deps-svg]: https://david-dm.org/ljharb/es-errors.svg
  33. [deps-url]: https://david-dm.org/ljharb/es-errors
  34. [dev-deps-svg]: https://david-dm.org/ljharb/es-errors/dev-status.svg
  35. [dev-deps-url]: https://david-dm.org/ljharb/es-errors#info=devDependencies
  36. [npm-badge-png]: https://nodei.co/npm/es-errors.png?downloads=true&stars=true
  37. [license-image]: https://img.shields.io/npm/l/es-errors.svg
  38. [license-url]: LICENSE
  39. [downloads-image]: https://img.shields.io/npm/dm/es-errors.svg
  40. [downloads-url]: https://npm-stat.com/charts.html?package=es-errors
  41. [codecov-image]: https://codecov.io/gh/ljharb/es-errors/branch/main/graphs/badge.svg
  42. [codecov-url]: https://app.codecov.io/gh/ljharb/es-errors/
  43. [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-errors
  44. [actions-url]: https://github.com/ljharb/es-errors/actions