UNPKG

softkave-js-utils

Version:

JavaScript & Typescript utility functions, types, and classes

10 lines 566 B
import { kSoftkaveJsUtilsConstants } from '../constants.js'; export function padIdShortName(shortName, opts = {}) { const { shortNameLength = kSoftkaveJsUtilsConstants.resource.shortNameLength, shortNamePaddingChar = kSoftkaveJsUtilsConstants.resource .shortNamePaddingChar, } = opts; if (shortName.length > shortNameLength) { throw new Error(`Resource short name is more than ${shortNameLength} characters`); } return shortName.padEnd(shortNameLength, shortNamePaddingChar).toLowerCase(); } //# sourceMappingURL=padIdShortName.js.map