Home / Function/ slugify() — supabase Function Reference

slugify() — supabase Function Reference

Architecture documentation for the slugify() function in helpers.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  088ba946_bf3a_b2cf_624f_c3480af29b59["slugify()"]
  16236cbf_2788_d391_f773_56bb62d808aa["gen_v3()"]
  16236cbf_2788_d391_f773_56bb62d808aa -->|calls| 088ba946_bf3a_b2cf_624f_c3480af29b59
  167c5e66_f623_cbb8_77f7_298cdb145d98["gen_v2()"]
  167c5e66_f623_cbb8_77f7_298cdb145d98 -->|calls| 088ba946_bf3a_b2cf_624f_c3480af29b59
  style 088ba946_bf3a_b2cf_624f_c3480af29b59 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/generator/helpers.ts lines 4–14

export const slugify = (text: string) => {
  if (!text) return ''
  return text
    .toString()
    .toLowerCase()
    .replace(/[. )(]/g, '-') // Replace spaces and brackets -
    .replace(/[^\w\-]+/g, '') // Remove all non-word chars
    .replace(/\-\-+/g, '-') // Replace multiple - with single -
    .replace(/^-+/, '') // Trim - from start of text
    .replace(/-+$/, '') // Trim - from end of text
}

Subdomains

Called By

Frequently Asked Questions

What does slugify() do?
slugify() is a function in the supabase codebase.
What calls slugify()?
slugify() is called by 2 function(s): gen_v2, gen_v3.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free