Sha256: 07239cf2fe73be899869fbdfcc04d290570b3e0bdc492d4c2db98ed072494372

Contents?: true

Size: 1.54 KB

Versions: 23

Compression:

Stored size: 1.54 KB

Contents

// TypeScript Version: 3.0

declare namespace stringifyEntities {
  interface StringifyEntitiesOptions {
    /**
     * Whether to only escape possibly dangerous characters (`boolean`, default: `false`).
     * Those characters are `"`, `'`, `<`, `>` `&`, and `` ` ``.
     */
    escapeOnly: boolean

    /**
     * Whether to only escape the given subset of characters (`Array.<string>`).
     */
    subset: string[]

    /**
     * Whether to use named entities where possible (`boolean?`, default: `false`).
     */
    useNamedReferences: boolean

    /**
     * Whether to use named entities, where possible, if that results in less bytes (`boolean?`, default: `false`).
     * **Note**: `useNamedReferences` can be omitted when using `useShortestReferences`.
     */
    useShortestReferences: boolean

    /**
     * Whether to omit semi-colons when possible (`boolean?`, default: `false`).
     * **Note**: This creates parse errors, don’t use this except when building a minifier.
     *
     * Omitting semi-colons is possible for certain legacy named references, and numeric entities, in some cases.
     */
    omitOptionalSemicolons: boolean

    /**
     * Only needed when operating dangerously with `omitOptionalSemicolons: true`.
     * Create entities which don’t fail in attributes (`boolean?`, default: `false`).
     */
    attribute: boolean
  }
}

/**
 * Encode special characters in `value`.
 */
declare function stringifyEntities(
  value: string,
  options?: Partial<stringifyEntities.StringifyEntitiesOptions>
): string

export = stringifyEntities

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/stringify-entities/types/index.d.ts
trusty-cms-5.0.6 node_modules/stringify-entities/types/index.d.ts
trusty-cms-5.0.5 node_modules/stringify-entities/types/index.d.ts
trusty-cms-5.0.4 node_modules/stringify-entities/types/index.d.ts
trusty-cms-5.0.3 node_modules/stringify-entities/types/index.d.ts
trusty-cms-5.0.2 node_modules/stringify-entities/types/index.d.ts
trusty-cms-5.0.1 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.3.5 node_modules/stringify-entities/types/index.d.ts
trusty-cms-5.0.0 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.3.4 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.3.3 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.3.2 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.3.1 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.3 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.2.3 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.2.2 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.2.1 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.2 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.1.9 node_modules/stringify-entities/types/index.d.ts
trusty-cms-4.1.8 node_modules/stringify-entities/types/index.d.ts