cborg 1.6.2 → 1.7.0
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 +107 -11
- package/cjs/browser-test/node-test-bin.js +171 -117
- package/cjs/lib/bin.js +39 -23
- package/cjs/lib/diagnostic.js +40 -3
- package/cjs/node-test/node-test-bin.js +171 -117
- package/esm/browser-test/node-test-bin.js +171 -117
- package/esm/lib/bin.js +43 -24
- package/esm/lib/diagnostic.js +45 -5
- package/esm/node-test/node-test-bin.js +171 -117
- package/lib/bin.js +52 -27
- package/lib/diagnostic.js +54 -5
- package/package.json +1 -1
- package/test/node-test-bin.js +209 -138
- package/types/lib/diagnostic.d.ts +6 -0
- package/types/lib/diagnostic.d.ts.map +1 -1
package/test/node-test-bin.js
CHANGED
|
@@ -4,12 +4,63 @@ import chai from 'chai'
|
|
|
4
4
|
import { exec } from 'child_process'
|
|
5
5
|
import process from 'process'
|
|
6
6
|
import path from 'path'
|
|
7
|
+
import { platform } from 'os'
|
|
7
8
|
import { fileURLToPath } from 'url'
|
|
8
9
|
// included here for ipjs compile tree
|
|
9
10
|
import bin from '../lib/bin.js' // eslint-disable-line
|
|
10
11
|
|
|
11
12
|
const { assert } = chai
|
|
12
13
|
|
|
14
|
+
const fixture1JsonString = '{"a":1,"b":[2,3],"smile":"😀"}'
|
|
15
|
+
const fixture1JsonPrettyString =
|
|
16
|
+
`{
|
|
17
|
+
"a": 1,
|
|
18
|
+
"b": [
|
|
19
|
+
2,
|
|
20
|
+
3
|
|
21
|
+
],
|
|
22
|
+
"smile": "😀"
|
|
23
|
+
}
|
|
24
|
+
`
|
|
25
|
+
const fixture1HexString = 'a3616101616282020365736d696c6564f09f9880'
|
|
26
|
+
const fixture1Bin = fromHex(fixture1HexString)
|
|
27
|
+
const fixture1BinString = new TextDecoder().decode(fixture1Bin)
|
|
28
|
+
const fixture1DiagnosticString =
|
|
29
|
+
`a3 # map(3)
|
|
30
|
+
61 # string(1)
|
|
31
|
+
61 # "a"
|
|
32
|
+
01 # uint(1)
|
|
33
|
+
61 # string(1)
|
|
34
|
+
62 # "b"
|
|
35
|
+
82 # array(2)
|
|
36
|
+
02 # uint(2)
|
|
37
|
+
03 # uint(3)
|
|
38
|
+
65 # string(5)
|
|
39
|
+
736d696c65 # "smile"
|
|
40
|
+
64 # string(2)
|
|
41
|
+
f09f9880 # "😀"
|
|
42
|
+
`
|
|
43
|
+
const fixture2HexString = 'a4616101616282020363627566440102036165736d696c6564f09f9880'
|
|
44
|
+
const fixture2DiagnosticString =
|
|
45
|
+
`a4 # map(4)
|
|
46
|
+
61 # string(1)
|
|
47
|
+
61 # "a"
|
|
48
|
+
01 # uint(1)
|
|
49
|
+
61 # string(1)
|
|
50
|
+
62 # "b"
|
|
51
|
+
82 # array(2)
|
|
52
|
+
02 # uint(2)
|
|
53
|
+
03 # uint(3)
|
|
54
|
+
63 # string(3)
|
|
55
|
+
627566 # "buf"
|
|
56
|
+
44 # bytes(4)
|
|
57
|
+
01020361 # "\\x01\\x02\\x03a"
|
|
58
|
+
65 # string(5)
|
|
59
|
+
736d696c65 # "smile"
|
|
60
|
+
64 # string(2)
|
|
61
|
+
f09f9880 # "😀"
|
|
62
|
+
`
|
|
63
|
+
|
|
13
64
|
const binPath = path.join(path.dirname(fileURLToPath(import.meta.url)), '../lib/bin.js')
|
|
14
65
|
|
|
15
66
|
function fromHex (hex) {
|
|
@@ -48,15 +99,18 @@ describe('Bin', () => {
|
|
|
48
99
|
assert.strictEqual(e.stderr,
|
|
49
100
|
`Usage: cborg <command> <args>
|
|
50
101
|
Valid commands:
|
|
51
|
-
\thex2diag [hex input]
|
|
52
|
-
\thex2bin [hex input]
|
|
53
|
-
\thex2json [--pretty] [hex input]
|
|
54
|
-
\tbin2hex [binary input]
|
|
55
102
|
\tbin2diag [binary input]
|
|
103
|
+
\tbin2hex [binary input]
|
|
56
104
|
\tbin2json [--pretty] [binary input]
|
|
57
|
-
\
|
|
58
|
-
\
|
|
105
|
+
\tdiag2bin [diagnostic input]
|
|
106
|
+
\tdiag2hex [diagnostic input]
|
|
107
|
+
\tdiag2json [--pretty] [diagnostic input]
|
|
108
|
+
\thex2bin [hex input]
|
|
109
|
+
\thex2diag [hex input]
|
|
110
|
+
\thex2json [--pretty] [hex input]
|
|
59
111
|
\tjson2bin '[json input]'
|
|
112
|
+
\tjson2diag '[json input]'
|
|
113
|
+
\tjson2hex '[json input]'
|
|
60
114
|
Input may either be supplied as an argument or piped via stdin
|
|
61
115
|
`)
|
|
62
116
|
}
|
|
@@ -72,15 +126,18 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
72
126
|
`Unknown command: 'blip'
|
|
73
127
|
Usage: cborg <command> <args>
|
|
74
128
|
Valid commands:
|
|
75
|
-
\thex2diag [hex input]
|
|
76
|
-
\thex2bin [hex input]
|
|
77
|
-
\thex2json [--pretty] [hex input]
|
|
78
|
-
\tbin2hex [binary input]
|
|
79
129
|
\tbin2diag [binary input]
|
|
130
|
+
\tbin2hex [binary input]
|
|
80
131
|
\tbin2json [--pretty] [binary input]
|
|
81
|
-
\
|
|
82
|
-
\
|
|
132
|
+
\tdiag2bin [diagnostic input]
|
|
133
|
+
\tdiag2hex [diagnostic input]
|
|
134
|
+
\tdiag2json [--pretty] [diagnostic input]
|
|
135
|
+
\thex2bin [hex input]
|
|
136
|
+
\thex2diag [hex input]
|
|
137
|
+
\thex2json [--pretty] [hex input]
|
|
83
138
|
\tjson2bin '[json input]'
|
|
139
|
+
\tjson2diag '[json input]'
|
|
140
|
+
\tjson2hex '[json input]'
|
|
84
141
|
Input may either be supplied as an argument or piped via stdin
|
|
85
142
|
`)
|
|
86
143
|
}
|
|
@@ -92,164 +149,137 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
92
149
|
assert.strictEqual(stderr,
|
|
93
150
|
`Usage: cborg <command> <args>
|
|
94
151
|
Valid commands:
|
|
95
|
-
\thex2diag [hex input]
|
|
96
|
-
\thex2bin [hex input]
|
|
97
|
-
\thex2json [--pretty] [hex input]
|
|
98
|
-
\tbin2hex [binary input]
|
|
99
152
|
\tbin2diag [binary input]
|
|
153
|
+
\tbin2hex [binary input]
|
|
100
154
|
\tbin2json [--pretty] [binary input]
|
|
101
|
-
\
|
|
102
|
-
\
|
|
155
|
+
\tdiag2bin [diagnostic input]
|
|
156
|
+
\tdiag2hex [diagnostic input]
|
|
157
|
+
\tdiag2json [--pretty] [diagnostic input]
|
|
158
|
+
\thex2bin [hex input]
|
|
159
|
+
\thex2diag [hex input]
|
|
160
|
+
\thex2json [--pretty] [hex input]
|
|
103
161
|
\tjson2bin '[json input]'
|
|
162
|
+
\tjson2diag '[json input]'
|
|
163
|
+
\tjson2hex '[json input]'
|
|
104
164
|
Input may either be supplied as an argument or piped via stdin
|
|
105
165
|
`)
|
|
106
166
|
})
|
|
107
167
|
|
|
168
|
+
it('bin2diag (stdin)', async () => {
|
|
169
|
+
const { stdout, stderr } = await execBin('bin2diag', fixture1Bin)
|
|
170
|
+
assert.strictEqual(stderr, '')
|
|
171
|
+
assert.strictEqual(stdout, fixture1DiagnosticString)
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it('bin2hex (stdin)', async () => {
|
|
175
|
+
const { stdout, stderr } = await execBin('bin2hex', fixture1Bin)
|
|
176
|
+
assert.strictEqual(stderr, '')
|
|
177
|
+
assert.strictEqual(stdout, `${fixture1HexString}\n`)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it('bin2json (stdin)', async () => {
|
|
181
|
+
const { stdout, stderr } = await execBin('bin2json', fixture1Bin)
|
|
182
|
+
assert.strictEqual(stderr, '')
|
|
183
|
+
assert.strictEqual(stdout, `${fixture1JsonString}\n`)
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
it('bin2json pretty (stdin)', async () => {
|
|
187
|
+
const { stdout, stderr } = await execBin('bin2json --pretty', fixture1Bin)
|
|
188
|
+
assert.strictEqual(stderr, '')
|
|
189
|
+
assert.strictEqual(stdout, fixture1JsonPrettyString)
|
|
190
|
+
})
|
|
191
|
+
|
|
108
192
|
for (const stdin of [true, false]) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
193
|
+
if (platform() !== 'win32' || stdin) { // multiline CLI input is hard (impossible?) on Windows
|
|
194
|
+
it(`diag2bin${stdin ? ' (stdin)' : ''}`, async () => {
|
|
195
|
+
const { stdout, stderr } = !stdin
|
|
196
|
+
? await execBin(`diag2bin '${fixture1DiagnosticString}'`)
|
|
197
|
+
: await execBin('diag2bin', fixture1DiagnosticString)
|
|
198
|
+
assert.strictEqual(stderr, '')
|
|
199
|
+
assert.strictEqual(stdout, fixture1BinString)
|
|
200
|
+
})
|
|
116
201
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
202
|
+
it(`diag2hex${stdin ? ' (stdin)' : ''}`, async () => {
|
|
203
|
+
const { stdout, stderr } = !stdin
|
|
204
|
+
? await execBin(`diag2hex '${fixture1DiagnosticString}'`)
|
|
205
|
+
: await execBin('diag2hex', fixture1DiagnosticString)
|
|
206
|
+
assert.strictEqual(stderr, '')
|
|
207
|
+
assert.strictEqual(stdout, `${fixture1HexString}\n`)
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
it(`diag2json${stdin ? ' (stdin)' : ''}`, async () => {
|
|
211
|
+
const { stdout, stderr } = !stdin
|
|
212
|
+
? await execBin(`diag2json '${fixture1DiagnosticString}'`)
|
|
213
|
+
: await execBin('diag2json', fixture1DiagnosticString)
|
|
214
|
+
assert.strictEqual(stderr, '')
|
|
215
|
+
assert.strictEqual(stdout, `${fixture1JsonString}\n`)
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
it(`diag2json pretty${stdin ? ' (stdin)' : ''}`, async () => {
|
|
219
|
+
const { stdout, stderr } = !stdin
|
|
220
|
+
? await execBin(`diag2json --pretty '${fixture1DiagnosticString}'`)
|
|
221
|
+
: await execBin('diag2json --pretty', fixture1DiagnosticString)
|
|
222
|
+
assert.strictEqual(stderr, '')
|
|
223
|
+
assert.strictEqual(stdout, fixture1JsonPrettyString)
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
it(`hex2bin${stdin ? ' (stdin)' : ''}`, async () => {
|
|
228
|
+
const { stdout, stderr } = !stdin
|
|
229
|
+
? await execBin(`hex2bin ${fixture1HexString}`)
|
|
230
|
+
: await execBin('hex2bin', fixture1HexString)
|
|
121
231
|
assert.strictEqual(stderr, '')
|
|
122
|
-
assert.strictEqual(stdout,
|
|
123
|
-
`{
|
|
124
|
-
"a": 1,
|
|
125
|
-
"b": [
|
|
126
|
-
2,
|
|
127
|
-
3
|
|
128
|
-
],
|
|
129
|
-
"smile": "😀"
|
|
130
|
-
}
|
|
131
|
-
`)
|
|
232
|
+
assert.strictEqual(stdout, fixture1BinString)
|
|
132
233
|
})
|
|
133
234
|
|
|
134
235
|
it(`hex2diag${stdin ? ' (stdin)' : ''}`, async () => {
|
|
135
|
-
const { stdout, stderr } = stdin
|
|
136
|
-
? await execBin(
|
|
137
|
-
: await execBin('hex2diag',
|
|
236
|
+
const { stdout, stderr } = !stdin
|
|
237
|
+
? await execBin(`hex2diag ${fixture2HexString}`)
|
|
238
|
+
: await execBin('hex2diag', fixture2HexString)
|
|
138
239
|
assert.strictEqual(stderr, '')
|
|
139
|
-
assert.strictEqual(stdout,
|
|
140
|
-
`a4 # map(4)
|
|
141
|
-
61 # string(1)
|
|
142
|
-
61 # "a"
|
|
143
|
-
01 # uint(1)
|
|
144
|
-
61 # string(1)
|
|
145
|
-
62 # "b"
|
|
146
|
-
82 # array(2)
|
|
147
|
-
02 # uint(2)
|
|
148
|
-
03 # uint(3)
|
|
149
|
-
63 # string(3)
|
|
150
|
-
627566 # "buf"
|
|
151
|
-
44 # bytes(4)
|
|
152
|
-
01020361 # "\\x01\\x02\\x03a"
|
|
153
|
-
65 # string(5)
|
|
154
|
-
736d696c65 # "smile"
|
|
155
|
-
64 f09f # string(2)
|
|
156
|
-
f09f9880 # "😀"
|
|
157
|
-
`)
|
|
240
|
+
assert.strictEqual(stdout, fixture2DiagnosticString)
|
|
158
241
|
})
|
|
159
242
|
|
|
160
|
-
it(`
|
|
161
|
-
const { stdout, stderr } = stdin
|
|
162
|
-
? await execBin(
|
|
163
|
-
: await execBin('
|
|
243
|
+
it(`hex2json${stdin ? ' (stdin)' : ''}`, async () => {
|
|
244
|
+
const { stdout, stderr } = !stdin
|
|
245
|
+
? await execBin(`hex2json ${fixture1HexString}`)
|
|
246
|
+
: await execBin('hex2json', fixture1HexString)
|
|
164
247
|
assert.strictEqual(stderr, '')
|
|
165
|
-
assert.strictEqual(stdout,
|
|
248
|
+
assert.strictEqual(stdout, `${fixture1JsonString}\n`)
|
|
166
249
|
})
|
|
167
250
|
|
|
168
|
-
it(`
|
|
169
|
-
const { stdout, stderr } = stdin
|
|
170
|
-
? await execBin(
|
|
171
|
-
: await execBin('
|
|
251
|
+
it(`hex2json pretty${stdin ? ' (stdin)' : ''}`, async () => {
|
|
252
|
+
const { stdout, stderr } = !stdin
|
|
253
|
+
? await execBin(`hex2json --pretty ${fixture1HexString}`)
|
|
254
|
+
: await execBin('hex2json --pretty', fixture1HexString)
|
|
172
255
|
assert.strictEqual(stderr, '')
|
|
173
|
-
assert.strictEqual(stdout,
|
|
256
|
+
assert.strictEqual(stdout, fixture1JsonPrettyString)
|
|
174
257
|
})
|
|
175
258
|
|
|
176
259
|
it(`json2bin${stdin ? ' (stdin)' : ''}`, async () => {
|
|
177
|
-
const { stdout, stderr } = stdin
|
|
260
|
+
const { stdout, stderr } = !stdin
|
|
178
261
|
? await execBin('json2bin "{\\"a\\":1,\\"b\\":[2,3],\\"smile\\":\\"😀\\"}"')
|
|
179
|
-
: await execBin('json2bin',
|
|
262
|
+
: await execBin('json2bin', fixture1JsonString)
|
|
180
263
|
assert.strictEqual(stderr, '')
|
|
181
|
-
assert.strictEqual(stdout,
|
|
264
|
+
assert.strictEqual(stdout, fixture1BinString)
|
|
182
265
|
})
|
|
183
266
|
|
|
184
267
|
it(`json2diag${stdin ? ' (stdin)' : ''}`, async () => {
|
|
185
|
-
const { stdout, stderr } = stdin
|
|
268
|
+
const { stdout, stderr } = !stdin
|
|
186
269
|
? await execBin('json2diag "{\\"a\\":1,\\"b\\":[2,3],\\"smile\\":\\"😀\\"}"')
|
|
187
|
-
: await execBin('json2diag',
|
|
270
|
+
: await execBin('json2diag', fixture1JsonString)
|
|
188
271
|
assert.strictEqual(stderr, '')
|
|
189
|
-
assert.strictEqual(stdout,
|
|
190
|
-
`a3 # map(3)
|
|
191
|
-
61 # string(1)
|
|
192
|
-
61 # "a"
|
|
193
|
-
01 # uint(1)
|
|
194
|
-
61 # string(1)
|
|
195
|
-
62 # "b"
|
|
196
|
-
82 # array(2)
|
|
197
|
-
02 # uint(2)
|
|
198
|
-
03 # uint(3)
|
|
199
|
-
65 # string(5)
|
|
200
|
-
736d696c65 # "smile"
|
|
201
|
-
64 f09f # string(2)
|
|
202
|
-
f09f9880 # "😀"
|
|
203
|
-
`)
|
|
272
|
+
assert.strictEqual(stdout, fixture1DiagnosticString)
|
|
204
273
|
})
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
it('bin2diag (stdin)', async () => {
|
|
208
|
-
const { stdout, stderr } = await execBin('bin2diag', fromHex('a3616101616282020365736d696c6564f09f9880'))
|
|
209
|
-
assert.strictEqual(stderr, '')
|
|
210
|
-
assert.strictEqual(stdout,
|
|
211
|
-
`a3 # map(3)
|
|
212
|
-
61 # string(1)
|
|
213
|
-
61 # "a"
|
|
214
|
-
01 # uint(1)
|
|
215
|
-
61 # string(1)
|
|
216
|
-
62 # "b"
|
|
217
|
-
82 # array(2)
|
|
218
|
-
02 # uint(2)
|
|
219
|
-
03 # uint(3)
|
|
220
|
-
65 # string(5)
|
|
221
|
-
736d696c65 # "smile"
|
|
222
|
-
64 f09f # string(2)
|
|
223
|
-
f09f9880 # "😀"
|
|
224
|
-
`)
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
it('bin2json (stdin)', async () => {
|
|
228
|
-
const { stdout, stderr } = await execBin('bin2json', fromHex('a3616101616282020365736d696c6564f09f9880'))
|
|
229
|
-
assert.strictEqual(stderr, '')
|
|
230
|
-
assert.strictEqual(stdout, '{"a":1,"b":[2,3],"smile":"😀"}\n')
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
it('bin2json pretty (stdin)', async () => {
|
|
234
|
-
const { stdout, stderr } = await execBin('bin2json --pretty', fromHex('a3616101616282020365736d696c6564f09f9880'))
|
|
235
|
-
assert.strictEqual(stderr, '')
|
|
236
|
-
assert.strictEqual(stdout,
|
|
237
|
-
`{
|
|
238
|
-
"a": 1,
|
|
239
|
-
"b": [
|
|
240
|
-
2,
|
|
241
|
-
3
|
|
242
|
-
],
|
|
243
|
-
"smile": "😀"
|
|
244
|
-
}
|
|
245
|
-
`)
|
|
246
|
-
})
|
|
247
274
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
275
|
+
it(`json2hex${stdin ? ' (stdin)' : ''}`, async () => {
|
|
276
|
+
const { stdout, stderr } = !stdin
|
|
277
|
+
? await execBin(`json2hex "${fixture1JsonString.replace(/"/g, '\\"')}"`)
|
|
278
|
+
: await execBin('json2hex', fixture1JsonString)
|
|
279
|
+
assert.strictEqual(stderr, '')
|
|
280
|
+
assert.strictEqual(stdout, `${fixture1HexString}\n`)
|
|
281
|
+
})
|
|
282
|
+
}
|
|
253
283
|
|
|
254
284
|
// complicated nesting to test indenting algorithm
|
|
255
285
|
it('diag indenting', async () => {
|
|
@@ -311,4 +341,45 @@ Input may either be supplied as an argument or piped via stdin
|
|
|
311
341
|
01 # uint(1)
|
|
312
342
|
`)
|
|
313
343
|
})
|
|
344
|
+
|
|
345
|
+
describe('diag length bytes', () => {
|
|
346
|
+
it('compact', async () => {
|
|
347
|
+
const { stdout, stderr } = await execBin('json2diag', '"aaaaaaaaaaaaaaaaaaaaaaa"')
|
|
348
|
+
assert.strictEqual(stderr, '')
|
|
349
|
+
assert.strictEqual(stdout,
|
|
350
|
+
`77 # string(23)
|
|
351
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
352
|
+
`)
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
it('1-byte', async () => {
|
|
356
|
+
const { stdout, stderr } = await execBin('json2diag', '"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"')
|
|
357
|
+
assert.strictEqual(stderr, '')
|
|
358
|
+
assert.strictEqual(stdout,
|
|
359
|
+
`78 23 # string(35)
|
|
360
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
361
|
+
616161616161616161616161 # "aaaaaaaaaaaa"
|
|
362
|
+
`)
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
it('2-byte', async () => {
|
|
366
|
+
const { stdout, stderr } = await execBin('json2diag', '"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"')
|
|
367
|
+
assert.strictEqual(stderr, '')
|
|
368
|
+
assert.strictEqual(stdout,
|
|
369
|
+
`79 0100 # string(256)
|
|
370
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
371
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
372
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
373
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
374
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
375
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
376
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
377
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
378
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
379
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
380
|
+
6161616161616161616161616161616161616161616161 # "aaaaaaaaaaaaaaaaaaaaaaa"
|
|
381
|
+
616161 # "aaa"
|
|
382
|
+
`)
|
|
383
|
+
})
|
|
384
|
+
})
|
|
314
385
|
})
|
|
@@ -3,4 +3,10 @@
|
|
|
3
3
|
* @param {number} [width]
|
|
4
4
|
*/
|
|
5
5
|
export function tokensToDiagnostic(inp: Uint8Array, width?: number | undefined): Generator<string, void, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Convert an input string formatted as CBOR diagnostic output into binary CBOR form.
|
|
8
|
+
* @param {string} input
|
|
9
|
+
* @returns {Uint8Array}
|
|
10
|
+
*/
|
|
11
|
+
export function fromDiag(input: string): Uint8Array;
|
|
6
12
|
//# sourceMappingURL=diagnostic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic.d.ts","sourceRoot":"","sources":["../../lib/diagnostic.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diagnostic.d.ts","sourceRoot":"","sources":["../../lib/diagnostic.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wCAHW,UAAU,gEAsHpB;AAED;;;;GAIG;AACH,gCAHW,MAAM,GACJ,UAAU,CAatB"}
|