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

Method get

website/script/index.js:114–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112 }
113
114 async get() {
115 try {
116 let raw = atob(this.store.get());
117 let bytes = new Uint8Array(raw.length);
118 for (let i = 0; i < raw.length; i += 1) bytes[i] = raw.charCodeAt(i);
119 const reader = bufferToStream(bytes)
120 .pipeThrough(new DecompressionStream("deflate-raw"))
121 .getReader();
122 let arr = [];
123 while (true) {
124 const { done, value } = await reader.read();
125 if (done) break;
126 for (let i of value) arr.push(String.fromCharCode(i));
127 }
128 return arr.join("");
129 } catch (e) {
130 console.error(e);
131 return "";
132 }
133 }
134
135 async set(code) {
136 try {

Callers 6

getFunction · 0.45
connectedCallbackMethod · 0.45
formatMethod · 0.45
setValueFromUrlMethod · 0.45
exampleMethod · 0.45
setValueFromUrlMethod · 0.45

Calls 2

bufferToStreamFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected