@twg-group/container-manager
Version:
Container management for Docker, Swarm, Kubernetes
17 lines • 887 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.splitWithSpaces = exports.toKebabCase = exports.lcfirst = exports.ucfirst = exports.toBoolean = void 0;
const toBoolean = (str) => str !== undefined && str !== 'false' && str !== '0' && str !== '';
exports.toBoolean = toBoolean;
const ucfirst = (string) => string[0].toUpperCase() + string.slice(1);
exports.ucfirst = ucfirst;
const lcfirst = (string) => string[0].toLowerCase() + string.slice(1);
exports.lcfirst = lcfirst;
const toKebabCase = (string) => (0, exports.lcfirst)(string)
.replace(/\/[A-Z]/g, (str) => `${str.toLowerCase()}`)
.replace(/[A-Z]/g, (str) => `-${str}`)
.toLowerCase();
exports.toKebabCase = toKebabCase;
const splitWithSpaces = (string) => string.replace(/[A-Z]/g, (str) => ` ${str}`);
exports.splitWithSpaces = splitWithSpaces;
//# sourceMappingURL=strings.js.map