Api / JavaScript /

decode( patch )

Decodes a patch that has been previously encoded.

Arguments

patch Any

Returns Any

Examples

import { encode, TYPE } from 'dop'

const encoded = encode({ prop: TYPE.Delete() })
encoded // { prop: { $d: 0 } }
decode(encoded) // { prop: TYPE.Delete() }