Skip to main content
Version: v0.0.3

Function: fieldValue()

fieldValue(segment, fieldId): string | undefined

Read the verbatim value of the first field with a given id within a segment.

Parameters

segment

TelecomSegment | undefined

The segment to read, or undefined.

fieldId

string

The 2-character field id, e.g. "D7".

Returns

string | undefined

The field value, or undefined when the segment or field is absent.

Example

fieldValue(findSegment(t.segments, "07"), "D7"); // the Product/Service ID