ampless 1.0.0-beta.53 → 1.0.0-beta.54
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.ts +9 -1
- package/dist/index.js +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,12 +17,20 @@ type SiteSettingsEventType = 'site.settings.updated';
|
|
|
17
17
|
*/
|
|
18
18
|
type PostIndexEventType = 'post.index.refresh';
|
|
19
19
|
type EventType = ContentEventType | MediaEventType | SiteSettingsEventType | PostIndexEventType;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Minimal projection of a Post item carried in events (no body, to keep
|
|
22
|
+
* payloads small). `format` / `excerpt` are included so the denormalized
|
|
23
|
+
* PostTag index can render tag-page summaries faithfully — without them the
|
|
24
|
+
* `listPostsByTag` resolver can't know a post's real format and would
|
|
25
|
+
* mislabel non-markdown posts.
|
|
26
|
+
*/
|
|
21
27
|
interface ContentEventPayload {
|
|
22
28
|
postId: string;
|
|
23
29
|
slug: string;
|
|
24
30
|
title: string;
|
|
25
31
|
status: 'draft' | 'published';
|
|
32
|
+
format?: ContentFormat;
|
|
33
|
+
excerpt?: string;
|
|
26
34
|
publishedAt?: string;
|
|
27
35
|
tags?: string[];
|
|
28
36
|
}
|
package/dist/index.js
CHANGED
|
@@ -529,6 +529,11 @@ function compareRows(a, b, sort) {
|
|
|
529
529
|
return b.title.localeCompare(a.title);
|
|
530
530
|
case "title-asc":
|
|
531
531
|
return a.title.localeCompare(b.title);
|
|
532
|
+
default: {
|
|
533
|
+
const _exhaustive = sort;
|
|
534
|
+
void _exhaustive;
|
|
535
|
+
return 0;
|
|
536
|
+
}
|
|
532
537
|
}
|
|
533
538
|
}
|
|
534
539
|
function compareOptionalIso(a, b, direction) {
|
|
@@ -766,6 +771,11 @@ function validateThemeValue(field, raw) {
|
|
|
766
771
|
const sanitized = v.replace(/[\x00-\x1f<>]/g, "");
|
|
767
772
|
return sanitized.length <= max ? sanitized : sanitized.slice(0, max);
|
|
768
773
|
}
|
|
774
|
+
default: {
|
|
775
|
+
const _exhaustive = field;
|
|
776
|
+
void _exhaustive;
|
|
777
|
+
return null;
|
|
778
|
+
}
|
|
769
779
|
}
|
|
770
780
|
}
|
|
771
781
|
var DANGEROUS_URL_RE = /^\s*(javascript|data|vbscript):/i;
|