包详细信息

string.prototype.trimend

es-shims176.7mMIT1.0.9

ES2019 spec-compliant String.prototype.trimEnd shim.

es6, es7, es8, javascript

自述文件

String.prototype.trimEnd Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

更新日志

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.9 - 2024-12-11

Commits

  • [actions] split out node 10-20, and 20+ 7e5ffdc
  • [meta] sort package.json mildly 2f99c8b
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, auto-changelog, tape 2774fe6
  • [Refactor] use call-bound directly 9e3bbec
  • [Tests] replace aud with npm audit cb9a462
  • [meta] add missing engines.node f46c829
  • [Deps] update call-bind e892c32
  • [Dev Deps] add missing peer dep e1a59da

v1.0.8 - 2024-03-16

Commits

  • [Refactor] replace es-abstract with es-object-atoms 0df2b01
  • [Dev Deps] update aud, npmignore, tape 190e9c5

v1.0.7 - 2023-09-07

Commits

  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, tape 1a10293
  • [Deps] update define-properties, es-abstract 6ba2e19

v1.0.6 - 2022-11-07

Commits

  • [meta] use npmignore to autogenerate an npmignore file 1d1e717
  • [actions] update rebase action to use reusable workflow 83f2683
  • [Dev Deps] update aud, tape a3a9129
  • [Deps] update es-abstract a6e476d

v1.0.5 - 2022-05-02

Commits

  • [actions] reuse common workflows 69a56ce
  • [actions] use node/install instead of node/run; use codecov action 5d7db31
  • [Fix] ensure main entry point properly checks the receiver in ES3 engines bb1983d
  • [Fix] as of unicode v6, the mongolian vowel separator is no longer whitespace 10a1091
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, safe-publish-latest, tape a08e14b
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, functions-have-names, tape 1c4c8da
  • [actions] update codecov uploader 70c4a7c
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, aud, auto-changelog, tape 4b08ed7
  • [readme] add github actions/codecov badges 9805501
  • [Dev Deps] update eslint, tape 50ec335
  • [actions] update workflows bf9c32e
  • [meta] use prepublishOnly script for npm 7+ 9d921bd
  • [Deps] update define-properties 15617ce

v1.0.4 - 2021-02-23

Commits

  • [meta] do not publish github action workflow files 08e735c
  • [readme] remove travis badge 10e0e47
  • [Dev Deps] update eslint, @ljharb/eslint-config, functions-have-names, has-strict-mode, tape 0871432
  • [Tests] increase coverage 711e6a6
  • [actions] update workflows deb0d06
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape e250b4a
  • [meta] gitignore coverage output 55231df
  • [Deps] update call-bind 0580f5f

v1.0.3 - 2020-11-21

Commits

  • [Tests] migrate tests to Github Actions 23e7a09
  • [Tests] add implementation test; run es-shim-api in postlint; use tape runner 26e8623
  • [Tests] run nyc on all tests a72a546
  • [Deps] replace es-abstract with call-bind f07b87d
  • [Dev Deps] update eslint, aud; add safe-publish-latest 122ecb7

v1.0.2 - 2020-10-20

Commits

  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape a003e71
  • [actions] add "Allow Edits" workflow 0b4b43c
  • [Deps] update es-abstract 75ca6b0
  • [actions] switch Automatic Rebase workflow to pull_request_target event 552016c

v1.0.1 - 2020-04-09

Commits

  • [meta] add some missing repo metadata 6abe248
  • [Dev Deps] update auto-changelog e2eaab2

v1.0.0 - 2020-03-30

Commits

  • [Breaking] convert to es-shim API 2c6ef13
  • [meta] add auto-changelog 6f1fcc1
  • [meta] update readme ed4ce0d
  • [Tests] add npm run lint eadaf2c
  • Only apps should have lockfiles 44d355f
  • [actions] add automatic rebasing / merge commit blocking e78bf8e
  • [Tests] use shared travis-ci configs 983c563
  • [meta] add funding field 35139d6
  • [meta] fix non-updated version number a2d308b

v0.1.0 - 2017-12-19

Commits

v0.0.1 - 2017-12-19

Commits