@proto-kit/protocolDocs


Documentation / @proto-kit/protocol / Path

Class: Path

Helps manage path (key) identifiers for key-values in trees.

Constructors

new Path()

new Path(): Path

Returns

Path

Methods

fromKey()

static fromKey<KeyType>(path, keyType, key): Field

Encodes an existing path with the provided key into a single Field.

Type Parameters

KeyType

Parameters

path: Field

keyType: FlexibleProvablePure<KeyType>

key: KeyType

Returns

Field

Field representation of the leading path + the provided key.

Defined in

packages/protocol/src/model/Path.ts:48


fromProperty()

static fromProperty(className, propertyKey, prefix): Field

Encodes a class name and its property name into a Field

Parameters

className: string

propertyKey: string

prefix: string

Returns

Field

Field representation of class name + property name

Defined in

packages/protocol/src/model/Path.ts:28


toField()

static toField(value): Field

Encodes a JS string as a Field

Parameters

value: string

Returns

Field

Field representation of the provided value

Defined in

packages/protocol/src/model/Path.ts:16