From 1699d39f622629988eb8e9ab284effb4fa3541d1 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Mon, 14 Mar 2022 23:25:01 +0800 Subject: [PATCH] add more helper func for debugging --- src/misc.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/misc.ts b/src/misc.ts index 0810195..3557647 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -268,3 +268,12 @@ export const getSplitRanges = (bytesTotal: number, bytesEachPart: number) => { } return res; }; + +/** + * https://stackoverflow.com/questions/332422 + * @param obj anything + * @returns string of the name of the object + */ +export const getTypeName = (obj: any) => { + return Object.prototype.toString.call(obj).slice(8, -1); +};