UNPKG

declapract

Version:

A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.

20 lines 987 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.readExampleDeclarations = void 0; const ExampleDeclaration_1 = require("../../../domain/objects/ExampleDeclaration"); const listPathsInDirectory_1 = require("../../../utils/filepaths/listPathsInDirectory"); const readExampleDeclarations = async ({ declarationsRootDirectory, declaredExamplesDirectory, }) => { const exampleDirectories = await (0, listPathsInDirectory_1.listPathsInDirectory)({ directory: declaredExamplesDirectory, }); const examples = exampleDirectories.map((directory) => { const name = directory; return new ExampleDeclaration_1.ExampleDeclaration({ name, exampleRootDirectory: `${declaredExamplesDirectory}/${directory}`.replace(`${declarationsRootDirectory}/`, ''), }); }); return examples; }; exports.readExampleDeclarations = readExampleDeclarations; //# sourceMappingURL=readExampleDeclarations.js.map