sharkey/src/misc/is-objectid.ts

6 lines
194 B
TypeScript
Raw Normal View History

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