use template strings instead of concatenations
This commit is contained in:
parent
288f49eee5
commit
fd94b16cf5
1 changed files with 2 additions and 10 deletions
|
|
@ -456,22 +456,14 @@ export /* exported for testing */ function getExtraOptions(
|
||||||
}
|
}
|
||||||
if (!Array.isArray(options)) {
|
if (!Array.isArray(options)) {
|
||||||
const msg =
|
const msg =
|
||||||
'The extra options for `' +
|
`The extra options for '${pathInfo.join('.')}' ('${JSON.stringify(options)}') are not in an array.`;
|
||||||
pathInfo.join('.') +
|
|
||||||
'` (`' +
|
|
||||||
JSON.stringify(options) +
|
|
||||||
'`) are not in an array.';
|
|
||||||
throw new Error(msg);
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
return options.map(o => {
|
return options.map(o => {
|
||||||
const t = typeof o;
|
const t = typeof o;
|
||||||
if (t !== 'string' && t !== 'number' && t !== 'boolean') {
|
if (t !== 'string' && t !== 'number' && t !== 'boolean') {
|
||||||
const msg =
|
const msg =
|
||||||
'The extra option for `' +
|
`The extra option for '${pathInfo.join('.')}' ('${JSON.stringify(o)}') is not a primitive value.`;
|
||||||
pathInfo.join('.') +
|
|
||||||
'` (`' +
|
|
||||||
JSON.stringify(o) +
|
|
||||||
'`) is not a primitive value.';
|
|
||||||
throw new Error(msg);
|
throw new Error(msg);
|
||||||
}
|
}
|
||||||
return o + '';
|
return o + '';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue