sharkey/src/misc/is-objectid.ts
Acid Chicken (硫酸鶏) 2776934728 Update is-objectid.ts (#4277)
* Update is-objectid.ts

* Update is-objectid.ts
2019-02-15 23:42:44 +09:00

6 lines
194 B
TypeScript

import { ObjectID } from 'mongodb';
export default function(x: any): x is ObjectID {
return x && typeof x === 'object' && (x.hasOwnProperty('toHexString') || x.hasOwnProperty('_bsontype'));
}