UNPKG

vitepress-jsdoc

Version:

A bridge between Vitepress and JSDoc-style commented codebases for hassle-free documentation.

39 lines 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DocsFolderManager = void 0; const file_operations_js_1 = require("../utilities/file-operations.js"); /** * The `DocsFolderManager` class provides functionalities to manage the documentation * folder. It offers methods to delete and create the docs folder, abstracting the * underlying operations. */ class DocsFolderManager { /** * Deletes the specified documentation folder based on the provided pattern. * * @param {string} docsFolder - The path to the documentation folder to delete. * @param {string[]} rmPattern - An array of patterns specifying which files or directories to exclude from deletion. * @returns {Promise<void>} A promise that resolves once the deletion is complete. * * @example * const manager = new DocsFolderManager(); * await manager.delete('./docs', ['exclude-pattern']); */ async delete(docsFolder, rmPattern) { return (0, file_operations_js_1.deleteDocsFolder)(docsFolder, rmPattern); } /** * Creates the specified documentation folder. * * @param {string} docsFolder - The path to the documentation folder to create. * * @example * const manager = new DocsFolderManager(); * manager.create('./docs'); */ create(docsFolder) { (0, file_operations_js_1.createDocsFolder)(docsFolder); } } exports.DocsFolderManager = DocsFolderManager; //# sourceMappingURL=docs-folder-manager.js.map