MCPcopy Index your code
hub / github.com/cameri/nostream / toSerializable

Function toSerializable

src/cli/utils/config.ts:126–140  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

124}
125
126const toSerializable = (value: unknown): unknown => {
127 if (typeof value === 'bigint') {
128 return value.toString()
129 }
130
131 if (Array.isArray(value)) {
132 return value.map((entry) => toSerializable(entry))
133 }
134
135 if (isPlainObject(value)) {
136 return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, toSerializable(entry)]))
137 }
138
139 return value
140}
141
142const validateShape = (schema: unknown, candidate: unknown, path: PathToken[], issues: ValidationIssue[]): void => {
143 if (schema === undefined || candidate === undefined) {

Callers 1

saveSettingsFunction · 0.85

Calls 2

isPlainObjectFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected