Skip to content

@ui5/builder/processors/nonAsciiEscaper

Methods

(static) default(parameters) → {Promise<Array<@ui5/fs/Resource>>}

Description: Escapes non ASCII characters with unicode escape sequences.

js
const encoding = nonAsciiEscaper.getEncodingFromAlias("ISO-8859-1");
nonAsciiEscaper({resources, options: {encoding}});

Source: builder/lib/processors/nonAsciiEscaper.js, line 57

Parameters:
NameTypeDescription
parametersobjectParameters
Properties:
NameTypeAttributesDescription
resourcesArray<@ui5/fs/Resource>List of resources to be processed
optionsobjectoptionalOptions
Properties
NameTypeAttributesDefaultDescription
encodingstringoptional"utf8"resource file encoding
(Node.js character encodings).
Use #getEncodingFromAlias to get the encoding string
Returns:

Promise resolving with the processed resources

Type: Promise<Array<@ui5/fs/Resource>>

(static) getEncodingFromAlias(encoding) → {string}

Description: Provides a mapping from user-friendly encoding name (alias) such as "UTF-8" and "ISO-8859-1" to node specific encoding name such as "utf8" or "latin1". Simplifies usage of nonAsciiEscaper encoding option such that it can be used standalone without the respective task (e.g. in Splitter, Bundler and related projects).

Source: builder/lib/processors/nonAsciiEscaper.js, line 98

Parameters:
NameTypeDescription
encodingstringencoding labels: "UTF-8" and "ISO-8859-1"
Returns:

node.js character encoding string, e.g. utf8 and latin1

Type: string