id: coding-typescript-function
dimension: coding
difficulty: basic
prompt: |
  Write a TypeScript function called `slugify` that converts a string to a
  URL-friendly slug. Requirements:
  - Convert to lowercase
  - Replace spaces with hyphens
  - Remove non-alphanumeric characters (except hyphens)
  - Collapse multiple hyphens into one
  - Trim leading/trailing hyphens

  Output only the function, no explanation.
expected:
  contains:
    - "function slugify"
    - "toLowerCase"
    - "replace"
    - "string"
  must_not_contain:
    - "import"
scoring:
  correct_tool: 0.4
  correct_params: 0.4
  no_hallucination: 0.2
