diff --git a/app/converters/json-yaml/page.tsx b/app/converters/json-yaml/page.tsx index 90cb37d..0c58362 100644 --- a/app/converters/json-yaml/page.tsx +++ b/app/converters/json-yaml/page.tsx @@ -27,12 +27,14 @@ import { icons } from "@/components/icons"; import { PageRootSection } from "@/components/page-root-section"; import { PageSection } from "@/components/page-section"; -const two = " "; -const four = " "; +const indentations = { + two: " ", + four: " ", +}; export default function Page() { const [form, setForm] = useState({ - indentation: two, + indentation: indentations.two, json: '{\n "foo": "bar"\n}', yaml: "foo: bar", }); @@ -97,8 +99,8 @@ export default function Page() { - 2 spaces - 4 spaces + 2 spaces + 4 spaces } diff --git a/app/formatters/json/page.tsx b/app/formatters/json/page.tsx index 0099561..db19e72 100644 --- a/app/formatters/json/page.tsx +++ b/app/formatters/json/page.tsx @@ -24,13 +24,15 @@ import { icons } from "@/components/icons"; import { PageRootSection } from "@/components/page-root-section"; import { PageSection } from "@/components/page-section"; -const two = " "; -const four = " "; -const zero = ""; -const tab = "\t"; +const indentations = { + two: " ", + four: " ", + zero: "", + tab: "\t", +}; export default function Page() { - const [indentation, setIndentation] = useState(two); + const [indentation, setIndentation] = useState(indentations.two); const [input, setInput] = useState('{\n"foo":"bar"\n}'); const parsed = safeJsonParse(input); @@ -56,10 +58,10 @@ export default function Page() { - 2 spaces - 4 spaces - 1 tab - minified + 2 spaces + 4 spaces + 1 tab + minified } diff --git a/app/generators/uuid/page.tsx b/app/generators/uuid/page.tsx index 7dd785c..1465bd1 100644 --- a/app/generators/uuid/page.tsx +++ b/app/generators/uuid/page.tsx @@ -28,10 +28,12 @@ import { LabeledSwitch } from "@/components/labeled-switch"; import { PageRootSection } from "@/components/page-root-section"; import { PageSection } from "@/components/page-section"; -const v1 = "1"; -const v4 = "4"; +const versions = { + v1: "1", + v4: "4", +} as const; -const uuidVersions = t.keyof({ [v1]: null, [v4]: null }); +const uuidVersions = t.keyof({ [versions.v1]: null, [versions.v4]: null }); type UuidVersion = t.TypeOf; export default function Page() { @@ -118,8 +120,8 @@ export default function Page() { - 1 - 4 (GUID) + 1 + 4 (GUID) }