Skip to content

parseWorkspaceStringKey

parseWorkspaceStringKey(key): ParsedWorkspaceKey

Defined in: ootle/src/helpers/workspace.ts:29

Parses a workspace key string, supporting dot-notation offsets.

string

ParsedWorkspaceKey

parseWorkspaceStringKey("bucket") // { name: "bucket", offset: null }
parseWorkspaceStringKey("bucket.0") // { name: "bucket", offset: 0 }
parseWorkspaceStringKey("bucket.1") // { name: "bucket", offset: 1 }

if the key contains more than one dot, or if the suffix after the dot is empty / non-numeric / negative.