انتقل إلى المحتوى الرئيسي

Function: compileDisplayNameScripts()

compileDisplayNameScripts(names?): DisplayNameScripts

Defined in: packages/contracts/src/display-name.ts:157

Compiles a deployment's allowlist of scripts, and refuses one that could not mean what its author intended. Called once at start, so a misspelt script fails the start and never the first organisation.

A name is the long Unicode name of a script, exactly as UNICODE_SCRIPT_NAMES spells it: Latin, Arabic, Cyrillic. The four-letter ISO 15924 codes the engine would also take (Latn, Arab) are refused, so that one script has one spelling: with aliases, ['Latin', 'Latn'] names one script twice unnoticed, and Zyyy and Zinh are Common and Inherited under another name. Those two are refused under every name: digits, punctuation and combining marks are always allowed, and listing them would suggest otherwise. Which characters a script holds is still the engine's Unicode data; the list is of names only.

Parameters​

names?​

readonly string[] = DEFAULT_DISPLAY_NAME_SCRIPTS

The configured script names. Absent, DEFAULT_DISPLAY_NAME_SCRIPTS: this parameter is the one place the default is applied, so a module that was configured with nothing and one configured with the default cannot differ.

Returns​

DisplayNameScripts

The compiled allowlist.

Throws​

The list is empty, too long, repeats a name, or holds a name that is not a script.