You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

string.prototype.trimend

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string.prototype.trimend

ES2019 spec-compliant String.prototype.trimEnd shim.


Version published
Weekly downloads
27M
decreased by-18.95%
Maintainers
2
Install size
1.77 MB
Created
Weekly downloads
 

Package description

What is string.prototype.trimend?

The string.prototype.trimend package provides functionality to remove whitespace from the end of a string without altering the original string. It is a polyfill for the String.prototype.trimEnd method, which is part of the ECMAScript 2019 (ES10) standard. This package ensures compatibility across different JavaScript environments where the native trimEnd method may not be available.

What are string.prototype.trimend's main functionalities?

Trimming whitespace from the end of a string

This feature allows you to remove any trailing whitespace from a string. The code sample demonstrates how to use the trimEnd method to trim whitespace from the end of the string ' Hello World! ', resulting in ' Hello World!'.

" Hello World!   ".trimEnd()

Other packages similar to string.prototype.trimend

Changelog

Source

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

Readme

Source

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

Keywords

FAQs

Package last updated on 20 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc