MCPcopy Create free account
hub / github.com/Effect-TS/effect / spanAttribute

Function spanAttribute

packages/effect/src/sql/Statement.ts:1421–1428  ·  view source on GitHub ↗
(spanAttributes: ReadonlyArray<readonly [string, unknown]>, key: string)

Source from the content-addressed store, hash-verified

1419
1420// the last value wins, matching the order the attributes are applied to spans
1421const 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
1430const isNonEmptyString = (u: unknown): u is string => typeof u === "string" && u.length > 0
1431

Callers 2

spanTargetFunction · 0.85
spanNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected