194
return v.stringValue;
195
}
197
return v.boolValue;
198
}
200
>
// intValue is a stringified int64; precision beyond Number.MAX_SAFE_INTEGER is lost
201
>
const n = typeof v.intValue === 'string' ? Number(v.intValue) : v.intValue;
202
>
return Number.isFinite(n) ? n : undefined;
203
>
}
204
>
if (typeof v.doubleValue === 'number') {
205
return v.doubleValue;
206
}
207
if (v.arrayValue?.values) {
208
>
// Only flat arrays of strings are first-class in ICompletedSpanData.attributes.
otlpJsonDecode.ts
209
>
// For mixed/numeric/nested arrays, fall back to JSON for fidelity.
210
>
const items = v.arrayValue.values.map(decodeAnyValue);
211
>
if (items.every((x): x is string => typeof x === 'string')) {
212
return items;
213
}