mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
feat(dns): added support for a custom lookup function; (#5339)
This commit is contained in:
+15
-1
@@ -662,6 +662,15 @@ const toJSONObject = (obj) => {
|
||||
return visit(obj, 0);
|
||||
}
|
||||
|
||||
const [isPlainFunction, isAsyncFn, isGeneratorFn, isAsyncGeneratorFn] = (
|
||||
(...fns) => fns.map(
|
||||
({constructor})=> (thing) => thing && typeof thing === 'function' && thing.constructor === constructor
|
||||
)
|
||||
)(()=> {}, async()=>{}, function*(){}, async function*(){});
|
||||
|
||||
const isThenable = (thing) =>
|
||||
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
||||
|
||||
export default {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@@ -711,5 +720,10 @@ export default {
|
||||
ALPHABET,
|
||||
generateString,
|
||||
isSpecCompliantForm,
|
||||
toJSONObject
|
||||
toJSONObject,
|
||||
isAsyncFn,
|
||||
isGeneratorFn,
|
||||
isAsyncGeneratorFn,
|
||||
isPlainFunction,
|
||||
isThenable
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user