( input: unknown )
| 4351 | |
| 4352 | /** The `~query` payload by query name and args key, or `undefined` when it isn't the tuple shape. */ |
| 4353 | const parseRaw = ( |
| 4354 | input: unknown |
| 4355 | ): Map<string, Map<string, RawTuple>> | undefined => { |
| 4356 | if (typeof input !== "object" || input === null || Array.isArray(input)) { |
| 4357 | return undefined |
| 4358 | } |
| 4359 | const out = new Map<string, Map<string, RawTuple>>() |
| 4360 | for (const [name, tuples] of Object.entries(input)) { |
| 4361 | if (!Array.isArray(tuples)) return undefined |
| 4362 | const byKey = new Map<string, RawTuple>() |
| 4363 | for (const tuple of tuples) { |
| 4364 | if (!isRawTuple(tuple)) return undefined |
| 4365 | if (!byKey.has(tuple[0])) byKey.set(tuple[0], tuple) |
| 4366 | } |
| 4367 | if (byKey.size > 0) out.set(name, byKey) |
| 4368 | } |
| 4369 | return out |
| 4370 | } |
| 4371 | |
| 4372 | interface PendingDecode { |
| 4373 | readonly _tag: "Pending" |
no test coverage detected