@lowlighter/xml 5.4.14 β†’ 5.4.16

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/README.md CHANGED
@@ -6,6 +6,49 @@
6
6
  - [`πŸ¦• Playground`](https://libs.lecoq.io/xml)
7
7
  - [`πŸ“š Documentation`](https://jsr.io/@libs/xml/doc)
8
8
 
9
+ ## πŸ“‘ Examples
10
+
11
+ ### Parsing XML to objects
12
+
13
+ ```ts
14
+ import { parse } from "./parse.ts"
15
+
16
+ // Parse a string
17
+ console.log(parse(`
18
+ <?xml version="1.0"?>
19
+ <root>
20
+ <text>hello</text>
21
+ <array>world</array>
22
+ <array>monde</array>
23
+ <array>δΈ–η•Œ</array>
24
+ <array>🌏</array>
25
+ <complex attribute="value">content</complex>
26
+ </root>
27
+ `))
28
+
29
+ // Parse a file
30
+ using file = await Deno.open("bench/assets/small.xml")
31
+ console.log(parse(file))
32
+ ```
33
+
34
+ ### Stringifying objects to XML
35
+
36
+ ```ts
37
+ import { stringify } from "./stringify.ts"
38
+
39
+ console.log(stringify({
40
+ "@version": "1.0",
41
+ root: {
42
+ text: "hello",
43
+ array: ["world", "monde", "δΈ–η•Œ", "🌏"],
44
+ complex: {
45
+ "@attribute": "value",
46
+ "#text": "content",
47
+ },
48
+ },
49
+ }))
50
+ ```
51
+
9
52
  ## ✨ Features
10
53
 
11
54
  - Based on the [quick-xml](https://github.com/tafia/quick-xml) Rust package (compiled to WASM).
package/deno.jsonc CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "icon": "πŸ“ƒ",
3
3
  "name": "@libs/xml",
4
- "version": "5.4.14",
4
+ "version": "5.4.16",
5
5
  "description": "XML parser/stringifier with no dependencies.",
6
6
  "keywords": [
7
7
  "xml",
@@ -59,11 +59,13 @@
59
59
  "test": "deno test --allow-read --allow-env=CI --allow-write=bench --allow-run=deno,node,bun,npx --no-prompt --coverage --clean --trace-leaks --doc",
60
60
  "dev": "deno fmt && deno task test --filter='/^\\[deno\\]/' && deno coverage --exclude=.js --detailed && deno task lint",
61
61
  "bench": "deno bench --allow-read --allow-write=bench",
62
- "test:deno": "deno fmt --check && deno task test --filter='/^\\[deno\\]/' --quiet && deno coverage --exclude=.js && deno lint",
63
- "test:deno-future": "DENO_FUTURE=1 && deno task test:deno",
64
- "test:others": "deno fmt --check && deno task test --filter='/^\\[node|bun \\]/' --quiet && deno coverage --exclude=.js && deno lint",
62
+ "test:deno": "deno task clean:deno && deno fmt --check && deno task test --filter='/^\\[deno\\]/' --quiet && deno coverage --exclude=.js && deno lint",
63
+ "test:deno-future": "deno task clean:deno && DENO_FUTURE=1 && deno task test:deno",
64
+ "test:others": "deno task clean:others && deno fmt --check && deno task test --filter='/^\\[node|bun \\]/' --quiet && deno coverage --exclude=.js && deno lint",
65
65
  "coverage:html": "deno task test --filter='/^\\[deno\\]/' --quiet && deno coverage --exclude=.js --html && sleep 1",
66
- "lint": "deno fmt --check && deno lint && deno doc --lint mod.ts && deno publish --dry-run --quiet --allow-dirty"
66
+ "lint": "deno fmt --check && deno lint && deno doc --lint mod.ts && deno publish --dry-run --quiet --allow-dirty",
67
+ "clean:deno": "rm -rf node_modules .npmrc deno.lock",
68
+ "clean:others": "rm -rf node_modules .npmrc deno.lock package.json package-lock.json bun.lockb"
67
69
  },
68
70
  "lint": {
69
71
  "rules": {
package/deno.lock CHANGED
@@ -2,27 +2,27 @@
2
2
  "version": "3",
3
3
  "packages": {
4
4
  "specifiers": {
5
- "jsr:@libs/logger@2": "jsr:@libs/logger@2.1.1",
6
- "jsr:@libs/run@2": "jsr:@libs/run@2.0.2",
5
+ "jsr:@libs/logger@2": "jsr:@libs/logger@2.1.2",
6
+ "jsr:@libs/run@2": "jsr:@libs/run@2.0.3",
7
7
  "jsr:@libs/testing@2": "jsr:@libs/testing@2.2.4",
8
8
  "jsr:@libs/typing@2": "jsr:@libs/typing@2.8.2",
9
- "jsr:@std/assert@1": "jsr:@std/assert@1.0.2",
10
- "jsr:@std/assert@^1.0.1": "jsr:@std/assert@1.0.2",
11
- "jsr:@std/async@1": "jsr:@std/async@1.0.3",
12
- "jsr:@std/bytes@^1.0.2-rc.3": "jsr:@std/bytes@1.0.2",
13
- "jsr:@std/expect@1": "jsr:@std/expect@1.0.0",
14
- "jsr:@std/fs@1": "jsr:@std/fs@1.0.1",
15
- "jsr:@std/http@1": "jsr:@std/http@1.0.3",
16
- "jsr:@std/internal@^1.0.1": "jsr:@std/internal@1.0.1",
17
- "jsr:@std/path@1": "jsr:@std/path@1.0.2",
18
- "jsr:@std/streams@1": "jsr:@std/streams@1.0.2"
9
+ "jsr:@std/assert@1": "jsr:@std/assert@1.0.3",
10
+ "jsr:@std/assert@^1.0.3": "jsr:@std/assert@1.0.3",
11
+ "jsr:@std/async@1": "jsr:@std/async@1.0.4",
12
+ "jsr:@std/bytes@^1.0.2": "jsr:@std/bytes@1.0.2",
13
+ "jsr:@std/expect@1": "jsr:@std/expect@1.0.1",
14
+ "jsr:@std/fs@1": "jsr:@std/fs@1.0.2",
15
+ "jsr:@std/http@1": "jsr:@std/http@1.0.4",
16
+ "jsr:@std/internal@^1.0.2": "jsr:@std/internal@1.0.2",
17
+ "jsr:@std/path@1": "jsr:@std/path@1.0.3",
18
+ "jsr:@std/streams@1": "jsr:@std/streams@1.0.3"
19
19
  },
20
20
  "jsr": {
21
- "@libs/logger@2.1.1": {
22
- "integrity": "508216c245aa7a13d55972cec6cf2ff45b341469334634a2748cd60c938677d6"
21
+ "@libs/logger@2.1.2": {
22
+ "integrity": "2a5f4b148fd8d6b1221ff89cff73367ca0511137f4d6548c532b6e220ed22bcc"
23
23
  },
24
- "@libs/run@2.0.2": {
25
- "integrity": "6a1ce6a5d0e162caf608918f11d1d2a79040ac90bbc0789af85d8911e356965c",
24
+ "@libs/run@2.0.3": {
25
+ "integrity": "77fe95cbfdc6c0855ab1bc5fb008ad4e37c6da848fd20ed8e88d98c3cf51eccb",
26
26
  "dependencies": [
27
27
  "jsr:@libs/logger@2",
28
28
  "jsr:@libs/typing@2",
@@ -43,41 +43,41 @@
43
43
  "@libs/typing@2.8.2": {
44
44
  "integrity": "c53f8aad9b01621de893aeac5d6cd592ec2ce783f8e89b677dcd81490a3be0a0"
45
45
  },
46
- "@std/assert@1.0.2": {
47
- "integrity": "ccacec332958126deaceb5c63ff8b4eaf9f5ed0eac9feccf124110435e59e49c",
46
+ "@std/assert@1.0.3": {
47
+ "integrity": "b0d03ce1ced880df67132eea140623010d415848df66f6aa5df76507ca7c26d8",
48
48
  "dependencies": [
49
- "jsr:@std/internal@^1.0.1"
49
+ "jsr:@std/internal@^1.0.2"
50
50
  ]
51
51
  },
52
- "@std/async@1.0.3": {
53
- "integrity": "6ed64678db43451683c6c176a21426a2ccd21ba0269ebb2c36133ede3f165792"
52
+ "@std/async@1.0.4": {
53
+ "integrity": "373f5168a01b46ecaabc785d4e0f9ef18a010ab867af069fb905d93a9129ae5b"
54
54
  },
55
55
  "@std/bytes@1.0.2": {
56
56
  "integrity": "fbdee322bbd8c599a6af186a1603b3355e59a5fb1baa139f8f4c3c9a1b3e3d57"
57
57
  },
58
- "@std/expect@1.0.0": {
59
- "integrity": "030275683c23d6708878c5439a3ffd99285948d708e00835fd38fcef9a0bb921",
58
+ "@std/expect@1.0.1": {
59
+ "integrity": "44075d9c2cb701ddfc4d5a260da2fb26ba3cfd94c45d3a0359f63cabbf85a058",
60
60
  "dependencies": [
61
- "jsr:@std/assert@^1.0.1",
62
- "jsr:@std/internal@^1.0.1"
61
+ "jsr:@std/assert@^1.0.3",
62
+ "jsr:@std/internal@^1.0.2"
63
63
  ]
64
64
  },
65
- "@std/fs@1.0.1": {
66
- "integrity": "d6914ca2c21abe591f733b31dbe6331e446815e513e2451b3b9e472daddfefcb"
65
+ "@std/fs@1.0.2": {
66
+ "integrity": "af57555c7a224a6f147d5cced5404692974f7a628ced8eda67e0d22d92d474ec"
67
67
  },
68
- "@std/http@1.0.3": {
69
- "integrity": "bff3770c4df4711567de1711fe988d28db9535be0c9b0f1d2de8d0fb97e8b44c"
68
+ "@std/http@1.0.4": {
69
+ "integrity": "1a8142217907d49c4687f90ef3d257e7df2baf344c5122c322d7316df09df453"
70
70
  },
71
- "@std/internal@1.0.1": {
72
- "integrity": "6f8c7544d06a11dd256c8d6ba54b11ed870aac6c5aeafff499892662c57673e6"
71
+ "@std/internal@1.0.2": {
72
+ "integrity": "f4cabe2021352e8bfc24e6569700df87bf070914fc38d4b23eddd20108ac4495"
73
73
  },
74
- "@std/path@1.0.2": {
75
- "integrity": "a452174603f8c620bd278a380c596437a9eef50c891c64b85812f735245d9ec7"
74
+ "@std/path@1.0.3": {
75
+ "integrity": "cd89d014ce7eb3742f2147b990f6753ee51d95276bfc211bc50c860c1bc7df6f"
76
76
  },
77
- "@std/streams@1.0.2": {
78
- "integrity": "187c3c875675221f5355807a735e51b0f8769caade2cbca6d7f4fa710ea4ace4",
77
+ "@std/streams@1.0.3": {
78
+ "integrity": "d62e645ab981cee2c3d03040eb03cf387fc6bceef6d4564f3ed485a43741a81f",
79
79
  "dependencies": [
80
- "jsr:@std/bytes@^1.0.2-rc.3"
80
+ "jsr:@std/bytes@^1.0.2"
81
81
  ]
82
82
  }
83
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowlighter/xml",
3
- "version": "5.4.14",
3
+ "version": "5.4.16",
4
4
  "type": "module",
5
5
  "scripts": {},
6
6
  "dependencies": {},