UNPKG

@quo0/stiletto

Version:

With stiletto library you will be able to mock requests and choose between preconfigured responses right on the fly via UI

35 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FolderStructureEntityModel = void 0; const tslib_1 = require("tslib"); const fs_1 = require("../../services/fs"); class FolderStructureEntityModel { constructor({ privateName, name, defaultPath }) { this.privateName = privateName; this.name = name; this.defaultPath = defaultPath; } create() { return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { return (0, fs_1.ensureDir)(this.defaultPath); }); } read() { return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { const fileNames = yield (0, fs_1.readdir)(this.defaultPath); return fileNames; }); } update() { return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { // TODO: do we need this method? }); } delete() { return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { return (0, fs_1.remove)(this.defaultPath); }); } } exports.FolderStructureEntityModel = FolderStructureEntityModel; //# sourceMappingURL=folder-structure-entity.model.js.map