Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 335 Bytes

File metadata and controls

18 lines (11 loc) · 335 Bytes

encode( patch )

Encodes a patch that will be sent to the other side.

Arguments

patch Any

Returns Any

Examples

import { encode, TYPE } from 'dop'

encode({ prop: TYPE.Delete() })          // { prop: { $d: 0 } }
encode({ prop: TYPE.Replace({ b: 2 }) }) // { prop: { $r: { b: 2 } } }