mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
upgrade to typescript@5.6 and cordis@3.18
This commit is contained in:
22 files changed
+52
-46
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user