upgrade to typescript@5.6 and cordis@3.18

This commit is contained in:
undefined committed 2024-10-02 08:33:52 +08:00
1 parent c3953a3ce7
commit 30e95b4511
22 files changed
+52 -46

No files matched your search

+2 -1
View File
@@ -69,7 +69,8 @@ String.prototype.format = function formatStr(...args) {
export function isClass(obj: any, strict = false): obj is new (...args: any) => any {
if (typeof obj !== 'function') return false;
if (obj.prototype === undefined) return false;
if (obj.prototype.constructor !== obj) return false;
// FIXME cordis proxies the object and make this assertion fail
// if (obj.prototype.constructor !== obj) return false;
if (Object.getOwnPropertyNames(obj.prototype).length >= 2) return true;
const str = obj.toString();
if (str.slice(0, 5) === 'class') return true;