Methods
(static) default(parameters) → {Promise.<Array.<@ui5/fs/Resource>>}
- Description:
- Escapes non ASCII characters with unicode escape sequences.
- Source:
Example
const encoding = nonAsciiEscaper.getEncodingFromAlias("ISO-8859-1");
nonAsciiEscaper({resources, options: {encoding}});
Parameters:
Name |
Type |
Description |
parameters |
object
|
Parameters
Properties
Name |
Type |
Attributes |
Description |
resources |
Array.<@ui5/fs/Resource>
|
|
List of resources to be processed |
options |
object
|
<optional>
|
Options
Properties
Name |
Type |
Attributes |
Default |
Description |
encoding |
string
|
<optional>
|
"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:
Parameters:
Name |
Type |
Description |
encoding |
string
|
encoding labels: "UTF-8" and "ISO-8859-1" |
Returns:
node.js character encoding string, e.g. utf8 and latin1
-
Type
-
string