MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / derive_intent_prefix

Function derive_intent_prefix

atomic-repository/src/repository/vault_names.rs:223–230  ·  view source on GitHub ↗

Derive a JIRA-style intent prefix from a project directory name. Takes the first 4 alphanumeric characters and uppercases them. Examples: "pi-mono-rs" → "PIMO", "atomic" → "ATOM"

(project_name: &str)

Source from the content-addressed store, hash-verified

221/// Takes the first 4 alphanumeric characters and uppercases them.
222/// Examples: "pi-mono-rs""PIMO", "atomic""ATOM"
223pub fn derive_intent_prefix(project_name: &str) -> String {
224 project_name
225 .chars()
226 .filter(|c| c.is_alphanumeric())
227 .take(4)
228 .collect::<String>()
229 .to_uppercase()
230}
231
232#[cfg(test)]
233mod tests {

Callers 1

vault_intent_createMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected