|
|
3 年 前 | |
|---|---|---|
| .. | ||
| test | 3 年 前 | |
| .editorconfig | 3 年 前 | |
| .eslintignore | 3 年 前 | |
| .eslintrc | 3 年 前 | |
| .nycrc | 3 年 前 | |
| CHANGELOG.md | 3 年 前 | |
| LICENSE | 3 年 前 | |
| README.md | 3 年 前 | |
| auto.js | 3 年 前 | |
| implementation.js | 3 年 前 | |
| index.js | 3 年 前 | |
| package.json | 3 年 前 | |
| polyfill.js | 3 年 前 | |
| shim.js | 3 年 前 | |
An ES2019-spec-compliant String.prototype.trimEnd shim. Invoke its "shim" method to shim String.prototype.trimEnd 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 trimEnd = require('string.prototype.trimend');
assert(trimEnd(' \t\na \t\n') === 'a \t\n');
if (!String.prototype.trimEnd) {
trimEnd.shim();
}
assert(trimEnd(' \t\na \t\n ') === ' \t\na \t\n '.trimEnd());
Simply clone the repo, npm install, and run npm test