@weborigami/language 0.3.3-jse.3 → 0.3.4-jse.4

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.
@@ -54,11 +54,11 @@ describe("expressionObject", () => {
54
54
  test("returned object values can be unpacked", async () => {
55
55
  const entries = [["data.json", `{ "a": 1 }`]];
56
56
  const parent = new ObjectTree({});
57
- parent.handlers = new ObjectTree({
57
+ parent.handlers = {
58
58
  "json.handler": {
59
59
  unpack: JSON.parse,
60
60
  },
61
- });
61
+ };
62
62
  const result = await expressionObject(entries, parent);
63
63
  const dataJson = await result["data.json"];
64
64
  const json = await dataJson.unpack();
@@ -3,11 +3,11 @@ import assert from "node:assert";
3
3
  import { describe, test } from "node:test";
4
4
  import { handleExtension } from "../../src/runtime/handlers.js";
5
5
 
6
- const handlers = new ObjectTree({
6
+ const handlers = {
7
7
  "json.handler": {
8
8
  unpack: (buffer) => JSON.parse(String(buffer)),
9
9
  },
10
- });
10
+ };
11
11
 
12
12
  describe("handlers", () => {
13
13
  test("attaches an unpack method to a value with an extension", async () => {
@@ -1,13 +0,0 @@
1
- /**
2
- * Concatenate the strings with a standard tagged template function that works
3
- * just like normal JavaScript templates. This is: a) synchronous, b) does not
4
- * convert treelike objects to strings.
5
- */
6
- export default function standardTemplate(strings, ...values) {
7
- let result = strings[0];
8
- for (let i = 0; i < values.length; i++) {
9
- result += values[i];
10
- result += strings[i + 1];
11
- }
12
- return result;
13
- }
@@ -1,18 +0,0 @@
1
- import assert from "node:assert";
2
- import { describe, test } from "node:test";
3
- import templateText from "../../src/runtime/templateStandard.js";
4
-
5
- describe("templateText", () => {
6
- test("joins strings and values together like JavaScript", async () => {
7
- const a = 1;
8
- const b = 2;
9
- const result = await templateText`-${a} ${b}-`;
10
- assert.equal(result, "-1 2-");
11
- });
12
-
13
- test("renders an object like JavaScript", async () => {
14
- const object = { a: 1 };
15
- const result = await templateText`-${object}-`;
16
- assert.equal(result, "-[object Object]-");
17
- });
18
- });