UNPKG

@netlify/content-engine

Version:
22 lines 811 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.hasFeature = hasFeature; const node_fs_1 = __importDefault(require("node:fs")); const node_path_1 = __importDefault(require("node:path")); /** * Check the readme for a list of available features. */ function hasFeature(name) { try { const availableAPIs = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(__dirname, "../../apis.json"), "utf8")); return !!availableAPIs?.features?.includes(name); } catch (e) { console.log(e); throw new Error(`Couldn't check available APIs.`); } } //# sourceMappingURL=has-feature.js.map