@mpxjs/api-proxy
Advanced tools
Comparing version 2.7.44 to 2.7.49
{ | ||
"name": "@mpxjs/api-proxy", | ||
"version": "2.7.44", | ||
"version": "2.7.49", | ||
"description": "convert miniprogram API at each end", | ||
@@ -42,3 +42,3 @@ "module": "src/index.js", | ||
}, | ||
"gitHead": "306aee23bc55c7f1af58b8de0c6e6394370c88d4" | ||
"gitHead": "d24eb21aeb7b11087d5aaaffb1047e7344bfe9cf" | ||
} |
@@ -41,3 +41,2 @@ import NodesRef from './NodesRef' | ||
let curComponent = document | ||
if (component && component.$el) { | ||
@@ -48,19 +47,25 @@ curComponent = component.$el | ||
} | ||
const selectSelf = | ||
curComponent === document | ||
? false | ||
: Array | ||
.from(curComponent.parentNode.querySelectorAll(selector)) | ||
.every(item => item === curComponent) | ||
if (single) { | ||
const el = selectSelf ? curComponent : curComponent.querySelector(selector) | ||
res.push(handleFields(fields, el, selector)) | ||
if (this._isEl(selector)) { | ||
if (single) { | ||
res.push(handleFields(fields, selector, null)) | ||
} else { | ||
res.push(selector.map(el => handleFields(fields, el, null))) | ||
} | ||
} else { | ||
const els = selectSelf | ||
? [curComponent] | ||
: curComponent.querySelectorAll(selector) | ||
const elsArr = Array.from(els).map(el => handleFields(fields, el, null)) | ||
res.push(elsArr) | ||
const selectSelf = | ||
curComponent === document | ||
? false | ||
: Array | ||
.from(curComponent.parentNode.querySelectorAll(selector)) | ||
.every(item => item === curComponent) | ||
if (single) { | ||
const el = selectSelf ? curComponent : curComponent.querySelector(selector) | ||
res.push(handleFields(fields, el, selector)) | ||
} else { | ||
const els = selectSelf | ||
? [curComponent] | ||
: curComponent.querySelectorAll(selector) | ||
const elsArr = Array.from(els).map(el => handleFields(fields, el, null)) | ||
res.push(elsArr) | ||
} | ||
} | ||
@@ -167,2 +172,6 @@ }) | ||
} | ||
_isEl (selector) { | ||
if (Array.isArray(selector)) return this._isEl(selector[0]) | ||
return selector && selector.nodeType === 1 | ||
} | ||
} | ||
@@ -169,0 +178,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120053
3145