From db4a1c0f830c688d3ba19f6dce8080cdd83b541c Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 16 Sep 2025 22:42:02 -0400 Subject: [PATCH] simplify --- .../svelte/src/internal/server/payload.js | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/svelte/src/internal/server/payload.js b/packages/svelte/src/internal/server/payload.js index ed28e081e0..5dbb3c5a43 100644 --- a/packages/svelte/src/internal/server/payload.js +++ b/packages/svelte/src/internal/server/payload.js @@ -386,28 +386,21 @@ export class TreeState { } export class TreeHeadState { - /** @type {Set<{ hash: string; code: string }>} */ - #css = new Set(); + /** @readonly @type {Set<{ hash: string; code: string }>} */ + css = new Set(); - /** @type {() => string} */ - #uid = () => ''; + /** @readonly @type {() => string} */ + uid = () => ''; /** * @type {{ path: number[], value: string }} */ #title = { path: [], value: '' }; - get css() { - return this.#css; - } - - get uid() { - return this.#uid; - } - get title() { return this.#title; } + set title(value) { // perform a depth-first (lexicographic) comparison using the path. Reject sets // from earlier than or equal to the current value. @@ -437,8 +430,7 @@ export class TreeHeadState { * @param {() => string} uid */ constructor(uid) { - this.#uid = uid; - this.#css = new Set(); + this.uid = uid; this.#title = { path: [], value: '' }; } }