hippofish/src/misc/is-objectid.ts

6 lines
162 B
TypeScript
Raw Normal View History

2019-02-02 20:31:03 +01:00
import { ObjectID } from 'mongodb';
export default function(x: any): x is ObjectID {
2018-10-16 04:38:09 +02:00
return x.hasOwnProperty('toHexString') || x.hasOwnProperty('_bsontype');
}