Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface NormalizeOptions

Options for normalizer

Hierarchy

  • NormalizeOptions

Index

Properties

Optional convertSpaces

convertSpaces: string | null

Defines what character spaces (codepoints U+0020 and U+00A0 after compatibility normalization) are converted to. By default, this is - (dash). To preserve spaces as is, set this to (note that non-breaking spaces will be converted to normal spaces). Set to an empty string or null to remove all spaces entirely. Note that all other spacing characters (including newlines, tabs, etc) are removed.

Optional keepEmojis

keepEmojis: boolean

Keep emoji characters. Default value: false. This has no effect in basic mode, as that doesn't remove characters..

Optional lowercase

lowercase: boolean

Lowercase the output string. Default value: false

Optional mode

mode: "basic" | "alphabetic" | "latin"

Mode of operation:

  • "basic" removes diacritics only from letters
  • "alphabetic" removes all characters that are not alphabetic (in all scripts)
  • "latin" removes all characters that are not in the latin alphabet

In all modes, control characters and whitespaces are removed; spaces are converted to the character specified in spaceConversion

Default value: basic

Optional preserveCharacters

preserveCharacters: string

Additional characters to preserve. By default, this is -_. (dash, underscore and dot). This is ignored when in basic mode.

Optional removeNumbers

removeNumbers: boolean

Remove numbers. Default value: false. This has no effect in basic mode, as that never removes numbers.

Generated using TypeDoc