MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / encodeValue

Function encodeValue

packages/nativescript-inspector/src/index.ts:2456–2475  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

2454}
2455
2456function encodeValue(value: any): unknown {
2457 if (value == null) {
2458 return null;
2459 }
2460 if (
2461 typeof value === "string" ||
2462 typeof value === "number" ||
2463 typeof value === "boolean"
2464 ) {
2465 return value;
2466 }
2467 return (
2468 rectValue(value) ??
2469 pointValue(value) ??
2470 sizeValue(value) ??
2471 insetsValue(value) ??
2472 colorValue(value) ??
2473 stringValue(value)
2474 );
2475}
2476
2477function decodeValue(value: unknown): unknown {
2478 if (!value || typeof value !== "object") {

Callers 3

getPropertiesMethod · 0.70
setPropertyMethod · 0.70
evaluateScriptMethod · 0.70

Calls 6

rectValueFunction · 0.85
pointValueFunction · 0.85
sizeValueFunction · 0.85
insetsValueFunction · 0.85
colorValueFunction · 0.85
stringValueFunction · 0.85

Tested by

no test coverage detected