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.

README.md 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. String.prototype.trimRight <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. [![browser support][testling-svg]][testling-url]
  9. A ES2019-spec-compliant `String.prototype.trimRight` shim. Invoke its "shim" method to shim `String.prototype.trimRight` if it is unavailable.
  10. 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](http://www.ecma-international.org/ecma-262/6.0/#sec-object.assign). In an ES6 environment, it will also work properly with `Symbol`s.
  11. Most common usage:
  12. ```js
  13. var trimRight = require('string.prototype.trimright');
  14. assert(trimRight(' \t\na \t\n') === 'a \t\n');
  15. if (!String.prototype.trimRight) {
  16. trimRight.shim();
  17. }
  18. assert(trimRight(' \t\na \t\n ') === ' \t\na \t\n '.trimRight());
  19. ```
  20. ## Tests
  21. Simply clone the repo, `npm install`, and run `npm test`
  22. [package-url]: https://npmjs.com/package/string.prototype.trimright
  23. [npm-version-svg]: http://vb.teelaun.ch/es-shims/String.prototype.trimRight.svg
  24. [travis-svg]: https://travis-ci.org/es-shims/String.prototype.trimRight.svg
  25. [travis-url]: https://travis-ci.org/es-shims/String.prototype.trimRight
  26. [deps-svg]: https://david-dm.org/es-shims/String.prototype.trimRight.svg
  27. [deps-url]: https://david-dm.org/es-shims/String.prototype.trimRight
  28. [dev-deps-svg]: https://david-dm.org/es-shims/String.prototype.trimRight/dev-status.svg
  29. [dev-deps-url]: https://david-dm.org/es-shims/String.prototype.trimRight#info=devDependencies
  30. [testling-svg]: https://ci.testling.com/es-shims/String.prototype.trimRight.png
  31. [testling-url]: https://ci.testling.com/es-shims/String.prototype.trimRight
  32. [npm-badge-png]: https://nodei.co/npm/string.prototype.trimright.png?downloads=true&stars=true
  33. [license-image]: http://img.shields.io/npm/l/string.prototype.trimright.svg
  34. [license-url]: LICENSE
  35. [downloads-image]: http://img.shields.io/npm/dm/string.prototype.trimright.svg
  36. [downloads-url]: http://npm-stat.com/charts.html?package=string.prototype.trimright