MCPcopy Index your code
hub / github.com/apitable/apitable / save

Method save

packages/core/src/tablebundle/table_bundle.ts:45–64  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

43 }
44
45 save(path: string) {
46 if (this._saver === undefined) {
47 return;
48 }
49 const sheetData = {};
50 this.nodeMap().forEach((value: TableBundleDataSheet, key: string) => {
51 sheetData[key + '.json'] = fflate.strToU8(JSON.stringify(value.snapshot));
52 if (value.extras !== undefined) {
53 sheetData[key + '.extras.json'] = fflate.strToU8(value.extras);
54 }
55 });
56 const zipped = fflate.zipSync({
57 data: sheetData,
58 'manifest.json': fflate.strToU8(JSON.stringify(this.manifest))
59 }, {
60 level: 1,
61 mtime: new Date()
62 });
63 this._saver.save(zipped, path);
64 }
65
66 loadFile(path: string) {
67 if (this._loader === undefined) {

Callers

nothing calls this directly

Calls 4

nodeMapMethod · 0.95
stringifyMethod · 0.80
saveMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected