@keystatic/core

Search for an npm package
import 'fs/promises';
import 'path';
import { b as getDirectoriesForTreeKey, c as getCollectionPath, o as object, e as getSingletonFormat, h as getSingletonPath } from './index-49bb61a8.react-server.js';
import 'react/jsx-runtime';
import 'emery';
import '@braintree/sanitize-url';
import 'ignore';
import '@markdoc/markdoc/dist/index.mjs';
import 'emery/assertions';
import './index-e8fd44a1.react-server.js';
function getAllowedDirectories(config) {
const allowedDirectories = [];
for (const [collection, collectionConfig] of Object.entries((_config$collections = config.collections) !== null && _config$collections !== void 0 ? _config$collections : {})) {
var _config$collections;
allowedDirectories.push(...getDirectoriesForTreeKey(object(collectionConfig.schema), getCollectionPath(config, collection), undefined, {
data: 'yaml',
contentField: undefined,
dataLocation: 'index'
}));
if (collectionConfig.template) {
allowedDirectories.push(collectionConfig.template);
}
}
for (const [singleton, singletonConfig] of Object.entries((_config$singletons = config.singletons) !== null && _config$singletons !== void 0 ? _config$singletons : {})) {
var _config$singletons;
allowedDirectories.push(...getDirectoriesForTreeKey(object(singletonConfig.schema), getSingletonPath(config, singleton), undefined, getSingletonFormat(config, singleton)));
}
return [...new Set(allowedDirectories)];
}
export { getAllowedDirectories };