fix: simplify check hasFunction (#11490)

This commit is contained in:
Mikhail
2023-09-11 09:31:29 +03:00
committed by GitHub
parent e74ee7b75b
commit ca77bed318

View File

@@ -400,7 +400,7 @@ function getResolver(resolverCache, scopes, prefixes) {
}
const hasFunction = value => isObject(value)
&& Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);
&& Object.getOwnPropertyNames(value).some((key) => isFunction(value[key]));
function needContext(proxy, names) {
const {isScriptable, isIndexable} = _descriptors(proxy);