Détail du package

string.prototype.padleft

es-shims36MIT2.1.0

ES2017 spec-compliant String.prototype.padLeft shim.

String.prototype.padLeft, String.prototype.padStart, string, ES8

readme

String.prototype.padLeft Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

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

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

Most common usage:

var padLeft = require('string.prototype.padleft');

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

padLeft.shim();

assert(padLeft('foo', 2)) === 'foo'.padLeft(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.

2.1.0 / 2023-05-02

  • [New] add auto endpoint
  • [Refactor] use call-bind instead of function-bind; update es-abstract usage
  • [Refactor] Renaming var per https://github.com/tc39/proposal-string-pad-left-right/issues/13#issuecomment-151676376
  • [Refactor] Update concatenation algorithm to prevent strings larger than the max length
  • [Refactor] Improve the stringFiller concatenation algorithm:
  • [Deps] update define-properties, es-abstract, function-bind
  • [Docs] use versionbadg.es instead of vb.teelaun.ch for version badges
  • [meta] update dev workflows
  • [Dev Deps] update tape, eslint, @ljharb/eslint-config

2.0.0 / 2015-09-25

1.0.0 / 2015-07-30

  • v1.0.0