typebulb 0.59.0 → 0.59.2

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/dist/render.js CHANGED
@@ -810,6 +810,18 @@ ${B1}
810
810
  });
811
811
  await failIfNotOk(resp, 'list', path);
812
812
  return resp.json();
813
+ },
814
+ // Remove a file, or a folder and its contents. Throws on a missing path; the bulb's folder
815
+ // itself is refused.
816
+ remove: async (path) => {
817
+ if (isFramed) throw inlineErr('tb.fs');
818
+ const resp = await fetch('/__fs/remove', {
819
+ method: 'POST',
820
+ headers: { 'Content-Type': 'application/json' },
821
+ body: JSON.stringify({ path })
822
+ });
823
+ await failIfNotOk(resp, 'remove', path);
824
+ return true;
813
825
  }
814
826
  };
815
827