All files / packages/app/utils/store language.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15              332x   6416x   332x      
import { keys } from "remeda";
import { z } from "zod";
 
import { languages } from "~app/utils/i18n-data";
import type { Language } from "~app/utils/i18n-data";
import { fallback } from "~app/utils/validation";
 
export const LANGUAGE_STORE_NAME = "ssrContext:language";
 
const getLanguage = (): Language => "en";
 
export const languageSchema = z
	.literal(keys(languages))
	.or(fallback(getLanguage));