mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-27 15:04:25 -05:00
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
7 lines
216 B
TypeScript
7 lines
216 B
TypeScript
import { ObjectId } from 'mongodb';
|
|
|
|
// This is trivial, but makes it simple to refactor if we swap monogodb for
|
|
// bson, say.
|
|
export const isObjectID = (id?: string): boolean =>
|
|
id ? ObjectId.isValid(id) : false;
|