项目原始demo,不改动
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
Bu depo arşivlendi. Dosyaları görüntüleyebilir ve klonlayabilirsiniz ama işlem gönderemez ve konu/değişiklik isteği açamazsınız.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # es-to-primitive <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
  2. [![Build Status][travis-svg]][travis-url]
  3. [![dependency status][deps-svg]][deps-url]
  4. [![dev dependency status][dev-deps-svg]][dev-deps-url]
  5. [![License][license-image]][license-url]
  6. [![Downloads][downloads-image]][downloads-url]
  7. [![npm badge][npm-badge-png]][package-url]
  8. ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions.
  9. When different versions of the spec conflict, the default export will be the latest version of the abstract operation.
  10. Alternative versions will also be available under an `es5`/`es2015` exported property if you require a specific version.
  11. ## Example
  12. ```js
  13. var toPrimitive = require('es-to-primitive');
  14. var assert = require('assert');
  15. assert(toPrimitive(function () {}) === String(function () {}));
  16. var date = new Date();
  17. assert(toPrimitive(date) === String(date));
  18. assert(toPrimitive({ valueOf: function () { return 3; } }) === 3);
  19. assert(toPrimitive(['a', 'b', 3]) === String(['a', 'b', 3]));
  20. var sym = Symbol();
  21. assert(toPrimitive(Object(sym)) === sym);
  22. ```
  23. ## Tests
  24. Simply clone the repo, `npm install`, and run `npm test`
  25. [package-url]: https://npmjs.org/package/es-to-primitive
  26. [npm-version-svg]: http://versionbadg.es/ljharb/es-to-primitive.svg
  27. [travis-svg]: https://travis-ci.org/ljharb/es-to-primitive.svg
  28. [travis-url]: https://travis-ci.org/ljharb/es-to-primitive
  29. [deps-svg]: https://david-dm.org/ljharb/es-to-primitive.svg
  30. [deps-url]: https://david-dm.org/ljharb/es-to-primitive
  31. [dev-deps-svg]: https://david-dm.org/ljharb/es-to-primitive/dev-status.svg
  32. [dev-deps-url]: https://david-dm.org/ljharb/es-to-primitive#info=devDependencies
  33. [testling-svg]: https://ci.testling.com/ljharb/es-to-primitive.png
  34. [testling-url]: https://ci.testling.com/ljharb/es-to-primitive
  35. [npm-badge-png]: https://nodei.co/npm/es-to-primitive.png?downloads=true&stars=true
  36. [license-image]: http://img.shields.io/npm/l/es-to-primitive.svg
  37. [license-url]: LICENSE
  38. [downloads-image]: http://img.shields.io/npm/dm/es-to-primitive.svg
  39. [downloads-url]: http://npm-stat.com/charts.html?package=es-to-primitive