We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9eec7b9 commit 792c998Copy full SHA for 792c998
javascript/src/parseEnvelope.ts
@@ -1,12 +1,8 @@
1
import { Envelope } from './messages.js'
2
-import { plainToClass } from 'class-transformer'
3
4
/**
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.
+ * Parses JSON into an Envelope object.
8
*/
9
export function parseEnvelope(json: string): Envelope {
10
- const plain = JSON.parse(json)
11
- return plainToClass(Envelope, plain)
+ return JSON.parse(json) as Envelope
12
}
0 commit comments