Skip to content

Commit

Permalink
unpack for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Apr 5, 2024
1 parent cab68c5 commit 1d5a803
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint:fix": "eslint --fix . && prettier --write ."
},
"devDependencies": {
"grules": "^0.12.1"
"@fastify/pre-commit": "^2.1.0",
"grules": "^0.13.0"
},
"repository": {
"type": "git",
Expand Down
7 changes: 5 additions & 2 deletions src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ const escapeFunction = (key) => {
*/
const html = (literals, ...expressions) => {
let accumulator = "";
let index = 0;

for (let index = 0; index < expressions.length; ++index) {
while (index < expressions.length) {
let literal = literals.raw[index];
let expression =
typeof expressions[index] === "string"
Expand All @@ -41,9 +42,11 @@ const html = (literals, ...expressions) => {
}

accumulator += literal + expression;

++index;
}

accumulator += literals.raw[expressions.length];
accumulator += literals.raw[index];

return accumulator;
};
Expand Down
1 change: 1 addition & 0 deletions src/includeFile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { readFileSync } from "node:fs";

const readFileSyncOptions = { encoding: "utf8" };

const fileCache = new Map();

/**
Expand Down

0 comments on commit 1d5a803

Please sign in to comment.