MCPcopy Create free account
hub / github.com/csskit/csskit / set

Method set

website/script/index.js:135–151  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

133 }
134
135 async set(code) {
136 try {
137 const reader = bufferToStream(new TextEncoder().encode(code))
138 .pipeThrough(new CompressionStream("deflate-raw"))
139 .getReader();
140 const arr = [];
141 while (true) {
142 const { done, value } = await reader.read();
143 if (done) break;
144 for (let i of value) arr.push(i);
145 }
146 this.store.set(btoa(arr.map((s) => String.fromCharCode(s)).join("")));
147 } catch (e) {
148 console.error(e);
149 return "";
150 }
151 }
152}
153
154const codeFromUrl = new CodeStorage({

Callers 7

enter_declarationMethod · 0.80
exit_declarationMethod · 0.80
setFunction · 0.80
handleEventMethod · 0.80
handleEventMethod · 0.80
handleEventMethod · 0.80
coalesceByDayFunction · 0.80

Calls 2

bufferToStreamFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected