UNPKG

validatable

Version:

A library for synchronous and asynchronous input validation.

12 lines (9 loc) 251 B
import { toString } from 'typeable'; import { stringHexadecimal } from './string-hexadecimal'; export function BSONObjectID (value: any): boolean { value = toString(value); return ( stringHexadecimal(value) && value.length === 24 ); }