Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > LookupByPath > iteratePathSegments

LookupByPath.iteratePathSegments() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Iterates over the segments of a serialized path.

Signature:

static iteratePathSegments(serializedPath: string, delimiter?: string): Iterable<string>;

Parameters

ParameterTypeDescription
serializedPathstring
delimiterstring(Optional)

Returns:

Iterable<string>

Example

LookupByPath.iteratePathSegments('foo/bar/baz') yields 'foo', 'bar', 'baz'

LookupByPath.iteratePathSegments('foo\\bar\\baz', '\\') yields 'foo', 'bar', 'baz'