Files
peardata/shared/encodings.js
T
Raven Scott 015d92a257
Release rolling / release (push) Has been cancelled
CI / test (push) Has been cancelled
first commit
2026-07-18 16:17:38 -04:00

28 lines
675 B
JavaScript

/**
* Value encodings for protomux-rpc.
*
* Default: compact-encoding JSON (stable, human-debuggable).
* Future: swap valueEncoding per-method to hyperschema structs while
* keeping method names stable (PROTOCOL_VERSION bump when required).
*/
import c from 'compact-encoding'
import { SCHEMA_VERSION } from './schema.js'
export const json = c.json
export const raw = c.raw
export const none = c.none
export const encodings = {
valueEncoding: json,
requestEncoding: json,
responseEncoding: json,
}
export const ENCODING_PROFILE = {
name: 'json',
schemaVersion: SCHEMA_VERSION,
future: 'hyperschema per-method valueEncoding',
}
export { SCHEMA_VERSION }