diff --git a/src/common/array/ensure-array.ts b/src/common/array/ensure-array.ts index 360024f6ab..dadfa73235 100644 --- a/src/common/array/ensure-array.ts +++ b/src/common/array/ensure-array.ts @@ -1,14 +1,19 @@ -type NonUndefined = T extends undefined ? never : T; +type NonNullUndefined = T extends undefined + ? never + : T extends null + ? never + : T; /** * Ensure that the input is an array or wrap it in an array * @param value - The value to ensure is an array */ export function ensureArray(value: undefined): undefined; -export function ensureArray(value: T | T[]): NonUndefined[]; -export function ensureArray(value: T | readonly T[]): NonUndefined[]; +export function ensureArray(value: null): null; +export function ensureArray(value: T | T[]): NonNullUndefined[]; +export function ensureArray(value: T | readonly T[]): NonNullUndefined[]; export function ensureArray(value) { - if (value === undefined || Array.isArray(value)) { + if (value === undefined || value === null || Array.isArray(value)) { return value; } return [value]; diff --git a/src/components/trace/hat-graph-node.ts b/src/components/trace/hat-graph-node.ts index de9e765607..994f1dc68a 100644 --- a/src/components/trace/hat-graph-node.ts +++ b/src/components/trace/hat-graph-node.ts @@ -20,8 +20,8 @@ export class HatGraphNode extends LitElement { @property({ attribute: false, reflect: true, type: Boolean }) notEnabled = false; - @property({ attribute: false, reflect: true, type: Boolean }) graphStart = - false; + @property({ attribute: "graph-start", reflect: true, type: Boolean }) + graphStart = false; @property({ type: Boolean, attribute: "nofocus" }) noFocus = false; @@ -112,7 +112,7 @@ export class HatGraphNode extends LitElement { var(--hat-graph-node-size) + var(--hat-graph-spacing) + 1px ); } - :host([graphStart]) { + :host([graph-start]) { height: calc(var(--hat-graph-node-size) + 2px); } :host([track]) { diff --git a/src/components/trace/hat-script-graph.ts b/src/components/trace/hat-script-graph.ts index e0e9c1f7d1..1bc7f057c1 100644 --- a/src/components/trace/hat-script-graph.ts +++ b/src/components/trace/hat-script-graph.ts @@ -91,7 +91,7 @@ export class HatScriptGraph extends LitElement { } return html`