1.0.15 • Published 5 months ago

@vandeurenglenn/proto-array v1.0.15

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

native-proton

Makes things smaller

install

npm i @vandeurenglenn/proto-array

usage

const proto = {
  index: 0,
  hash: '0xf1a1'
}

const data = {
  index: 5,
  hash: '0xa1f1'
}

const encoded = encode(proto, data)

const decoded = decode(proto, encoded)

explanation

when encoding keys(propertyNames) are excluded from the encoded data using the provided proto when decoding these keys are set using the provided proto