Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
lefteris 8b767d3c7f docker 4 years ago
..
.github/workflows docker 4 years ago
test docker 4 years ago
.editorconfig docker 4 years ago
.eslintignore docker 4 years ago
.eslintrc docker 4 years ago
.nycrc docker 4 years ago
CHANGELOG.md docker 4 years ago
LICENSE docker 4 years ago
README.md docker 4 years ago
auto.js docker 4 years ago
implementation.js docker 4 years ago
index.js docker 4 years ago
package.json docker 4 years ago
polyfill.js docker 4 years ago
shim.js docker 4 years ago

README.md

String.prototype.trimEnd Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

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