string.prototype.padstart

ES2017 spec-compliant String.prototype.padStart shim.

MIT 9 个版本
安装
npm install string.prototype.padstart
yarn add string.prototype.padstart
pnpm add string.prototype.padstart
bun add string.prototype.padstart
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

版本列表
3.1.7 2025-03-14
3.1.6 2024-03-17
3.1.5 2023-08-29
3.1.4 2022-11-07
3.1.3 2021-10-05
3.1.2 2021-02-20
3.1.1 2020-11-21
3.1.0 2019-12-14
3.0.0 2015-11-17