CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
format-smart.d.ts33 linesDownload Raw Back to util
1/**2 * Configurable ways to encode a character yielding pretty or small results.3 *4 * @param {number} code5 * @param {number} next6 * @param {FormatSmartOptions} options7 * @returns {string}8 */9export function formatSmart(code: number, next: number, options: FormatSmartOptions): string;10export type FormatSmartOptions = {11    /**12     * Prefer named character references (`&`) where possible.13     */14    useNamedReferences?: boolean;15    /**16     * Prefer the shortest possible reference, if that results in less bytes.17     * **Note**: `useNamedReferences` can be omitted when using `useShortestReferences`.18     */19    useShortestReferences?: boolean;20    /**21     * Whether to omit semicolons when possible.22     * **Note**: This creates what HTML calls “parse errors” but is otherwise still valid HTML — don’t use this except when building a minifier.23     * Omitting semicolons is possible for certain named and numeric references in some cases.24     */25    omitOptionalSemicolons?: boolean;26    /**27     * Create character references which don’t fail in attributes.28     * **Note**: `attribute` only applies when operating dangerously with29     * `omitOptionalSemicolons: true`.30     */31    attribute?: boolean;32};33