@prairielearn/html 3.0.2 → 3.0.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/CHANGELOG.md +6 -0
- package/package.json +3 -3
- package/src/index.test.ts +3 -3
- package/src/index.ts +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prairielearn/html",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"repository": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@prairielearn/tsconfig": "^0.0.0",
|
|
18
|
-
"@types/node": "^18.16.
|
|
18
|
+
"@types/node": "^18.16.19",
|
|
19
19
|
"mocha": "^10.2.0",
|
|
20
20
|
"ts-node": "^10.9.1",
|
|
21
|
-
"typescript": "^5.1.
|
|
21
|
+
"typescript": "^5.1.6"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/src/index.test.ts
CHANGED
|
@@ -29,7 +29,7 @@ describe('html', () => {
|
|
|
29
29
|
assert.equal(
|
|
30
30
|
// prettier-ignore
|
|
31
31
|
html`<ul>${arr}</ul>`.toString(),
|
|
32
|
-
'<ul>cats><dogs</ul>'
|
|
32
|
+
'<ul>cats><dogs</ul>',
|
|
33
33
|
);
|
|
34
34
|
});
|
|
35
35
|
|
|
@@ -38,7 +38,7 @@ describe('html', () => {
|
|
|
38
38
|
assert.equal(
|
|
39
39
|
// prettier-ignore
|
|
40
40
|
html`<ul>${arr.map((e) => html`<li>${e}</li>`)}</ul>`.toString(),
|
|
41
|
-
'<ul><li>cats</li><li>dogs</li></ul>'
|
|
41
|
+
'<ul><li>cats</li><li>dogs</li></ul>',
|
|
42
42
|
);
|
|
43
43
|
});
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ describe('html', () => {
|
|
|
46
46
|
assert.throws(
|
|
47
47
|
// @ts-expect-error -- Testing runtime behavior of bad input.
|
|
48
48
|
() => html`<p>${{ foo: 'bar' }}</p>`.toString(),
|
|
49
|
-
'Cannot interpolate object in template'
|
|
49
|
+
'Cannot interpolate object in template',
|
|
50
50
|
);
|
|
51
51
|
});
|
|
52
52
|
|
package/src/index.ts
CHANGED
|
@@ -39,7 +39,7 @@ function escapeValue(value: unknown): string {
|
|
|
39
39
|
} else {
|
|
40
40
|
// There shouldn't be any other types
|
|
41
41
|
throw new Error(
|
|
42
|
-
`Unexpected type in template: ${typeof value} for value ${JSON.stringify(value)}
|
|
42
|
+
`Unexpected type in template: ${typeof value} for value ${JSON.stringify(value)}`,
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
}
|