Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I don't think this is right #107

Closed
bfrontend opened this issue Jul 12, 2022 · 3 comments
Closed

I don't think this is right #107

bfrontend opened this issue Jul 12, 2022 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@bfrontend
Copy link

我认为这个写的有问题 (in @/utils/is)

export function isObject(val: any): val is Record<any, any> {
  return val !== null && is(val, 'Object');
}
export function isPromise<T = any>(val: unknown): val is Promise<T> {
  return is(val, 'Promise') && isObject(val) && isFunction(val.then) && isFunction(val.catch);
}
@buqiyuan
Copy link
Owner

🤔can you give some examples?

@bfrontend
Copy link
Author

I think this is always false
is(val, 'Promise') && isObject(val)

@buqiyuan
Copy link
Owner

Thanks for pointing out, you are right!

@buqiyuan buqiyuan added bug Something isn't working good first issue Good for newcomers labels Jul 13, 2022
@buqiyuan buqiyuan closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants