Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

string.prototype.trimright

es-shims4.7mMIT2.1.3

ES2019 spec-compliant String.prototype.trimLeft shim.

String.prototype.trimRight, string, ES7, ES2019, shim, trim, trimLeft, trimStart, trimRight, trimEnd, polyfill, es-shim API

readme

String.prototype.trimRight Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

A ES2019-spec-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 Symbols.

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());

Tests

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

changelog

2.1.3 / 2020-11-22

  • [Deps] update string.prototype.trimend; use call-bind instead of es-abstract
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape; add aud
  • [actions] add "Allow Edits" workflow
  • [actions] switch Automatic Rebase workflow to pull_request_target event
  • [Tests] migrate tests to Github Actions
  • [Tests] run nyc on all tests
  • [Tests] add implementation test; run es-shim-api in postlint; use tape runner

2.1.2 / 2020-03-30

  • [Refactor] use string.prototype.trimstart for the implementation
  • [Refactor] use es-abstract’s callBind helper instead of function-bind directly
  • [meta] correct spec year
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape, functions-have-names; add safe-publish-latest

2.1.1 / 2019-12-17

  • [meta] add funding field
  • [Dev Deps] update eslint, @ljharb/eslint-config, functions-have-names, tape
  • [Tests] use shared travis-ci configs
  • [actions] add automatic rebasing / merge commit blocking

2.1.0 / 2019-09-09

  • [New] add auto entry point
  • [Deps] update function-bind, define-properties
  • [Dev Deps] update eslint, @ljharb/eslint-config, covert, tape, @es-shims/api
  • [meta] clean up scripts
  • [meta] Only apps should have lockfiles
  • [Tests] up to node v12.10, v11.15, v10.16, v9.11, v8.16, v7.10, v6.17, v5.10, v4.9; use nvm install-latest-npm
  • [Tests] allow a name of trimLeft or trimStart
  • [Tests] fix tests for the mongolian vowel separator
  • [Tests] use functions-have-names
  • [Tests] use npx aud instead of nsp or npm audit with hoops
  • [Tests] remove jscs
  • [Tests] use pretest/posttest for linting/security

2.0.0 / 2016-02-06

  • [Breaking] conform to the es-shim API
  • [Deps] update define-properties
  • [Dev Deps] update tape, jscs, nsp, eslint, @ljharb/eslint-config
  • [Tests] up to node v5.5
  • [Tests] fix npm upgrades on older nodes

1.0.1 / 2015-07-29

  • Fix deps mistakenly being dev deps

1.0.0 / 2015-07-29

  • v1.0.0