MCPcopy
hub / github.com/kickscondor/fraidycat / readFile

Method readFile

src/js/webext/storage.js:96–108  ·  view source on GitHub ↗
(path, raw)

Source from the content-addressed store, hash-verified

94 }
95
96 async readFile(path, raw) {
97 return new Promise((resolve, reject) => {
98 browser.storage.local.get(path).then(items => {
99 let obj = items[path]
100 if (typeof(obj) === 'string' && !raw)
101 obj = this.decode(obj)
102 if (!obj)
103 reject()
104 else
105 resolve(obj)
106 })
107 })
108 }
109
110 async writeFile(path, data, raw) {
111 if (!raw)

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.95

Tested by

no test coverage detected