@paroicms/anywhere-lib
Advanced tools
Comparing version
@@ -7,4 +7,3 @@ import type { ClassicDocumentSchema, DocumentSchema, FTextFieldType, FieldType, LeafSchema, PartSchema, RoutingPointDocumentSchema, SiteSchema } from "../types/site-schema-types"; | ||
export declare function getSectionByLeafType(siteSchema: SiteSchema, leafType: string): PartSchema; | ||
export declare function singleChildClassicLeafTypeOf(siteSchema: SiteSchema, parentLeafType: string): string; | ||
export declare function childrenClassicLeafTypesOf(siteSchema: SiteSchema, parentLeafType: string): string[]; | ||
export declare function classicChildDocumentTypesOf(siteSchema: SiteSchema, parentLeafType: string): ClassicDocumentSchema[]; | ||
export declare function getDocumentTypeByBoDirName({ boDirName, siteSchema, }: { | ||
@@ -11,0 +10,0 @@ boDirName: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isFTextFieldType = exports.getMediaLimitPerPart = exports.getMediaLimitPerDocument = exports.getLeafSchema = exports.getParentDocumentTypeOf = exports.getDocumentTypeByBoDirName = exports.childrenClassicLeafTypesOf = exports.singleChildClassicLeafTypeOf = exports.getSectionByLeafType = exports.getClassicDocumentTypes = exports.getRoutingPointDocumentTypes = exports.getPartTypeByLeafType = exports.getDocumentTypeByLeafType = void 0; | ||
exports.isFTextFieldType = exports.getMediaLimitPerPart = exports.getMediaLimitPerDocument = exports.getLeafSchema = exports.getParentDocumentTypeOf = exports.getDocumentTypeByBoDirName = exports.classicChildDocumentTypesOf = exports.getSectionByLeafType = exports.getClassicDocumentTypes = exports.getRoutingPointDocumentTypes = exports.getPartTypeByLeafType = exports.getDocumentTypeByLeafType = void 0; | ||
function getDocumentTypeByLeafType(siteSchema, leafType) { | ||
@@ -33,11 +33,3 @@ const documentType = siteSchema.documentTypes[leafType]; | ||
exports.getSectionByLeafType = getSectionByLeafType; | ||
function singleChildClassicLeafTypeOf(siteSchema, parentLeafType) { | ||
const found = childrenClassicLeafTypesOf(siteSchema, parentLeafType); | ||
if (found.length !== 1) { | ||
throw new Error(`cannot find the child type of '${parentLeafType}'`); | ||
} | ||
return found[0]; | ||
} | ||
exports.singleChildClassicLeafTypeOf = singleChildClassicLeafTypeOf; | ||
function childrenClassicLeafTypesOf(siteSchema, parentLeafType) { | ||
function classicChildDocumentTypesOf(siteSchema, parentLeafType) { | ||
const found = []; | ||
@@ -48,3 +40,3 @@ const parent = getDocumentTypeByLeafType(siteSchema, parentLeafType); | ||
if (documentType.kind !== "routingPoint") { | ||
found.push(documentType.leafType); | ||
found.push(documentType); | ||
} | ||
@@ -54,3 +46,3 @@ } | ||
} | ||
exports.childrenClassicLeafTypesOf = childrenClassicLeafTypesOf; | ||
exports.classicChildDocumentTypesOf = classicChildDocumentTypesOf; | ||
function getDocumentTypeByBoDirName({ boDirName, siteSchema, }) { | ||
@@ -57,0 +49,0 @@ const found = Object.values(siteSchema.documentTypes).find((item) => item.boDirName === boDirName); |
@@ -7,4 +7,3 @@ import type { ClassicDocumentSchema, DocumentSchema, FTextFieldType, FieldType, LeafSchema, PartSchema, RoutingPointDocumentSchema, SiteSchema } from "../types/site-schema-types"; | ||
export declare function getSectionByLeafType(siteSchema: SiteSchema, leafType: string): PartSchema; | ||
export declare function singleChildClassicLeafTypeOf(siteSchema: SiteSchema, parentLeafType: string): string; | ||
export declare function childrenClassicLeafTypesOf(siteSchema: SiteSchema, parentLeafType: string): string[]; | ||
export declare function classicChildDocumentTypesOf(siteSchema: SiteSchema, parentLeafType: string): ClassicDocumentSchema[]; | ||
export declare function getDocumentTypeByBoDirName({ boDirName, siteSchema, }: { | ||
@@ -11,0 +10,0 @@ boDirName: string; |
@@ -25,10 +25,3 @@ export function getDocumentTypeByLeafType(siteSchema, leafType) { | ||
} | ||
export function singleChildClassicLeafTypeOf(siteSchema, parentLeafType) { | ||
const found = childrenClassicLeafTypesOf(siteSchema, parentLeafType); | ||
if (found.length !== 1) { | ||
throw new Error(`cannot find the child type of '${parentLeafType}'`); | ||
} | ||
return found[0]; | ||
} | ||
export function childrenClassicLeafTypesOf(siteSchema, parentLeafType) { | ||
export function classicChildDocumentTypesOf(siteSchema, parentLeafType) { | ||
const found = []; | ||
@@ -39,3 +32,3 @@ const parent = getDocumentTypeByLeafType(siteSchema, parentLeafType); | ||
if (documentType.kind !== "routingPoint") { | ||
found.push(documentType.leafType); | ||
found.push(documentType); | ||
} | ||
@@ -42,0 +35,0 @@ } |
{ | ||
"name": "@paroicms/anywhere-lib", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Front lib for Paroi CMS.", | ||
@@ -5,0 +5,0 @@ "author": "Paroi Team", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
43922
-3.12%727
-2.28%