From a87fc3f2d4516934220bf393336b5c1a0914b80c Mon Sep 17 00:00:00 2001 From: Vladimir Vagaytsev Date: Wed, 22 Nov 2023 17:20:42 +0100 Subject: [PATCH] fix: crash on yaml highlighting Fixed the function import in the same way as in #5421. --- core/src/util/serialization.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/util/serialization.ts b/core/src/util/serialization.ts index d06cd5c98a..10b6b87db1 100644 --- a/core/src/util/serialization.ts +++ b/core/src/util/serialization.ts @@ -10,11 +10,10 @@ import { mapValues } from "lodash-es" import fsExtra from "fs-extra" import type { DumpOptions } from "js-yaml" import { dump, load } from "js-yaml" -import highlightModule from "cli-highlight" +import { default as highlightModule } from "cli-highlight" import { styles } from "../logger/styles.js" const { readFile, writeFile } = fsExtra -const highlight = highlightModule.default export async function dumpYaml(yamlPath: string, data: any) { return writeFile(yamlPath, safeDumpYaml(data, { noRefs: true })) @@ -35,7 +34,7 @@ export function encodeYamlMulti(objects: object[]) { } export function highlightYaml(s: string) { - return highlight(s, { + return highlightModule.highlight(s, { language: "yaml", theme: { keyword: styles.accent.italic,