nicolium/pl-api: remove as any from coerceObject

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-02-27 01:38:32 +01:00
parent d110ed40ba
commit f531474be0
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ const filteredArray = <T>(schema: v.BaseSchema<any, T, v.BaseIssue<unknown>>) =>
);
/** valibot schema to force the value into an object, if it isn't already. */
const coerceObject = <T extends v.ObjectEntries>(shape: T): v.ObjectSchema<T, undefined> =>
const coerceObject = <T extends v.ObjectEntries>(shape: T) =>
v.optional(
v.pipe(
v.any(),
@ -23,6 +23,6 @@ const coerceObject = <T extends v.ObjectEntries>(shape: T): v.ObjectSchema<T, un
v.object(shape),
),
{},
) as any;
);
export { filteredArray, coerceObject };

View File

@ -36,7 +36,7 @@ const emojiSchema = v.pipe(v.string(), v.emoji());
const mimeSchema = v.pipe(v.string(), v.regex(/^\w+\/[-+.\w]+$/));
/** valibot schema to force the value into an object, if it isn't already. */
const coerceObject = <T extends v.ObjectEntries>(shape: T): v.ObjectSchema<T, undefined> =>
const coerceObject = <T extends v.ObjectEntries>(shape: T) =>
v.optional(
v.pipe(
v.any(),
@ -44,6 +44,6 @@ const coerceObject = <T extends v.ObjectEntries>(shape: T): v.ObjectSchema<T, un
v.object(shape),
),
{},
) as any;
);
export { filteredArray, emojiSchema, datetimeSchema, dateSchema, mimeSchema, coerceObject };