add License

pull/8162/head
Yuichiro Yamashita 4 years ago
parent 5752bbf2ca
commit 6be58b3107

@ -10,6 +10,8 @@ export function assign<T, S>(tar: T, src: S): T & S {
return tar as T & S;
}
// Adapted from https://github.com/then/is-promise/blob/master/index.js
// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE
export function is_promise<T = any>(value: any): value is PromiseLike<T> {
return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';
}

Loading…
Cancel
Save