deadlift-png
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Pixel art of a person performing deadlifts

deadlift-png

Left Pad 0BSD License Unmaintained

An obsolete left-pad module (since ES2017 includes String.prototype.padStart()).

install

pnpm

pnpm add deadlift-png

npm

npm install deadlift-png

yarn

yarn add deadlift-png

usage

leftPad :: Char -> Integer -> String -> String

The first argument is a string containing a single character to use for padding the string. By default, the character used is a space (" "). The second argument is an integer that represents the length of the string after padding is added. If the string length is greater than the given number, then the string is returned without modification. The third and final argument is the string to pad.

import { leftPad } from "deadlift-png"

const paddedString = leftPad()(13)("hello world") // => "  hello world"
const paddedNumber = leftPad("0")(3)(7)           // => "007"
const paddedDots = leftPad(".")(10)("hi")         // => "........hi"
const tooShort = leftPad()(3)("hello")            // => "hello"

Package Sidebar

Install

npm i deadlift-png

Weekly Downloads

0

Version

0.1.1

License

0BSD

Unpacked Size

4.49 kB

Total Files

6

Last publish

Collaborators

  • rasch