You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nathan Steel 84b28d60b2 Add NPM build config 3 years ago
..
test Add NPM build config 3 years ago
.editorconfig Add NPM build config 3 years ago
.eslintrc Add NPM build config 3 years ago
.nycrc Add NPM build config 3 years ago
CHANGELOG.md Add NPM build config 3 years ago
LICENSE Add NPM build config 3 years ago
README.md Add NPM build config 3 years ago
auto.js Add NPM build config 3 years ago
implementation.js Add NPM build config 3 years ago
index.js Add NPM build config 3 years ago
package.json Add NPM build config 3 years ago
polyfill.js Add NPM build config 3 years ago
shim.js Add NPM build config 3 years ago

README.md

String.prototype.trimStart Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2019-spec-compliant String.prototype.trimStart shim. Invoke its "shim" method to shim String.prototype.trimStart 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 trimStart = require('string.prototype.trimstart');

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

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

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

Tests

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