Package Exports
- @ultraq/string-utils
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ultraq/string-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
string-utils
A collection of utilities for JavaScript strings.
Installation
Via npm:
npm install @ultraq/string-utils --saveAPI
escapeHtml(string)
Escapes special HTML characters in a string with their entity code equivalents. Returns a string safe to use as text within an HTML document.
- string: string to escape.
format(template, ...values)
Returns the replacement of each placeholder in a template string with a corresponding replacement value.
- template: template string containing placeholders in the format or
{n}wherenis the corresponding index value to have filled-in. - ...values: argument list of values to fill in the placeholders in the template string with.