UNPKG

bootstrap-vue-next

Version:

BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.

19 lines (18 loc) 1.14 kB
import { g as RX_SPACES, h as RX_REGEXP_REPLACE, i as RX_UNDERSCORE, j as RX_LOWER_UPPER, k as RX_FIRST_START_SPACE_WORD, l as RX_START_SPACE_WORD } from "./constants-DameGf19.mjs"; const startCase = (str) => str.replace(RX_UNDERSCORE, " ").replace(RX_LOWER_UPPER, (_, $1, $2) => `${$1} ${$2}`).replace(RX_FIRST_START_SPACE_WORD, (_, $1, $2) => $1 + $2.toUpperCase()); const titleCase = (str) => str.replace(RX_UNDERSCORE, " ").replace(RX_LOWER_UPPER, (_, $1, $2) => `${$1} ${$2}`).replace(RX_START_SPACE_WORD, (_, $1, $2) => $1 + $2.toUpperCase()); const upperFirst = (str) => { const trim = str.trim(); return trim.charAt(0).toUpperCase() + trim.slice(1); }; const escapeRegExp = (str) => str.replace(RX_REGEXP_REPLACE, "\\$&"); const escapeRegExpChars = (str) => escapeRegExp(str).replace(RX_SPACES, "\\s"); const toPascalCase = (str) => str.replace(/-./g, (match) => match.charAt(1).toUpperCase()).replace(/\b\w/g, (match) => match.toUpperCase()).replace(/\s+/g, ""); export { titleCase as a, escapeRegExpChars as e, startCase as s, toPascalCase as t, upperFirst as u }; //# sourceMappingURL=stringUtils-B4XdnJx5.mjs.map