Skip to content

principalSegments

principalSegments(value): string[] | undefined

Defined in: packages/pipeline/src/helpers/principal-partition.ts:17

The principal segments of a partitioned key: each value trimmed, or undefined when the principal is absent or one of its parts is empty. The caller decides what an absent principal means: an error, a skipped key or a shared bucket.

string | readonly string[] | null | undefined

The caller’s identifier, or its parts, such as [type, id].

string[] | undefined

principalSegments(' u-1 '); // ['u-1']
principalSegments(['user', 'u-1']); // ['user', 'u-1']
principalSegments(['user', '']); // undefined