MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / constructor

Method constructor

packages/utils/src/asset.ts:101–120  ·  view source on GitHub ↗
(level: number, id?: string)

Source from the content-addressed store, hash-verified

99 readonly id: string;
100
101 constructor(level: number, id?: string) {
102 this.level = level;
103 if (id) {
104 this.id = id;
105 }
106 let placeholder: any;
107 if (id) {
108 placeholder = document.head.querySelector(`style[data-id="${id}"]`);
109 }
110 if (!placeholder) {
111 placeholder = document.createTextNode('');
112 const meta = document.head.querySelector(`meta[level="${level}"]`);
113 if (meta) {
114 document.head.insertBefore(placeholder, meta);
115 } else {
116 document.head.appendChild(placeholder);
117 }
118 }
119 this.placeholder = placeholder;
120 }
121
122 applyText(content: string) {
123 if (this.lastContent === content) {

Callers

nothing calls this directly

Calls 1

insertBeforeMethod · 0.65

Tested by

no test coverage detected