UNPKG

@constructor-io/constructorio-connect-cli

Version:

CLI tool to enable users to interface with the Constructor Connect Ecosystem

29 lines (28 loc) 1.02 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getExternalFiles = getExternalFiles; const path_1 = __importDefault(require("path")); const find_deep_files_1 = require("../helpers/find-deep-files"); function getExternalFiles() { try { const filePath = path_1.default.join("src", "fixtures", "external_data"); return (0, find_deep_files_1.findDeepFiles)(filePath) .filter((file) => path_1.default.extname(file) === ".json") .map((file) => { const relativePath = path_1.default.relative(filePath, file); return { name: relativePath, value: relativePath, }; }); } catch (error) { if (error instanceof Error && error.message.includes("ENOENT")) { return []; } throw error; } }