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

Package detail

string.prototype.padstart

es-shims7.2mMIT3.1.7

ES2017 spec-compliant String.prototype.padStart shim.

String.prototype.padLeft, String.prototype.padStart, string, ES8, ES2017, shim, trim, padLeft, padRight, padStart, padEnd, polyfill, es-shim API

readme

String.prototype.padStart Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2017 spec-compliant String.prototype.padStart shim. Invoke its "shim" method to shim String.prototype.padStart if it is unavailable.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Most common usage:

var padStart = require('string.prototype.padstart');

assert(padStart('foo', 5, 'bar') === 'bafoo');

padStart.shim();

assert(padStart('foo', 2) === 'foo'.padStart(2));

Tests

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

changelog

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.

v3.1.7 - 2025-03-13

Commits

  • [actions] use reusable workflows ae59509
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, auto-changelog, has-strict-mode, tape 42bb53b
  • [Deps] update call-bind, es-abstract, es-object-atoms 76ef765
  • [Refactor] use call-bound directly 8d2e2ae
  • [Tests] replace aud with npm audit e3270b6
  • [Deps] update es-abstract 002c22f
  • [Dev Deps] add missing peer dep f9efe37

v3.1.6 - 2024-03-16

Commits

  • [Refactor] update es-abstract; use es-object-atoms a3025f1
  • [Dev Deps] update aud, npmignore, tape 421d652
  • [Deps] update call-bind, define-properties b70498f

v3.1.5 - 2023-08-29

Commits

  • [Deps] update define-properties, es-abstract 42a83bc
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, tape cdcb754

v3.1.4 - 2022-11-07

Commits

  • [actions] reuse common workflows dab6400
  • [meta] use npmignore to autogenerate an npmignore file 986e57a
  • [meta] add auto-changelog 2ee6cfc
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, safe-publish-latest, tape b1e92b1
  • [Deps] update define-properties, es-abstract 92e11e2
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, functions-have-names, tape 509d44d
  • [actions] update rebase action to use reusable workflow 7769cb6
  • [actions] update codecov uploader 52a16c8

3.1.3 / 2021-10-04

  • [Robustness] avoid a runtime call to .push
  • [Deps] update es-abstract
  • [readme] add github actions/codecov badges
  • [meta] use prepublishOnly script for npm 7+
  • [actions] update workflows
  • [actions] use node/install instead of node/run; use codecov action
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, aud, tape

3.1.2 / 2021-02-20

  • [meta] do not publish github action workflow files
  • [Deps] update call-bind, es-abstract
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, functions-have-names, has-strict-mode, tape
  • [actions] update workflows
  • [Tests] increase coverage

3.1.1 / 2020-11-21

  • [Deps] update es-abstract; use call-bind where applicable
  • [Dev Deps] update eslint, @ljharb/eslint-config, functions-have-names, tape; add aud
  • [actions] add "Allow Edits" workflow
  • [actions] switch Automatic Rebase workflow to pull_request_target event
  • [meta] gitignore nyc output
  • [meta] add safe-publish-latest
  • [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
  • [Tests] update function-bind

3.1.0 / 2019-12-14

  • [New] add auto entry point
  • [Refactor] use split-up es-abstract (77% bundle size decrease)
  • [readme] remove testling
  • [readme] Fixed syntax error in README (#12)
  • [readme] Stage 4
  • [Deps] update define-properties, es-abstract, function-bind
  • [Dev Deps] update eslint, @ljharb/eslint-config, functions-have-names, covert, tape, @es-shims/api
  • [meta] add funding field
  • [meta] Only apps should have lockfiles.
  • [Tests] use pretest/posttest for linting/security
  • [Tests] use functions-have-names
  • [Tests] use npx aud instead of nsp or npm audit with hoops
  • [Tests] remove jscs
  • [Tests] use shared travis-ci configs
  • [actions] add automatic rebasing / merge commit blocking

3.0.0 / 2015-11-17

  • Renamed to padStart/padEnd per November 2015 TC39 meeting.

2.0.0 / 2015-09-25

1.0.0 / 2015-07-30

  • v1.0.0