Message::jsoninstance method
Converts the encapsulated value into a JavaScript value.
messagejsonvalue
name | type | description |
---|---|---|
message | Message | An instance of Message. |
value | any | Encapsulated value. |
json
is a convenience method for restoring a value that was originally encoded as JSON.
Example
import assert from "assert"
import {confidential} from "panda-confidential"
{Message} = confidential()
message = Message.from "utf-8",
JSON.stringify greeting: "hello"
assert.equal "hello",
message.json().greeting