From 2f215ea34c0012db1808023f59cfe15c6c392ccc Mon Sep 17 00:00:00 2001 From: "Acid Chicken (硫酸鶏)" Date: Sun, 3 Feb 2019 04:31:03 +0900 Subject: Use `is` syntax (#4079) --- src/misc/is-objectid.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/misc') 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'); } -- cgit v1.2.3-freya