Skip to content

Commit daab3c5

Browse files
committed
simplify prop type warning formatting
1 parent e831412 commit daab3c5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/compiler/compile-props.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export function assertProp (prop, value, vm) {
303303
if (process.env.NODE_ENV !== 'production') {
304304
warn(
305305
'Invalid prop: type check failed for prop "' + prop.name + '".' +
306-
' Expected ' + formatTypes(expectedTypes) +
306+
' Expected ' + expectedTypes.map(formatType).join(', ') +
307307
', got ' + formatValue(value) + '.',
308308
vm
309309
)
@@ -370,13 +370,6 @@ function assertType (value, type) {
370370
}
371371
}
372372

373-
function formatTypes (types) {
374-
return types.reduce(
375-
(p, c, i) => { return i === 0 ? formatType(c) : `${p}, ${formatType(c)}` },
376-
''
377-
)
378-
}
379-
380373
function formatType (type) {
381374
return type
382375
? type.charAt(0).toUpperCase() + type.slice(1)

0 commit comments

Comments
 (0)