core/formatters/vocabulary.formatter.ts

core/formatters/vocabulary.formatter.ts is a file in Bane's Lab Build Scripts. 9 lines of code and 1 definition.

import type { VocabularyEntry } from "@banes-lab/web/types/vocabulary.types.js";

export const renderVocabulary = function renderVocabulary(vocabulary: readonly VocabularyEntry[]): string {
    return [
        'import type { VocabularyEntry } from "#types/vocabulary.types";',
        "",
        `export const VOCABULARY: readonly VocabularyEntry[] = JSON.parse(${JSON.stringify(JSON.stringify(vocabulary))});`,
        "",
    ].join("\n");
};