Skip to main content

split_reference

Function split_reference 

Source
pub fn split_reference(input: &str) -> (Option<&str>, Cow<'_, str>)
Expand description

Split an optional context off a reference: npm:react@1.2.3 → (Some("npm:react"), "1.2.3"). The context ends at the last @ of the first whitespace-delimited token; a leading @ (a scoped npm name) is part of the context, and an @ at position 0 means there is no context.