( metadata: ReplayScriptMetadata, key: Key, value: NonNullable<ReplayScriptMetadata[Key]>, )
| 168 | } |
| 169 | |
| 170 | function assignReplayMetadataValue<Key extends keyof ReplayScriptMetadata>( |
| 171 | metadata: ReplayScriptMetadata, |
| 172 | key: Key, |
| 173 | value: NonNullable<ReplayScriptMetadata[Key]>, |
| 174 | ): void { |
| 175 | const previous = metadata[key]; |
| 176 | if (previous !== undefined) { |
| 177 | const duplicateMessage = |
| 178 | previous === value |
| 179 | ? `Duplicate replay test metadata "${key}" in context header.` |
| 180 | : `Conflicting replay test metadata "${key}" in context header: ${String(previous)} vs ${String(value)}.`; |
| 181 | throw new AppError('INVALID_ARGS', duplicateMessage); |
| 182 | } |
| 183 | metadata[key] = value as ReplayScriptMetadata[Key]; |
| 184 | } |
| 185 | |
| 186 | // fallow-ignore-next-line complexity |
| 187 | function parseReplayScriptLine(line: string): SessionAction | null { |
no outgoing calls
no test coverage detected
searching dependent graphs…