doido-auth 0.0.18

Unified authentication for Doido — AuthUser trait, extractors, strategies, and auth generators.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Name inflection helpers — same conventions as `doido-generators`.

use doido_core::Inflector;

/// `BlogPost`/`blog-post` → `blog_post`.
pub fn to_snake(s: &str) -> String {
    Inflector::underscore(s)
}

/// `blog_post`/`blog-post` → `BlogPost`.
pub fn to_pascal(s: &str) -> String {
    Inflector::camelize(&Inflector::underscore(s))
}

/// `BlogPost`/`blog_post` → `blog_posts`.
pub fn to_table_name(s: &str) -> String {
    Inflector::tableize(s)
}