From 6bb7e2ffe5aac3e998c5f9fb59c6909e8ac4cdd9 Mon Sep 17 00:00:00 2001 From: rowan Date: Sun, 25 May 2025 12:58:19 -0500 Subject: [PATCH] update readme --- README.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index dc3135d..fc426af 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ class Recipient { registerDeserialize(Recipient, Recipient.deserialize) } - private readonly email: string readonly displayName: string + private readonly email: string - constructor(email: string, displayName: string) { - this.email = email + constructor(displayName: string, email: string,) { this.displayName = displayName + this.email = email } static serialize(serializer: ISerializer, recipient: Recipient) { @@ -109,23 +109,22 @@ const message = new Message(bob, [alice, alicesMom], 'i hope this email finds yo const messageSerial = toString(message) console.log(messageSerial) -// {"from":"bob@security.lol","to":["alice@balloon.party","alice.mom@malware.zip"],"text":"i hope this email finds you before i do"} +// {"from":"Bob","to":["Alice","Alice's Mom"],"text":"i hope this email finds you before i do"} const messageDecereal = fromString(messageSerial, Message) console.log(messageDecereal) /* - Message { - from: Recipient { email: 'bob@security.lol', displayName: 'Bob' }, - to: [ - Recipient { email: 'alice@balloon.party', displayName: 'Alice' }, - Recipient { - email: 'alice.mom@malware.zip', - displayName: "Alice's Mom" - } - ], - text: 'i hope this email finds you before i do' - } + Message { + from: Recipient { displayName: 'Bob', email: 'bob@security.lol' }, + to: [ + Recipient { displayName: 'Alice', email: 'alice@balloon.party' }, + Recipient { + displayName: "Alice's Mom", + email: 'alice.mom@malware.zip' + } + ], + text: 'i hope this email finds you before i do' + } */ - ```