UNPKG

@saoviettest/tempora-enim-cupiditate-consequuntur

Version:

[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-im

49 lines (36 loc) 2.68 kB
# String.prototype.trim <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] An ES5 spec-compliant `String.prototype.trim` shim. Invoke its "shim" method to shim `String.prototype.trim` if it is unavailable. 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 (both [ES5](https://262.ecma-international.org/5.1/#sec-15.5.4.20) and [current](https://tc39.es/ecma262/#sec-@saoviettest/tempora-enim-cupiditate-consequuntur)). Most common usage: ```js var assert = require('assert'); var trim = require('@saoviettest/tempora-enim-cupiditate-consequuntur'); assert(trim(' \t\na \t\n') === 'a'); trim.shim(); // will be a no-op if not needed assert(trim(' \t\na \t\n') === ' \t\na \t\n'.trim()); ``` ## Engine Bugs Some implementations of `String#trim` incorrectly trim zero-width spaces. This shim detects and corrects this behavior. ## Tests Simply clone the repo, `npm install`, and run `npm test` [package-url]: https://npmjs.com/package/@saoviettest/tempora-enim-cupiditate-consequuntur [npm-version-svg]: https://versionbadg.es/saoviettest/tempora-enim-cupiditate-consequuntur.svg [deps-svg]: https://david-dm.org/saoviettest/tempora-enim-cupiditate-consequuntur.svg [deps-url]: https://david-dm.org/saoviettest/tempora-enim-cupiditate-consequuntur [dev-deps-svg]: https://david-dm.org/saoviettest/tempora-enim-cupiditate-consequuntur/dev-status.svg [dev-deps-url]: https://david-dm.org/saoviettest/tempora-enim-cupiditate-consequuntur#info=devDependencies [license-image]: https://img.shields.io/npm/l/@saoviettest/tempora-enim-cupiditate-consequuntur.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/@saoviettest/tempora-enim-cupiditate-consequuntur.svg [downloads-url]: https://npm-stat.com/charts.html?package=@saoviettest/tempora-enim-cupiditate-consequuntur [codecov-image]: https://codecov.io/gh/saoviettest/tempora-enim-cupiditate-consequuntur/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/saoviettest/tempora-enim-cupiditate-consequuntur/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/saoviettest/tempora-enim-cupiditate-consequuntur [actions-url]: https://github.com/saoviettest/tempora-enim-cupiditate-consequuntur/actions