Socket
Socket
Sign inDemoInstall

string.prototype.trimstart

Package Overview
Dependencies
64
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    string.prototype.trimstart

ES2019 spec-compliant String.prototype.trimStart shim.


Version published
Weekly downloads
34M
decreased by-0.98%
Maintainers
2
Install size
2.07 MB
Created
Weekly downloads
 

Package description

What is string.prototype.trimstart?

The string.prototype.trimstart package provides functionality to remove whitespace from the beginning of a string without altering the rest of the string. This is particularly useful for cleaning up user input, formatting strings before processing, or simply ensuring consistency in string data.

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

Trimming start of a string

This feature allows you to remove all whitespace from the beginning of a string. The example code demonstrates how to use the trimStart method to remove leading spaces from a string, resulting in 'Hello world!' without the leading spaces.

"   Hello world!".trimStart()

Other packages similar to string.prototype.trimstart

Changelog

Source

v1.0.5 - 2022-05-02

Commits

  • [actions] reuse common workflows 61d4009
  • [actions] use node/install instead of node/run; use codecov action bfe39c4
  • [Fix] ensure main entry point properly checks the receiver in ES3 engines 36e3730
  • [Fix] as of unicode v6, the mongolian vowel separator is no longer whitespace 4f77eed
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, safe-publish-latest, tape 59fcb99
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, functions-have-names, tape 486ffcf
  • [actions] update codecov uploader b33ac48
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, aud, auto-changelog, tape 3c89fa5
  • [readme] add github actions/codecov badges 00be6b3
  • [Dev Deps] update eslint, tape 13a08f5
  • [actions] update workflows 6ac576d
  • [meta] use prepublishOnly script for npm 7+ fa382ca
  • [Deps] update define-properties d57bffe

Readme

Source

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

Keywords

FAQs

Last updated on 03 May 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc