suyiScreen/node_modules/string.prototype.trimright
lixiaobang 18ece3f395 代码提交 2023-02-06 08:46:29 +08:00
..
.github/workflows 代码提交 2023-02-06 08:46:29 +08:00
test 代码提交 2023-02-06 08:46:29 +08:00
.eslintrc 代码提交 2023-02-06 08:46:29 +08:00
.travis.yml 代码提交 2023-02-06 08:46:29 +08:00
CHANGELOG.md 代码提交 2023-02-06 08:46:29 +08:00
LICENSE 代码提交 2023-02-06 08:46:29 +08:00
README.md 代码提交 2023-02-06 08:46:29 +08:00
auto.js 代码提交 2023-02-06 08:46:29 +08:00
implementation.js 代码提交 2023-02-06 08:46:29 +08:00
index.js 代码提交 2023-02-06 08:46:29 +08:00
package.json 代码提交 2023-02-06 08:46:29 +08:00
polyfill.js 代码提交 2023-02-06 08:46:29 +08:00
shim.js 代码提交 2023-02-06 08:46:29 +08:00

README.md

String.prototype.trimRight Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

A spec-proposal-compliant String.prototype.trimRight shim. Invoke its "shim" method to shim String.prototype.trimRight if it is unavailable.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec. In an ES6 environment, it will also work properly with Symbols.

Most common usage:

var trimRight = require('string.prototype.trimright');

assert(trimRight(' \t\na \t\n') === 'a \t\n');

if (!String.prototype.trimRight) {
	trimRight.shim();
}

assert(trimRight(' \t\na \t\n ') === ' \t\na \t\n '.trimRight());

Tests

Simply clone the repo, npm install, and run npm test