Skip to content

Commit 792c998

Browse files
committed
simplify parseEnvelope impl
1 parent 9eec7b9 commit 792c998

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

javascript/src/parseEnvelope.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import { Envelope } from './messages.js'
2-
import { plainToClass } from 'class-transformer'
32

43
/**
5-
* Parses JSON into an Envelope object. The difference from JSON.parse
6-
* is that the resulting objects will have default values (defined in the JSON Schema)
7-
* for properties that are absent from the JSON.
4+
* Parses JSON into an Envelope object.
85
*/
96
export function parseEnvelope(json: string): Envelope {
10-
const plain = JSON.parse(json)
11-
return plainToClass(Envelope, plain)
7+
return JSON.parse(json) as Envelope
128
}

0 commit comments

Comments
 (0)