ochre-sdk 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1788,6 +1788,7 @@ function parseImageMapArea(area) {
|
|
|
1788
1788
|
publicationDateTime: area.publicationDateTime,
|
|
1789
1789
|
type: area.type,
|
|
1790
1790
|
title: area.title,
|
|
1791
|
+
slug: area.slug ?? null,
|
|
1791
1792
|
items: shape === "rectangle" ? [{
|
|
1792
1793
|
shape,
|
|
1793
1794
|
coords: [
|
|
@@ -2909,6 +2910,7 @@ const XMLImageMapArea = v.object({
|
|
|
2909
2910
|
publicationDateTime: customDateTime("XMLImageMapArea: publicationDateTime is not a valid datetime"),
|
|
2910
2911
|
type: v.string("XMLImageMapArea: type is string and required"),
|
|
2911
2912
|
title: v.string("XMLImageMapArea: title is string and required"),
|
|
2913
|
+
slug: v.optional(v.string("XMLImageMapArea: slug is string and optional")),
|
|
2912
2914
|
shape: v.picklist([
|
|
2913
2915
|
"rect",
|
|
2914
2916
|
"circle",
|
|
@@ -6656,7 +6658,11 @@ function parseWebsiteSegments(resources, context, options, slugPrefix) {
|
|
|
6656
6658
|
const segments = [];
|
|
6657
6659
|
for (const resource of resources ?? []) {
|
|
6658
6660
|
if (!("segments" in resource)) continue;
|
|
6659
|
-
for (const tree of resource.segments.tree)
|
|
6661
|
+
for (const tree of resource.segments.tree) {
|
|
6662
|
+
const segmentSlug = tree.identification.abbreviation == null ? null : parseStringContent(tree.identification.abbreviation, options);
|
|
6663
|
+
if (segmentSlug == null) throw new Error(`Slug not found for segment website (website uuid “${tree.uuid}”)`);
|
|
6664
|
+
segments.push(parseWebsiteTree(tree, context, "segment", options, prefixSlug(segmentSlug, slugPrefix)));
|
|
6665
|
+
}
|
|
6660
6666
|
}
|
|
6661
6667
|
return segments;
|
|
6662
6668
|
}
|