From b4055e1c23eeefb0c8a85a77f312b2827d98f483 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Jul 2019 14:28:37 +0200 Subject: Add server hooks --- shared/core-utils/miscs/miscs.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'shared/core-utils/miscs/miscs.ts') diff --git a/shared/core-utils/miscs/miscs.ts b/shared/core-utils/miscs/miscs.ts index a3921b568..5de024c08 100644 --- a/shared/core-utils/miscs/miscs.ts +++ b/shared/core-utils/miscs/miscs.ts @@ -19,7 +19,17 @@ function compareSemVer (a: string, b: string) { return segmentsA.length - segmentsB.length } +function isPromise (value: any) { + return value && typeof value.then === 'function' +} + +function isCatchable (value: any) { + return value && typeof value.catch === 'function' +} + export { randomInt, - compareSemVer + compareSemVer, + isPromise, + isCatchable } -- cgit v1.2.3