UNPKG

vitepress-jsdoc

Version:

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

30 lines 984 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parserFactory = void 0; const jsdoc_js_1 = require("../jsdoc.js"); /** * Factory object for creating parser instances based on file types. * * @namespace parserFactory */ exports.parserFactory = { /** * Creates and returns a parser instance based on the provided file type. * * @param {string} fileType - The type of the file (e.g., '.js', '.js', '.vue'). * @returns {Parser} - An instance of a parser corresponding to the file type. * @throws {Error} - Throws an error if the provided file type is unsupported. */ createParser(fileType) { switch (fileType) { case '.js': case '.ts': { return new jsdoc_js_1.JsDocParser(); } default: { throw new Error(`Unsupported file type: "${fileType}"`); } } }, }; //# sourceMappingURL=parser-factory.js.map