fix: ignore prototype's keys in a handful of for...in loops
This commit is contained in:
@@ -57,6 +57,9 @@ export class Col extends React.Component {
|
|||||||
let classesAr = []
|
let classesAr = []
|
||||||
|
|
||||||
for (let device in DEVICES) {
|
for (let device in DEVICES) {
|
||||||
|
if (!DEVICES.hasOwnProperty(device)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
let deviceClass = DEVICES[device]
|
let deviceClass = DEVICES[device]
|
||||||
if(device in this.props) {
|
if(device in this.props) {
|
||||||
let val = this.props[device]
|
let val = this.props[device]
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ export const sampleXmlFromSchema = (schema, config={}) => {
|
|||||||
example = example || {}
|
example = example || {}
|
||||||
|
|
||||||
for (let propName in props) {
|
for (let propName in props) {
|
||||||
|
if (!props.hasOwnProperty(propName)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if ( props[propName].readOnly && !includeReadOnly ) {
|
if ( props[propName].readOnly && !includeReadOnly ) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -607,6 +607,9 @@ export const parseSearch = () => {
|
|||||||
let params = search.substr(1).split("&")
|
let params = search.substr(1).split("&")
|
||||||
|
|
||||||
for (let i in params) {
|
for (let i in params) {
|
||||||
|
if (!params.hasOwnProperty(i)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
i = params[i].split("=")
|
i = params[i].split("=")
|
||||||
map[decodeURIComponent(i[0])] = decodeURIComponent(i[1])
|
map[decodeURIComponent(i[0])] = decodeURIComponent(i[1])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user