Skip to content

Commit

Permalink
chore(release): 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jo3-l committed Aug 2, 2024
1 parent f14df6c commit 2242235
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 78 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.4.0](https://github.com/jo3-l/obscenity/compare/v0.3.1...v0.4.0) (2024-08-02)


### ⚠ BREAKING CHANGES

* **regexp-matcher:** Passing an empty whitelisted term to the RegExpMatcher will result in a runtime error.

This was unsupported previously and likely did not work correctly. Make it a real error.

### Bug Fixes

* **regexp-matcher:** advance index correctly in whitelist matcher ([ebf95ad](https://github.com/jo3-l/obscenity/commit/ebf95add62be8297f693ca6d8aafefc10afc1a8b)), closes [#49](https://github.com/jo3-l/obscenity/issues/49)
* **regexp-matcher:** correctly remap to original indices in all cases ([3a49579](https://github.com/jo3-l/obscenity/commit/3a49579f3c242d3e159e88707df090e3f6dc0121)), closes [#71](https://github.com/jo3-l/obscenity/issues/71)
* **regexp-matcher:** reject empty whitelist terms ([9a46113](https://github.com/jo3-l/obscenity/commit/9a461130b98920e22d5acf92650146ae48d2226b))

### [0.3.1](https://github.com/jo3-l/obscenity/compare/v0.3.0...v0.3.1) (2024-07-17)

## [0.3.0](https://github.com/jo3-l/obscenity/compare/v0.2.2...v0.3.0) (2024-07-17)
Expand Down
54 changes: 27 additions & 27 deletions docs/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Context passed to [[TextCensorStrategy | text censoring strategies]].

#### Defined in

[src/censor/TextCensor.ts:104](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/TextCensor.ts#L104)
[src/censor/TextCensor.ts:104](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/TextCensor.ts#L104)

___

Expand All @@ -91,7 +91,7 @@ should be a set of characters that map to the transformed character.

#### Defined in

[src/transformer/remap-characters/index.ts:60](https://github.com/jo3-l/obscenity/blob/37976b6/src/transformer/remap-characters/index.ts#L60)
[src/transformer/remap-characters/index.ts:60](https://github.com/jo3-l/obscenity/blob/f14df6c/src/transformer/remap-characters/index.ts#L60)

___

Expand All @@ -103,7 +103,7 @@ All the profane words that are included in the [[englishDataset | english datase

#### Defined in

[src/preset/english.ts:418](https://github.com/jo3-l/obscenity/blob/37976b6/src/preset/english.ts#L418)
[src/preset/english.ts:418](https://github.com/jo3-l/obscenity/blob/f14df6c/src/preset/english.ts#L418)

___

Expand All @@ -121,7 +121,7 @@ Extends the default match payload by adding phrase metadata.

#### Defined in

[src/dataset/DataSet.ts:190](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L190)
[src/dataset/DataSet.ts:190](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L190)

___

Expand All @@ -133,7 +133,7 @@ All the possible kinds of nodes.

#### Defined in

[src/pattern/Nodes.ts:24](https://github.com/jo3-l/obscenity/blob/37976b6/src/pattern/Nodes.ts#L24)
[src/pattern/Nodes.ts:24](https://github.com/jo3-l/obscenity/blob/f14df6c/src/pattern/Nodes.ts#L24)

___

Expand All @@ -160,7 +160,7 @@ replacement string.

#### Defined in

[src/censor/TextCensor.ts:99](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/TextCensor.ts#L99)
[src/censor/TextCensor.ts:99](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/TextCensor.ts#L99)

## Variables

Expand Down Expand Up @@ -221,7 +221,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#### Defined in

[src/preset/english.ts:103](https://github.com/jo3-l/obscenity/blob/37976b6/src/preset/english.ts#L103)
[src/preset/english.ts:103](https://github.com/jo3-l/obscenity/blob/f14df6c/src/preset/english.ts#L103)

___

Expand All @@ -234,7 +234,7 @@ A set of transformers to be used when matching blacklisted patterns with the

#### Defined in

[src/preset/english.ts:13](https://github.com/jo3-l/obscenity/blob/37976b6/src/preset/english.ts#L13)
[src/preset/english.ts:13](https://github.com/jo3-l/obscenity/blob/f14df6c/src/preset/english.ts#L13)

___

Expand All @@ -247,7 +247,7 @@ dataset]] and the [[RegExpMatcher]].

#### Defined in

[src/preset/english.ts:48](https://github.com/jo3-l/obscenity/blob/37976b6/src/preset/english.ts#L48)
[src/preset/english.ts:48](https://github.com/jo3-l/obscenity/blob/f14df6c/src/preset/english.ts#L48)

___

Expand All @@ -260,7 +260,7 @@ A set of transformers to be used when matching whitelisted terms with the

#### Defined in

[src/preset/english.ts:36](https://github.com/jo3-l/obscenity/blob/37976b6/src/preset/english.ts#L36)
[src/preset/english.ts:36](https://github.com/jo3-l/obscenity/blob/f14df6c/src/preset/english.ts#L36)

## Functions

Expand Down Expand Up @@ -299,7 +299,7 @@ to the [[RegExpMatcher]].

#### Defined in

[src/matcher/BlacklistedTerm.ts:37](https://github.com/jo3-l/obscenity/blob/37976b6/src/matcher/BlacklistedTerm.ts#L37)
[src/matcher/BlacklistedTerm.ts:37](https://github.com/jo3-l/obscenity/blob/f14df6c/src/matcher/BlacklistedTerm.ts#L37)

___

Expand All @@ -326,7 +326,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:71](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/BuiltinStrategies.ts#L71)
[src/censor/BuiltinStrategies.ts:71](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/BuiltinStrategies.ts#L71)

___

Expand Down Expand Up @@ -389,7 +389,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/collapse-duplicates/index.ts:46](https://github.com/jo3-l/obscenity/blob/37976b6/src/transformer/collapse-duplicates/index.ts#L46)
[src/transformer/collapse-duplicates/index.ts:46](https://github.com/jo3-l/obscenity/blob/f14df6c/src/transformer/collapse-duplicates/index.ts#L46)

___

Expand Down Expand Up @@ -430,7 +430,7 @@ than the first.

#### Defined in

[src/matcher/MatchPayload.ts:57](https://github.com/jo3-l/obscenity/blob/37976b6/src/matcher/MatchPayload.ts#L57)
[src/matcher/MatchPayload.ts:57](https://github.com/jo3-l/obscenity/blob/f14df6c/src/matcher/MatchPayload.ts#L57)

___

Expand Down Expand Up @@ -464,7 +464,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:134](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/BuiltinStrategies.ts#L134)
[src/censor/BuiltinStrategies.ts:134](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/BuiltinStrategies.ts#L134)

___

Expand Down Expand Up @@ -508,7 +508,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:115](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/BuiltinStrategies.ts#L115)
[src/censor/BuiltinStrategies.ts:115](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/BuiltinStrategies.ts#L115)

___

Expand Down Expand Up @@ -537,7 +537,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:89](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/BuiltinStrategies.ts#L89)
[src/censor/BuiltinStrategies.ts:89](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/BuiltinStrategies.ts#L89)

___

Expand Down Expand Up @@ -571,7 +571,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:51](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/BuiltinStrategies.ts#L51)
[src/censor/BuiltinStrategies.ts:51](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/BuiltinStrategies.ts#L51)

___

Expand Down Expand Up @@ -616,7 +616,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:28](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/BuiltinStrategies.ts#L28)
[src/censor/BuiltinStrategies.ts:28](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/BuiltinStrategies.ts#L28)

___

Expand Down Expand Up @@ -651,7 +651,7 @@ The parsed pattern, which can then be used with the

#### Defined in

[src/pattern/Pattern.ts:130](https://github.com/jo3-l/obscenity/blob/37976b6/src/pattern/Pattern.ts#L130)
[src/pattern/Pattern.ts:130](https://github.com/jo3-l/obscenity/blob/f14df6c/src/pattern/Pattern.ts#L130)

___

Expand Down Expand Up @@ -784,7 +784,7 @@ The parsed pattern, which can then be used with the

#### Defined in

[src/pattern/Pattern.ts:106](https://github.com/jo3-l/obscenity/blob/37976b6/src/pattern/Pattern.ts#L106)
[src/pattern/Pattern.ts:106](https://github.com/jo3-l/obscenity/blob/f14df6c/src/pattern/Pattern.ts#L106)

___

Expand Down Expand Up @@ -818,7 +818,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:155](https://github.com/jo3-l/obscenity/blob/37976b6/src/censor/BuiltinStrategies.ts#L155)
[src/censor/BuiltinStrategies.ts:155](https://github.com/jo3-l/obscenity/blob/f14df6c/src/censor/BuiltinStrategies.ts#L155)

___

Expand Down Expand Up @@ -878,7 +878,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/remap-characters/index.ts:38](https://github.com/jo3-l/obscenity/blob/37976b6/src/transformer/remap-characters/index.ts#L38)
[src/transformer/remap-characters/index.ts:38](https://github.com/jo3-l/obscenity/blob/f14df6c/src/transformer/remap-characters/index.ts#L38)

___

Expand Down Expand Up @@ -911,7 +911,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/resolve-confusables/index.ts:22](https://github.com/jo3-l/obscenity/blob/37976b6/src/transformer/resolve-confusables/index.ts#L22)
[src/transformer/resolve-confusables/index.ts:22](https://github.com/jo3-l/obscenity/blob/f14df6c/src/transformer/resolve-confusables/index.ts#L22)

___

Expand Down Expand Up @@ -945,7 +945,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/resolve-leetspeak/index.ts:23](https://github.com/jo3-l/obscenity/blob/37976b6/src/transformer/resolve-leetspeak/index.ts#L23)
[src/transformer/resolve-leetspeak/index.ts:23](https://github.com/jo3-l/obscenity/blob/f14df6c/src/transformer/resolve-leetspeak/index.ts#L23)

___

Expand Down Expand Up @@ -987,7 +987,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/skip-non-alphabetic/index.ts:31](https://github.com/jo3-l/obscenity/blob/37976b6/src/transformer/skip-non-alphabetic/index.ts#L31)
[src/transformer/skip-non-alphabetic/index.ts:31](https://github.com/jo3-l/obscenity/blob/f14df6c/src/transformer/skip-non-alphabetic/index.ts#L31)

___

Expand All @@ -1014,4 +1014,4 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/to-ascii-lowercase/index.ts:18](https://github.com/jo3-l/obscenity/blob/37976b6/src/transformer/to-ascii-lowercase/index.ts#L18)
[src/transformer/to-ascii-lowercase/index.ts:18](https://github.com/jo3-l/obscenity/blob/f14df6c/src/transformer/to-ascii-lowercase/index.ts#L18)
10 changes: 5 additions & 5 deletions docs/reference/classes/DataSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const customDataset = new DataSet().addAll(englishDataset);

#### Defined in

[src/dataset/DataSet.ts:29](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L29)
[src/dataset/DataSet.ts:29](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L29)

___

Expand Down Expand Up @@ -96,7 +96,7 @@ const data = new DataSet<{ originalWord: string }>()

#### Defined in

[src/dataset/DataSet.ts:75](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L75)
[src/dataset/DataSet.ts:75](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L75)

___

Expand All @@ -122,7 +122,7 @@ const matcher = new RegExpMatcher({

#### Defined in

[src/dataset/DataSet.ts:118](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L118)
[src/dataset/DataSet.ts:118](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L118)

___

Expand Down Expand Up @@ -154,7 +154,7 @@ const phraseMetadata = matchesWithPhraseMetadata[0].phraseMetadata;

#### Defined in

[src/dataset/DataSet.ts:94](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L94)
[src/dataset/DataSet.ts:94](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L94)

___

Expand Down Expand Up @@ -184,4 +184,4 @@ const customDataset = new DataSet<{ originalWord: string }>()

#### Defined in

[src/dataset/DataSet.ts:46](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L46)
[src/dataset/DataSet.ts:46](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L46)
8 changes: 4 additions & 4 deletions docs/reference/classes/ParserError.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Error.constructor

#### Defined in

[src/pattern/ParserError.ts:18](https://github.com/jo3-l/obscenity/blob/37976b6/src/pattern/ParserError.ts#L18)
[src/pattern/ParserError.ts:18](https://github.com/jo3-l/obscenity/blob/f14df6c/src/pattern/ParserError.ts#L18)

## Properties

Expand All @@ -57,7 +57,7 @@ Note that surrogate pairs are counted as 1 column wide, not 2.

#### Defined in

[src/pattern/ParserError.ts:16](https://github.com/jo3-l/obscenity/blob/37976b6/src/pattern/ParserError.ts#L16)
[src/pattern/ParserError.ts:16](https://github.com/jo3-l/obscenity/blob/f14df6c/src/pattern/ParserError.ts#L16)

___

Expand All @@ -69,7 +69,7 @@ The line on which the error occurred (one-based).

#### Defined in

[src/pattern/ParserError.ts:10](https://github.com/jo3-l/obscenity/blob/37976b6/src/pattern/ParserError.ts#L10)
[src/pattern/ParserError.ts:10](https://github.com/jo3-l/obscenity/blob/f14df6c/src/pattern/ParserError.ts#L10)

___

Expand Down Expand Up @@ -97,7 +97,7 @@ Error.name

#### Defined in

[src/pattern/ParserError.ts:5](https://github.com/jo3-l/obscenity/blob/37976b6/src/pattern/ParserError.ts#L5)
[src/pattern/ParserError.ts:5](https://github.com/jo3-l/obscenity/blob/f14df6c/src/pattern/ParserError.ts#L5)

___

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/classes/PhraseBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Associates a pattern with this phrase.

#### Defined in

[src/dataset/DataSet.ts:149](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L149)
[src/dataset/DataSet.ts:149](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L149)

___

Expand All @@ -77,7 +77,7 @@ Associates a whitelisted pattern with this phrase.

#### Defined in

[src/dataset/DataSet.ts:159](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L159)
[src/dataset/DataSet.ts:159](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L159)

___

Expand All @@ -94,7 +94,7 @@ Builds the phrase, returning a [[PhraseContainer]] for use with the

#### Defined in

[src/dataset/DataSet.ts:178](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L178)
[src/dataset/DataSet.ts:178](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L178)

___

Expand All @@ -116,4 +116,4 @@ Associates some metadata with this phrase.

#### Defined in

[src/dataset/DataSet.ts:169](https://github.com/jo3-l/obscenity/blob/37976b6/src/dataset/DataSet.ts#L169)
[src/dataset/DataSet.ts:169](https://github.com/jo3-l/obscenity/blob/f14df6c/src/dataset/DataSet.ts#L169)
6 changes: 3 additions & 3 deletions docs/reference/classes/RegExpMatcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ console.log(matcher.getAllMatches('fu.....uuuuCK the pen is mightier than the sw

#### Defined in

[src/matcher/regexp/RegExpMatcher.ts:74](https://github.com/jo3-l/obscenity/blob/37976b6/src/matcher/regexp/RegExpMatcher.ts#L74)
[src/matcher/regexp/RegExpMatcher.ts:74](https://github.com/jo3-l/obscenity/blob/f14df6c/src/matcher/regexp/RegExpMatcher.ts#L74)

## Methods

Expand Down Expand Up @@ -121,7 +121,7 @@ otherwise, their order is unspecified.

#### Defined in

[src/matcher/regexp/RegExpMatcher.ts:86](https://github.com/jo3-l/obscenity/blob/37976b6/src/matcher/regexp/RegExpMatcher.ts#L86)
[src/matcher/regexp/RegExpMatcher.ts:87](https://github.com/jo3-l/obscenity/blob/f14df6c/src/matcher/regexp/RegExpMatcher.ts#L87)

___

Expand Down Expand Up @@ -150,4 +150,4 @@ checking the result, though it depends on the implementation.

#### Defined in

[src/matcher/regexp/RegExpMatcher.ts:116](https://github.com/jo3-l/obscenity/blob/37976b6/src/matcher/regexp/RegExpMatcher.ts#L116)
[src/matcher/regexp/RegExpMatcher.ts:120](https://github.com/jo3-l/obscenity/blob/f14df6c/src/matcher/regexp/RegExpMatcher.ts#L120)
Loading

0 comments on commit 2242235

Please sign in to comment.