Skip to content

Instantly share code, notes, and snippets.

View jpalomar's full-sized avatar
🤷
🤷

JR jpalomar

🤷
🤷
View GitHub Profile
@jpalomar
jpalomar / toScreamingSnakeCase.ts
Last active June 10, 2021 23:50
convert a string to SCREAMING_SNAKE_CASE
const toScreamingSnakeCase = (
str: string,
{ WORD_SEPARATORS, CAPITALS } = {
WORD_SEPARATORS: /[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/,
CAPITALS: /[A-Z\u00C0-\u00D6\u00D9-\u00DD]/g,
}
): string =>
str
.replace(CAPITALS, (match) => ' ' + (match.toUpperCase() || match))
.trim()
<alignment jcr:primaryType="nt:unstructured"
name="./alignChildren"
fieldLabel="Alignment of components"
required="{Boolean}true"
selectionMode="single"
sling:resourceType="granite/ui/components/coral/foundation/form/buttongroup">
<items jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured"
name="./default"