mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Replace some unnecessary String.prototype.search
usage
Most of the `String.prototype.search` call-sites found throughout the code-base is actually not necessary, since we usually only want a *boolean*, and those can be replaced with `RegExp.prototype.test` instead.
This commit is contained in:
parent
dc6c3eacbc
commit
bb75b36b77
2 changed files with 5 additions and 7 deletions
|
@ -3866,8 +3866,7 @@ class PartialEvaluator {
|
|||
// Simulating descriptor flags attribute
|
||||
const fontNameWoStyle = baseFontName.split("-")[0];
|
||||
return (
|
||||
fontNameWoStyle in getSerifFonts() ||
|
||||
fontNameWoStyle.search(/serif/gi) !== -1
|
||||
fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue