mirror of
https://github.com/morluto/rea.git
synced 2026-11-18 20:53:00 +00:00
fix(cli): preserve ADB extra schema in the product catalog (#12060)
This commit is contained in:
1 parent
80f533da8a
commit
da7982e105
1 file changed
+11
-17
@@ -178,23 +178,17 @@ export const activityExtraCliEntrySchema = z
|
||||
activityExtraCliPattern("float", patternBody(javaFloatValuePattern)),
|
||||
),
|
||||
])
|
||||
.transform((entry, context) => {
|
||||
const typeEnd = entry.indexOf(":");
|
||||
const keyEnd = entry.indexOf(":", typeEnd + 1);
|
||||
const parsed = activityExtraSchema.safeParse({
|
||||
type: entry.slice(0, typeEnd),
|
||||
key: entry.slice(typeEnd + 1, keyEnd),
|
||||
value: entry.slice(keyEnd + 1),
|
||||
});
|
||||
if (parsed.success) return parsed.data;
|
||||
context.addIssue({
|
||||
code: "custom",
|
||||
message:
|
||||
parsed.error.issues[0]?.message ??
|
||||
"Extra does not match the activity extra contract",
|
||||
});
|
||||
return z.NEVER;
|
||||
});
|
||||
.pipe(
|
||||
z.preprocess((entry: string) => {
|
||||
const typeEnd = entry.indexOf(":");
|
||||
const keyEnd = entry.indexOf(":", typeEnd + 1);
|
||||
return {
|
||||
type: entry.slice(0, typeEnd),
|
||||
key: entry.slice(typeEnd + 1, keyEnd),
|
||||
value: entry.slice(keyEnd + 1),
|
||||
};
|
||||
}, activityExtraSchema),
|
||||
);
|
||||
|
||||
/**
|
||||
* Caller intent for ADB-backed device inspection and acquisition.
|
||||
|
||||
Reference in new issue
Block a user