UNPKG

@technobuddha/library

Version:
19 lines (18 loc) 680 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toPascalCase = void 0; var toCapitalCase_1 = __importDefault(require("../toCapitalCase")); /** * Convert an identifier string to pascal case * * @param input The identifer string * @returns the identifier in pascal case */ function toPascalCase(input) { return toCapitalCase_1.default(input.trim().replace(/[-_.\s]+\w/ug, function (c) { return c.slice(-1).toUpperCase(); })); } exports.toPascalCase = toPascalCase; exports.default = toPascalCase;