Use is syntax (#4079)

This commit is contained in:
Acid Chicken (硫酸鶏) 2019-02-03 04:31:03 +09:00 committed by syuilo
parent c2ace79469
commit 3604b99943

View File

@ -1,3 +1,5 @@
export default function(x: any): boolean { import { ObjectID } from 'mongodb';
export default function(x: any): x is ObjectID {
return x.hasOwnProperty('toHexString') || x.hasOwnProperty('_bsontype'); return x.hasOwnProperty('toHexString') || x.hasOwnProperty('_bsontype');
} }