(spanAttributes: ReadonlyArray<readonly [string, unknown]>, key: string)
| 1419 | |
| 1420 | // the last value wins, matching the order the attributes are applied to spans |
| 1421 | const spanAttribute = (spanAttributes: ReadonlyArray<readonly [string, unknown]>, key: string): unknown => { |
| 1422 | for (let i = spanAttributes.length - 1; i >= 0; i--) { |
| 1423 | if (spanAttributes[i][0] === key) { |
| 1424 | return spanAttributes[i][1] |
| 1425 | } |
| 1426 | } |
| 1427 | return undefined |
| 1428 | } |
| 1429 | |
| 1430 | const isNonEmptyString = (u: unknown): u is string => typeof u === "string" && u.length > 0 |
| 1431 |
no outgoing calls
no test coverage detected