refactor: simplify conditional

This commit is contained in:
Evan You 2019-02-26 21:46:01 -05:00
parent e151d34100
commit 55a2bc483c

View File

@ -23,11 +23,9 @@ export function extractInitializers(
const props = instance.$props
for (let i = 0; i < keys.length; i++) {
const key = keys[i]
if (!isReservedKey(key)) {
if (!props.hasOwnProperty(key)) {
if (!isReservedKey(key) && !props.hasOwnProperty(key)) {
data[key] = (instance as any)[key]
}
}
}
return data
}