MCPcopy Create free account
hub / github.com/deepnote/deepnote / sortedKeysReplacer

Function sortedKeysReplacer

packages/convert/src/snapshot/resolve-init.ts:265–275  ·  view source on GitHub ↗
(_key: string, value: unknown)

Source from the content-addressed store, hash-verified

263}
264
265function sortedKeysReplacer(_key: string, value: unknown): unknown {
266 if (value === null || typeof value !== 'object' || Array.isArray(value)) {
267 return value
268 }
269 const sortedKeys = Object.keys(value).sort()
270 const result: Record<string, unknown> = {}
271 for (const k of sortedKeys) {
272 result[k] = (value as Record<string, unknown>)[k]
273 }
274 return result
275}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected