You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attached is a possible script implementation to check if a spool is actually a class. This helps pure JS users more than TS users, but, since it all runs in JavaScript at the end of the day, it makes sense to do an explicit check.
export default fn => {
if (typeof fn != "function") {
return false
}
let proxy = new Proxy(fn, {
construct: () => fn,
})
try {
new proxy
} catch {
return false
}
return true
}
Additionally, with babel constructing things down to es5 for browsers, it would be helpful to detect if the spool is es5 or es6 already.
The text was updated successfully, but these errors were encountered:
Attached is a possible script implementation to check if a spool is actually a class. This helps pure JS users more than TS users, but, since it all runs in JavaScript at the end of the day, it makes sense to do an explicit check.
Additionally, with babel constructing things down to es5 for browsers, it would be helpful to detect if the spool is es5 or es6 already.
The text was updated successfully, but these errors were encountered: