const t=/[\s_.-]+/,e="_";function r(t){return n(t).map(((t,r)=>function(t,r=!0){if(null==t||""===t)return"";const n=t.charAt(0),o=t.slice(1).toLowerCase();if(r&&n>="0"&&n<="9")return`${e}${n}${o}`;return`${n.toUpperCase()}${o}`}(t,r>0))).join("")}function n(e){const r=[e.charAt(0)];for(let t=1;t<e.length;t++){const n=e.charAt(t-1).match(/[a-z]/g)?.length>0,o=e.charAt(t).match(/[A-Z]/g)?.length>0;n&&o&&r.push(" "),r.push(e.charAt(t))}return r.join("").split(t)}function o(t){return n(t).map(((t,e)=>{if(0===e)return t.toLowerCase();const r=t.charAt(0).toUpperCase(),n=t.slice(1).toLowerCase();return/^\d/.test(r)?`_${r}${n}`:`${r}${n}`})).join("")}function a(t){return n(t).map((t=>t.toLowerCase())).join("_")}function c(t){return n(t).map((t=>t.toLowerCase())).join("-")}function u(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/\b\w/g,(t=>t.toUpperCase()))}export{o as camelCase,u as camelCaseToSpacedCapitalized,c as kebabCase,r as pascalCase,a as snakeCase};
//# sourceMappingURL=change-case.js.map
