Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide character metrics console warnings on production - fixes #3853 #3854

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/buildCommon.js
Expand Up @@ -71,9 +71,13 @@
value, metrics.height, metrics.depth, italic, metrics.skew,
metrics.width, classes);
} else {
// TODO(emily): Figure out a good way to only print this in development
typeof console !== "undefined" && console.warn("No character metrics " +
const nodeEnv = typeof process !== 'undefined' && process.env.NODE_ENV

Check failure on line 74 in src/buildCommon.js

View workflow job for this annotation

GitHub Actions / test

'process' is not defined

Check failure on line 74 in src/buildCommon.js

View workflow job for this annotation

GitHub Actions / test

Missing semicolon
const isProduction = nodeEnv === 'production'

Check failure on line 75 in src/buildCommon.js

View workflow job for this annotation

GitHub Actions / test

Missing semicolon
const showCharacterMetricsWarning = !isProduction && typeof console !== 'undefined'

Check failure on line 76 in src/buildCommon.js

View workflow job for this annotation

GitHub Actions / test

This line has a length of 91. Maximum allowed is 84

Check failure on line 76 in src/buildCommon.js

View workflow job for this annotation

GitHub Actions / test

Missing semicolon
if (showCharacterMetricsWarning) {
console.warn("No character metrics " +
`for '${value}' in style '${fontName}' and mode '${mode}'`);
}
symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);
}

Expand Down