Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
string.prototype.trimend
Advanced tools
Package description
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.
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()
Lodash's trimEnd function offers similar functionality to string.prototype.trimend by removing whitespace from the end of a string. Lodash is a more comprehensive utility library that includes a wide range of functions for manipulating strings, arrays, objects, and more, making it a heavier dependency if you only need string trimming functionality.
The string.prototype.trimright package is another polyfill that provides similar functionality to string.prototype.trimend. The difference lies in the naming convention, as 'trimRight' is an alias for 'trimEnd' in the ECMAScript specification. This package ensures compatibility with environments that recognize 'trimRight' instead of 'trimEnd'.
Changelog
v1.0.5 - 2022-05-02
69a56ce
node/install
instead of node/run
; use codecov
action 5d7db31
bb1983d
10a1091
eslint
, @ljharb/eslint-config
, @es-shims/api
, safe-publish-latest
, tape
a08e14b
eslint
, @ljharb/eslint-config
, aud
, auto-changelog
, functions-have-names
, tape
1c4c8da
70c4a7c
eslint
, @ljharb/eslint-config
, @es-shims/api
, aud
, auto-changelog
, tape
4b08ed7
9805501
eslint
, tape
50ec335
bf9c32e
prepublishOnly
script for npm 7+ 9d921bd
define-properties
15617ce
Readme
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 Symbol
s.
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());
Simply clone the repo, npm install
, and run npm test
FAQs
ES2019 spec-compliant String.prototype.trimEnd shim.
The npm package string.prototype.trimend receives a total of 26,773,005 weekly downloads. As such, string.prototype.trimend popularity was classified as popular.
We found that string.prototype.trimend demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.