MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / decodeRValue

Function decodeRValue

src/pkg/utils/message_value.ts:55–64  ·  view source on GitHub ↗
(rTyped: REncoded<T>)

Source from the content-addressed store, hash-verified

53 * decodeRValue([RType.STANDARD, 123]) // 123
54 */
55export const decodeRValue = <T = unknown>(rTyped: REncoded<T>) => {
56 switch (rTyped[0]) {
57 case RType.UNDEFINED:
58 return undefined;
59 case RType.NULL:
60 return null;
61 default:
62 return rTyped[1] as T;
63 }
64};
65
66/**
67 * encodeRValue

Callers 4

valueUpdateMethod · 0.90
setValuesMethod · 0.90
valueUpdateMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected