We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8df618 commit 2e50acfCopy full SHA for 2e50acf
packages/runtime-core/src/componentProps.ts
@@ -456,11 +456,7 @@ function getTypeIndex(
456
expectedTypes: PropType<any> | void | null | true
457
): number {
458
if (isArray(expectedTypes)) {
459
- for (let i = 0, len = expectedTypes.length; i < len; i++) {
460
- if (isSameType(expectedTypes[i], type)) {
461
- return i
462
- }
463
+ return expectedTypes.findIndex(t => isSameType(t, type))
464
} else if (isFunction(expectedTypes)) {
465
return isSameType(expectedTypes, type) ? 0 : -1
466
}
0 commit comments