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

Function encodeRValue

src/pkg/utils/message_value.ts:78–87  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

76 * encodeRValue(123) // [RType.STANDARD, 123]
77 */
78export const encodeRValue = <T = unknown>(value: T): REncoded<T> => {
79 switch (value) {
80 case undefined:
81 return R_UNDEFINED as [RType.UNDEFINED];
82 case null:
83 return R_NULL as [RType.NULL];
84 default:
85 return [RType.STANDARD, value] as [RType.STANDARD, T];
86 }
87};

Callers 11

saveRawDataFunction · 0.90
UserConfigPanelFunction · 0.90
scriptImportAsyncFunction · 0.90
setScriptValueMethod · 0.90
value.test.tsFile · 0.90
setValuesMethod · 0.90
GM_setValueMethod · 0.90
_GM_setValuesMethod · 0.90
gm_api.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected