functionalscript 0.32.2 → 0.32.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fs/cas/module.f.js +2 -10
- package/package.json +1 -1
package/fs/cas/module.f.js
CHANGED
|
@@ -30,16 +30,8 @@ export const fileKvStore = (path) => {
|
|
|
30
30
|
const storePrefix = join(path, prefix);
|
|
31
31
|
const normalizedStorePrefix = normalize(storePrefix);
|
|
32
32
|
return {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return pure(r[1]);
|
|
36
|
-
}
|
|
37
|
-
// A missing file means "no such content"; surface anything else.
|
|
38
|
-
if (isNotFound(r[1])) {
|
|
39
|
-
return pure(undefined);
|
|
40
|
-
}
|
|
41
|
-
throw r[1];
|
|
42
|
-
}),
|
|
33
|
+
// TODO: extend the interface with `Result<Vec, unknown>` instead of `Vec|undefined`.
|
|
34
|
+
read: (key) => readFile(join(path, toPath(key))).step(([t, v]) => pure(t === 'ok' ? v : undefined)),
|
|
43
35
|
write: (key, value) => {
|
|
44
36
|
const p = toPath(key);
|
|
45
37
|
const parts = parse(p);
|