MCPcopy Create free account
hub / github.com/JacobLinCool/LeetCode-Stats-Card / constructor

Method constructor

packages/core/src/item.ts:13–38  ·  view source on GitHub ↗
(
        type = "g",
        {
            id,
            attr = {},
            style = {},
            single = false,
            children = [],
            content = undefined,
        }: {
            id?: string;
            attr?: Record<string, string[] | string | number>;
            style?: Record<string, string | number>;
            single?: boolean;
            children?: Item[];
            content?: string;
        } = {},
    )

Source from the content-addressed store, hash-verified

11 public content?: string;
12
13 constructor(
14 type = "g",
15 {
16 id,
17 attr = {},
18 style = {},
19 single = false,
20 children = [],
21 content = undefined,
22 }: {
23 id?: string;
24 attr?: Record<string, string[] | string | number>;
25 style?: Record<string, string | number>;
26 single?: boolean;
27 children?: Item[];
28 content?: string;
29 } = {},
30 ) {
31 this.type = type;
32 this.attr = attr;
33 this.attr.id = id || this.attr.id;
34 this.style = style;
35 this.single = single;
36 this.children = children;
37 this.content = content;
38 }
39
40 public stringify(): string {
41 if (!this.attr.id) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected