From 2f215ea34c0012db1808023f59cfe15c6c392ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Sun, 3 Feb 2019 04:31:03 +0900 Subject: [PATCH] Use `is` syntax (#4079) --- src/misc/is-objectid.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc/is-objectid.ts b/src/misc/is-objectid.ts index 8c1aabd568..c3148a7785 100644 --- a/src/misc/is-objectid.ts +++ b/src/misc/is-objectid.ts @@ -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'); }