Skip to content

Commit 4315fac

Browse files
committed
Update ByteSequence example to ArrayBuffer
1 parent 29b7524 commit 4315fac

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

readme.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The type is roughly:
107107

108108
```typescript
109109
// The raw value
110-
type BareItem = number | string | Token | ByteSequence | boolean | Date | DisplayString;
110+
type BareItem = number | string | Token | ArrayBuffer | boolean | Date | DisplayString;
111111

112112
// The return type of parseItem
113113
type Item = [
@@ -214,6 +214,13 @@ sh.serializeDictionary({
214214
// Returns 42
215215
serializeItem(42);
216216

217+
48,65,6C,6C,6F,2C,20,57,6F,72,6C,64,21.
218+
219+
72, 101, 108, 108,
220+
111, 32, 119, 111,
221+
114, 108, 100
222+
223+
217224
// Returns 5.5
218225
serializeItem(5.5);
219226

@@ -227,7 +234,11 @@ serializeItem("Fryslân");
227234
serializeItem(true);
228235

229236
// Returns a base-64 representation like: *aGVsbG8=*
230-
serializeItem(new ByteSequence('aGVsbG8='));
237+
serializeItem(
238+
new UInt8Array(
239+
[72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]
240+
).buffer
241+
);
231242

232243
// Returns a unix timestamp
233244
serializeItem(new Date());

0 commit comments

Comments
 (0)