(
request: Request,
counter: {objectLimit: number},
map: Map<ReactClientValue, ReactClientValue>,
)
| 2997 | } |
| 2998 | |
| 2999 | function serializeDebugMap( |
| 3000 | request: Request, |
| 3001 | counter: {objectLimit: number}, |
| 3002 | map: Map<ReactClientValue, ReactClientValue>, |
| 3003 | ): string { |
| 3004 | // Like serializeMap but for renderDebugModel. |
| 3005 | const entries = Array.from(map); |
| 3006 | // The Map itself doesn't take up any space but the outlined object does. |
| 3007 | counter.objectLimit++; |
| 3008 | for (let i = 0; i < entries.length; i++) { |
| 3009 | // Outline every object entry in case we run out of space to serialize them. |
| 3010 | // Because we can't mark these values as limited. |
| 3011 | const entry = entries[i]; |
| 3012 | doNotLimit.add(entry); |
| 3013 | const key = entry[0]; |
| 3014 | const value = entry[1]; |
| 3015 | if (typeof key === 'object' && key !== null) { |
| 3016 | doNotLimit.add(key); |
| 3017 | } |
| 3018 | if (typeof value === 'object' && value !== null) { |
| 3019 | doNotLimit.add(value); |
| 3020 | } |
| 3021 | } |
| 3022 | const id = outlineDebugModel(request, counter, entries); |
| 3023 | return '$Q' + id.toString(16); |
| 3024 | } |
| 3025 | |
| 3026 | function serializeDebugSet( |
| 3027 | request: Request, |
no test coverage detected