Emmanuel b7eccee437 Navbar | 5 年之前 | |
---|---|---|
.. | ||
test | 5 年之前 | |
.editorconfig | 5 年之前 | |
.eslintrc | 5 年之前 | |
.travis.yml | 5 年之前 | |
CHANGELOG.md | 5 年之前 | |
LICENSE | 5 年之前 | |
README.md | 5 年之前 | |
auto.js | 5 年之前 | |
implementation.js | 5 年之前 | |
index.js | 5 年之前 | |
package.json | 5 年之前 | |
polyfill.js | 5 年之前 | |
shim.js | 5 年之前 |
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 Symbol
s.
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());
Simply clone the repo, npm install
, and run npm test