StringTune/Docs

API Reference

parsePartOf

Internal parser for StringProgressPart source syntax such as source[0.2-0.7].

parsePartOf

parsePartOf is a small internal parser used by StringProgressPart.

Public status

It lives in src/utils, but it is not exported by the package root. Treat it as internal runtime reference.

Expected input

TXT
sourceId[0.2-0.7]

Output shape

TypeScript
{ id: string; start: number; end: number } | null

What it does

It extracts:

  • the source object id
  • the start of the slice
  • the end of the slice

If the string does not match the expected pattern, it returns null.

Why it matters

This helper explains the string-part-of="source[start-end]" syntax used by StringProgressPart, but it should not be treated as a standalone public helper.