UNPKG

@technobuddha/library

Version:
16 lines (15 loc) 460 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ensurePrefix = void 0; /** * Add a prefix to a string, if it does not already have the prefix * * @param input The string * @param prefix The prefix * @returns The prefix followed by the string */ function ensurePrefix(input, prefix) { return input.startsWith(prefix) ? input : prefix + input; } exports.ensurePrefix = ensurePrefix; exports.default = ensurePrefix;