refactor(apple): reuse asset catalog record typing (#16997)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-05 16:36:41 +08:00
1 parent 58c71c4e09
commit cdc40f3f15
1 file changed
+3 -7
+3 -7
View File
@@ -2,7 +2,7 @@ import { coverageStatusSchema } from "../coverage.js";
import { z } from "zod";
import { bundleResourceBoundResultSchema } from "./bundleResourceRoot.js";
import { jsonObjectSchema, jsonValueSchema } from "../jsonValue.js";
import { jsonObjectSchema } from "../jsonValue.js";
import { AnalysisOutputError } from "../analysisErrorCore.js";
import type { AnalysisParameterLimit } from "../analysisSettings.js";
import {
@@ -147,9 +147,7 @@ type AssetRenditionMatch = z.infer<
/** Parse assetutil JSON records without discarding format-specific metadata. */
export const parseAppleAssetCatalogRecords = (
value: unknown,
): readonly Readonly<
Record<string, ReturnType<typeof jsonValueSchema.parse>>
>[] => {
): readonly Readonly<z.output<typeof jsonObjectSchema>>[] => {
if (!Array.isArray(value))
throw new AnalysisOutputError(
"inspect_asset_catalog",
@@ -180,9 +178,7 @@ export const projectAppleAssetCatalogPage = (input: {
readonly catalogs: readonly {
readonly path: string;
readonly sha256: string;
readonly records: readonly Readonly<
Record<string, ReturnType<typeof jsonValueSchema.parse>>
>[];
readonly records: ReturnType<typeof parseAppleAssetCatalogRecords>;
}[];
readonly offset: number;
readonly limit: number;