Description
Split a nonempty workspace: dependency specifier.
Package and container references combine names, selectors, conditions and platform metadata. A restricted lexical split can preserve these parts without validating registry identity, available targets, dependency graphs or runtime resolution.
Split a nonempty workspace: dependency specifier.
When to use this tool
Use npm Workspace Specifier Prefix when checking the stated package, Cargo or container-reference component.
How to use the tool and how it works
- Enter specifier. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read selector, shorthand. Inspect shorthand before interpreting the associated values.
Split a nonempty workspace: dependency specifier. Require that prefix and a nonempty suffix; return selector and shorthand true only for *, ~ or ^.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| specifier | Specifier | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| selector | Selector | Required. Text; maximum UTF-16 length 8192. |
| shorthand | Shorthand | Required. Boolean. |
{
"input": {
"specifier": "workspace:^"
},
"output": {
"selector": "^",
"shorthand": true
}
} Limitations and assumptions
- Other nonempty suffixes are returned without range validation or workspace/package lookup.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use the relevant package manager, runtime or registry against the actual project for complete resolution and validation.
References
Similar or alternative tools
- Development: npm Alias Specifier Components
Parse one restricted npm alias specifier.
- Development: npm Scoped Name Components
Split a restricted lowercase npm scoped package name.