Execute oxfmt (#1166)
Ran pnpm oxfmt . This should get the web repo aligned so that we can better enforce oxfmt going forward.
This commit is contained in:
@@ -35,9 +35,13 @@ export function makePskHelpers(allowedByteLengths: readonly number[]) {
|
||||
const stringSchema = (optional = false) =>
|
||||
z
|
||||
.string()
|
||||
.refine((s) => optional || s !== "" || (s === "" && allowedByteLengths.includes(0)), {
|
||||
message: msgs.required,
|
||||
})
|
||||
.refine(
|
||||
(s) =>
|
||||
optional || s !== "" || (s === "" && allowedByteLengths.includes(0)),
|
||||
{
|
||||
message: msgs.required,
|
||||
},
|
||||
)
|
||||
.refine((s) => s === "" || tryParse(s) !== null, { message: msgs.format })
|
||||
.refine((s) => s === "" || isValidString(s), {
|
||||
message: msgs.length,
|
||||
@@ -47,13 +51,20 @@ export function makePskHelpers(allowedByteLengths: readonly number[]) {
|
||||
const bytesSchema = (optional = false): ZodType<Uint8Array> =>
|
||||
z
|
||||
.instanceof(Uint8Array)
|
||||
.refine((arr) => optional || arr.byteLength !== 0 || allowedByteLengths.includes(0), {
|
||||
message: msgs.required,
|
||||
})
|
||||
.refine((arr) => optional || allowedByteLengths.includes(arr.byteLength), {
|
||||
message: msgs.length,
|
||||
params: { bits: bitsLabel },
|
||||
});
|
||||
.refine(
|
||||
(arr) =>
|
||||
optional || arr.byteLength !== 0 || allowedByteLengths.includes(0),
|
||||
{
|
||||
message: msgs.required,
|
||||
},
|
||||
)
|
||||
.refine(
|
||||
(arr) => optional || allowedByteLengths.includes(arr.byteLength),
|
||||
{
|
||||
message: msgs.length,
|
||||
params: { bits: bitsLabel },
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
allowedByteLengths,
|
||||
|
||||
Reference in New Issue
Block a user