ghtml 1.2.2 → 1.2.3

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/bench/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-unused-expressions */
2
- import { html } from "../src/html.js";
2
+ import { html } from "../src/index.js";
3
3
  import { Bench } from "tinybench";
4
4
  import { writeFileSync } from "node:fs";
5
5
  import { Buffer } from "node:buffer";
@@ -64,7 +64,7 @@ bench.add("Large strings", () => {
64
64
  });
65
65
 
66
66
  bench.add("High iteration count", () => {
67
- for (let i = 0; i < 1000; i++) {
67
+ for (let i = 0; i !== 1000; i++) {
68
68
  html`<span>${i}</span>`;
69
69
  }
70
70
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Replace your template engine with fast JavaScript by leveraging the power of tagged templates.",
4
4
  "author": "Gürgün Dayıoğlu",
5
5
  "license": "MIT",
6
- "version": "1.2.2",
6
+ "version": "1.2.3",
7
7
  "type": "module",
8
8
  "main": "./src/index.js",
9
9
  "exports": {
@@ -14,12 +14,13 @@
14
14
  "node": ">=18"
15
15
  },
16
16
  "scripts": {
17
- "test": "npm run lint && node --experimental-test-coverage test/index.js",
17
+ "test": "npm run lint && c8 --100 node --test test/**",
18
18
  "lint": "eslint . && prettier --check .",
19
19
  "lint:fix": "eslint --fix . && prettier --write ."
20
20
  },
21
21
  "devDependencies": {
22
22
  "@fastify/pre-commit": "^2.1.0",
23
+ "c8": "^9.1.0",
23
24
  "grules": "^0.15.0",
24
25
  "tinybench": "^2.6.0"
25
26
  },
package/src/html.js CHANGED
@@ -24,7 +24,7 @@ const html = ({ raw: literals }, ...expressions) => {
24
24
  let accumulator = "";
25
25
  let index = 0;
26
26
 
27
- for (; index < expressions.length; ++index) {
27
+ for (; index !== expressions.length; ++index) {
28
28
  let literal = literals[index];
29
29
  let expression =
30
30
  typeof expressions[index] === "string"
@@ -55,7 +55,7 @@ const html = ({ raw: literals }, ...expressions) => {
55
55
  const htmlGenerator = function* ({ raw: literals }, ...expressions) {
56
56
  let index = 0;
57
57
 
58
- for (; index < expressions.length; ++index) {
58
+ for (; index !== expressions.length; ++index) {
59
59
  let literal = literals[index];
60
60
  let expression;
61
61
 
package/test/index.js CHANGED
@@ -1,6 +1,6 @@
1
+ import { html, htmlGenerator } from "../src/index.js";
1
2
  import test from "node:test";
2
3
  import assert from "node:assert";
3
- import { html, htmlGenerator } from "../src/html.js";
4
4
 
5
5
  const conditionTrue = true;
6
6
  const conditionFalse = false;