node-poppler 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +10 -5
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -50,12 +50,17 @@ function parseOptions(acceptedOptions, options, version) {
|
|
|
50
50
|
const args = [];
|
|
51
51
|
/** @type {string[]} */
|
|
52
52
|
const invalidArgs = [];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Imperative loops are faster than functional loops.
|
|
55
|
+
* @see {@link https://romgrk.com/posts/optimizing-javascript#3-avoid-arrayobject-methods || Optimizing JavaScript}
|
|
56
|
+
*/
|
|
57
|
+
const entries = Object.entries(options);
|
|
58
|
+
const entriesLength = entries.length;
|
|
59
|
+
for (let i = 0; i < entriesLength; i += 1) {
|
|
60
|
+
// Destructuring adds overhead, so use index access
|
|
61
|
+
const key = entries[i][0];
|
|
57
62
|
if (Object.hasOwn(acceptedOptions, key)) {
|
|
58
|
-
const option =
|
|
63
|
+
const option = entries[i][1];
|
|
59
64
|
const acceptedOption = acceptedOptions[key];
|
|
60
65
|
|
|
61
66
|
// eslint-disable-next-line valid-typeof -- `type` is a string
|