MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / normalize

Function normalize

apps/web/ui/Message/BlockCode/index.tsx:21–26  ·  view source on GitHub ↗
(value: string, language?: string)

Source from the content-addressed store, hash-verified

19}
20
21function normalize(value: string, language?: string) {
22 if (language && LANGUAGES.includes(language)) {
23 return value.replace(new RegExp('^' + language + '\\s'), '').trim();
24 }
25 return value.trim();
26}
27
28export default function BlockCode({ value, language, placeholder }: Props) {
29 const input = normalize(value, language);

Callers 1

BlockCodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected