MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / ply_storage_new

Function ply_storage_new

js/storage.js:85–102  ·  view source on GitHub ↗
(root_path_obj)

Source from the content-addressed store, hash-verified

83}
84
85function ply_storage_new(root_path_obj) {
86 var op_id = ply_storage_next_op_id();
87 var root_path = consume_js_object(root_path_obj);
88
89 (async function () {
90 try {
91 var root_handle = await ply_storage_resolve_root(root_path);
92 var storage_id = ply_storage_root_uid;
93 ply_storage_root_uid += 1;
94 ply_storage_roots[storage_id] = root_handle;
95 ply_storage_finish_ok(op_id, { storage_id: storage_id });
96 } catch (error) {
97 ply_storage_finish_err(op_id, error);
98 }
99 }());
100
101 return op_id;
102}
103
104function ply_storage_save_bytes(storage_id, relative_path_obj, data_obj) {
105 var op_id = ply_storage_next_op_id();

Callers 1

newMethod · 0.85

Calls 5

ply_storage_next_op_idFunction · 0.85
consume_js_objectFunction · 0.85
ply_storage_resolve_rootFunction · 0.85
ply_storage_finish_okFunction · 0.85
ply_storage_finish_errFunction · 0.85

Tested by

no test coverage detected