The options MishkaSlug.slugify/2 and MishkaSlug.Change accept.
The schema lives here once. validate/1 checks a keyword list against it, fills the defaults
and refuses any key it does not know, so a misspelled option is an error and never a silently
ignored one. See MishkaSlug.slugify/2 for what each option does.
Summary
Functions
A sample %MishkaSlug.Options{} populated from defaults + type-based fallbacks.
Validates opts and returns them as a keyword list with every default filled in.
Same as validate/1, but returns the options or raises ArgumentError.
Types
@type t() :: %MishkaSlug.Options{ digits: (:keep | :ascii) | nil, keep: [String.t()] | nil, language: (String.t() | nil) | nil, latin: (:ascii | :keep) | nil, locales: [String.t()] | nil, max_length: (pos_integer() | nil) | nil, mixed_scripts: (:split | :reject) | nil, script_resolver: ({module(), atom(), list()} | nil) | nil, trim_kept: boolean() | nil, zwnj: (:remove | :separator) | nil }
Functions
A sample %MishkaSlug.Options{} populated from defaults + type-based fallbacks.
Validates opts and returns them as a keyword list with every default filled in.
Returns {:ok, opts}, or {:error, message} that names the options that failed.
Same as validate/1, but returns the options or raises ArgumentError.