chore: addtl protection against invalid ids
This commit is contained in:
@@ -4,7 +4,7 @@ export const isValidID = (
|
||||
value: number | string,
|
||||
type: 'ObjectID' | 'number' | 'text',
|
||||
): boolean => {
|
||||
if (type === 'text') return typeof value === 'string'
|
||||
if (type === 'text') return value && typeof value === 'string'
|
||||
if (typeof value === 'number' && !Number.isNaN(value)) return true
|
||||
|
||||
if (type === 'ObjectID') {
|
||||
|
||||
Reference in New Issue
Block a user