@paroicms/server
Version:
The ParoiCMS server
21 lines • 846 B
JavaScript
import { siteSchemaFormatVersion } from "@paroicms/public-server-lib";
export function checkSiteSchemaFormatVersion(version, { file }) {
if (typeof version !== "string" || version !== siteSchemaFormatVersion) {
throw new Error(`Unsupported site-schema version "${version}" in file "${file}", expected: "${siteSchemaFormatVersion}"`);
}
}
export function shouldSkipAuthorsTaxonomy(siteSchema) {
for (const nodeType of Object.values(siteSchema.nodeTypes)) {
if (nodeType.kind !== "document")
continue;
if (!nodeType.fields)
continue;
for (const field of nodeType.fields) {
if (field.storedAs === "labeling" && field.taxonomy === "authors") {
return false;
}
}
}
return true;
}
//# sourceMappingURL=site-schema-helpers.js.map