0.1.1 • Published 3 years ago
deadlift-png v0.1.1
deadlift-png
An obsolete left-pad module (since ES2017 includes
String.prototype.padStart()).
install
pnpm
pnpm add deadlift-pngnpm
npm install deadlift-pngyarn
yarn add deadlift-pngusage
leftPad :: Char -> Integer -> String -> StringThe 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"