fix: incorrect type check for number in request params
This commit is contained in:
parent
28772fcd9f
commit
9c0783c607
@ -17,4 +17,4 @@ export default {
|
||||
fetch,
|
||||
} satisfies Deno.ServeDefaultExport;
|
||||
|
||||
export const VERSION = "0.2.0";
|
||||
export const VERSION = "0.2.1";
|
@ -15,9 +15,9 @@ const SnapshotQueryParamsSchema = object({
|
||||
const idSchema = mixed().test(
|
||||
"is-valid-id",
|
||||
'id must be a string starting with "av" followed by digits, or "BV" followed by 10 alphanumeric characters, or a positive integer',
|
||||
(value) => {
|
||||
if (typeof value === "number") {
|
||||
return Number.isInteger(value) && value > 0;
|
||||
async (value) => {
|
||||
if (value && await number().isValid(value)) {
|
||||
return Number.isInteger(value) && (value as number) > 0;
|
||||
}
|
||||
|
||||
if (typeof value === "string") {
|
||||
|
Loading…
Reference in New Issue
Block a user