From 262139a43f878ceef2f327369432e33b74fbd972 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:52:09 +0200 Subject: [PATCH] fix(ignore): bump js-yaml from 4.2.0 to 5.0.0 (#32371) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Koen Kanters --- lib/util/yaml.ts | 6 +++--- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- test/settings.test.ts | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/util/yaml.ts b/lib/util/yaml.ts index a99832254..43684fb11 100644 --- a/lib/util/yaml.ts +++ b/lib/util/yaml.ts @@ -2,7 +2,7 @@ import assert from "node:assert"; import fs from "node:fs"; import equals from "fast-deep-equal/es6"; -import yaml, {YAMLException} from "js-yaml"; +import {dump, load, YAMLException} from "js-yaml"; export class YAMLFileException extends YAMLException { file: string; @@ -20,7 +20,7 @@ export class YAMLFileException extends YAMLException { function read(file: string): KeyValue { try { - const result = yaml.load(fs.readFileSync(file, "utf8")); + const result = load(fs.readFileSync(file, "utf8")); assert(result instanceof Object, `The content of ${file} is expected to be an object`); return result as KeyValue; } catch (error) { @@ -40,7 +40,7 @@ function writeIfChanged(file: string, content: KeyValue): void { const before = readIfExists(file); if (!equals(before, content)) { - fs.writeFileSync(file, yaml.dump(content)); + fs.writeFileSync(file, dump(content)); } } diff --git a/package.json b/package.json index bab70fd19..91cc46094 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "fast-deep-equal": "^3.1.3", "finalhandler": "^2.1.1", "humanize-duration": "^3.33.2", - "js-yaml": "^4.2.0", + "js-yaml": "^5.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "jszip": "^3.10.1", "mqtt": "^5.15.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 562b25dd6..29d293441 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: ^3.33.2 version: 3.33.2 js-yaml: - specifier: ^4.2.0 - version: 4.2.0 + specifier: ^5.0.0 + version: 5.0.0 json-stable-stringify-without-jsonify: specifier: ^1.0.1 version: 1.0.1 @@ -952,8 +952,8 @@ packages: js-tokens@9.0.1: resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} - js-yaml@4.2.0: - resolution: {integrity: sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==} + js-yaml@5.0.0: + resolution: {integrity: sha512-GSvaPUbk1U+FMZ7rJzF+F8e5YVtu7KnD40et/5rBXXRBv2jCO9L3qCewvIDDdudC0QycTFlf6EAA+h3kxBsuUw==} hasBin: true json-schema-traverse@1.0.0: @@ -2190,7 +2190,7 @@ snapshots: js-tokens@9.0.1: {} - js-yaml@4.2.0: + js-yaml@5.0.0: dependencies: argparse: 2.0.1 diff --git a/test/settings.test.ts b/test/settings.test.ts index a42363c46..051a441c0 100644 --- a/test/settings.test.ts +++ b/test/settings.test.ts @@ -3,7 +3,7 @@ import {beforeEach, describe, expect, it} from "vitest"; import "./mocks/data"; import fs from "node:fs"; -import yaml from "js-yaml"; +import {dump, load} from "js-yaml"; import objectAssignDeep from "object-assign-deep"; import mockedData from "../lib/util/data"; @@ -21,14 +21,14 @@ const minimalConfig = { describe("Settings", () => { const write = (file: string, json: Record, reread = true): void => { - fs.writeFileSync(file, yaml.dump(json)); + fs.writeFileSync(file, dump(json)); if (reread) { settings.reRead(); } }; - const read = (file: string): unknown => yaml.load(fs.readFileSync(file, "utf8")); + const read = (file: string): unknown => load(fs.readFileSync(file, "utf8")); const remove = (file: string): void => { if (fs.existsSync(file)) {