string.prototype.trimend (1.0.9)
Published 2026-02-24 14:05:39 +00:00 by atheaadmin
Installation
registry=npm install string.prototype.trimend@1.0.9"string.prototype.trimend": "1.0.9"About this package
String.prototype.trimEnd 
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());
Tests
Simply clone the repo, npm install, and run npm test
Dependencies
Dependencies
| ID | Version |
|---|---|
| call-bind | ^1.0.8 |
| call-bound | ^1.0.2 |
| define-properties | ^1.2.1 |
| es-object-atoms | ^1.0.0 |
Development Dependencies
| ID | Version |
|---|---|
| @es-shims/api | ^2.5.1 |
| @ljharb/eslint-config | ^21.1.1 |
| auto-changelog | ^2.5.0 |
| encoding | ^0.1.13 |
| eslint | =8.8.0 |
| functions-have-names | ^1.2.3 |
| has-strict-mode | ^1.0.1 |
| in-publish | ^2.0.1 |
| npmignore | ^0.3.1 |
| nyc | ^10.3.2 |
| safe-publish-latest | ^2.0.0 |
| tape | ^5.9.0 |
Keywords
es6
es7
es8
javascript
prototype
polyfill
utility
trim
trimLeft
trimRight
trimStart
trimEnd
tc39
