Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 1.73 KB

CollapseDuplicatesTransformerOptions.md

File metadata and controls

62 lines (39 loc) · 1.73 KB

obscenity / CollapseDuplicatesTransformerOptions

Interface: CollapseDuplicatesTransformerOptions

Options for the collapse duplicates transformer.

Table of contents

Properties

Properties

customThresholds

Optional customThresholds: Map<string, number>

Custom thresholds for characters. If a character has an entry corresponding to it, the value of tne entry will be used as the maximum length of character runs comprised of said character before they are collapsed.

The intended use-case for this option is for characters which appear more than once in a row in patterns. For example, the word book has two os in a row, and matches book. With this transformer, though, book would become bok, meaning that book would no longer match book. The fix would be to add an entry corresponding to o that overrides its threshold to be 2, with the effect of leaving book unchanged.

Default

new Map()

Defined in

src/transformer/collapse-duplicates/index.ts:91


defaultThreshold

Optional defaultThreshold: number

The maximum number of characters in a run that will be accepted before they will be collapsed.

For example, if this value was 2, aa would stay the same but aaa would be transformed to aa.

Default

1

Defined in

src/transformer/collapse-duplicates/index.ts:102