@danypops/pi-papyrus 0.54.0 → 0.54.1
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.
|
@@ -29,8 +29,12 @@ export function filterArtifactRows(rows: Artifact[], query: string): Artifact[]
|
|
|
29
29
|
const needle = query.trim().toLowerCase();
|
|
30
30
|
if (!needle) return [...rows];
|
|
31
31
|
return rows.filter((row) =>
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// List operations commonly hand back ArtifactSummary rows (body/extra omitted for cheap
|
|
33
|
+
// listing) rather than the full Artifact this type declares -- body/subtype/extra can be
|
|
34
|
+
// undefined at runtime here despite the type saying string, so every value is normalized
|
|
35
|
+
// to "" before lowercasing instead of assuming it's always a real string.
|
|
36
|
+
[row.id, row.title, row.body, row.subtype, row.labels.join(" "), row.extra ? JSON.stringify(row.extra) : undefined].some((value) =>
|
|
37
|
+
(value ?? "").toLowerCase().includes(needle),
|
|
34
38
|
),
|
|
35
39
|
);
|
|
36
40
|
}
|
package/package.json
CHANGED