Update utils.js
This commit is contained in:
parent
62a3212629
commit
5de617dfe2
1 changed files with 3 additions and 6 deletions
|
@ -223,10 +223,7 @@ async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) {
|
|||
}
|
||||
|
||||
if (!/^\d+-\d+$/.test(sRange)) {
|
||||
console.error(
|
||||
'ERROR: Invalid range: %s',
|
||||
sanitizedRange.replace(/\n|\r/g, ''),
|
||||
);
|
||||
console.error('ERROR: Invalid range: %s', sRange);
|
||||
throw new Error('Invalid range');
|
||||
}
|
||||
|
||||
|
@ -242,7 +239,7 @@ async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) {
|
|||
} catch (err) {
|
||||
console.error(
|
||||
'ERROR: Font not found: %s, Error: %s',
|
||||
filename.replace(/\n|\r/g, ''),
|
||||
filename,
|
||||
String(err),
|
||||
);
|
||||
if (fallbacks && Object.keys(fallbacks).length) {
|
||||
|
@ -262,7 +259,7 @@ async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) {
|
|||
console.error(
|
||||
`ERROR: Trying to use %s as a fallback for: %s`,
|
||||
fallbackName,
|
||||
sanitizedName,
|
||||
sFontStack,
|
||||
);
|
||||
delete fallbacks[fallbackName];
|
||||
return getFontPbf(null, fontPath, fallbackName, range, fallbacks);
|
||||
|
|
Loading…
Reference in a new issue