I expected .addPhrase to include my added obscene term and build properly.
Actual behavior
Using .addPhrase in an Angular component and optimization: scripts = true in angular.json's build config causes the following error:
Cannot read properties of undefined (reading 'Literal');
This error prevented Angular from bootstrapping
Minimal reproducible example
Add this block to angular.json. "scripts: true" being the one that creates the issue. Seems like something to do with minification.
Edit: Thanks for the repro, I will try to take a look at this when I can, though this is almost certainly an upstream issue as opposed to a bug in the Obscenity package.
Expected behavior
I expected .addPhrase to include my added obscene term and build properly.
Actual behavior
Using .addPhrase in an Angular component and optimization: scripts = true in angular.json's build config causes the following error:
Cannot read properties of undefined (reading 'Literal')
;This error prevented Angular from bootstrapping
Minimal reproducible example
Add this block to angular.json. "scripts: true" being the one that creates the issue. Seems like something to do with minification.
"optimization": { "styles": { "minify": true, "inlineCritical": true }, "scripts": true, "fonts": true },
Import the package to a component.
import { DataSet, RegExpMatcher, englishDataset, englishRecommendedTransformers, pattern } from 'obscenity';
In ngOnInit, add custom phrases to the DataSet
...
Steps to reproduce
NOTE: This works fine in v0.1.4
englishDataset
andDataSet
englishDataset
addPhrase => addPattern
Cannot read properties of undefined (reading 'Literal')
;Additional context
No response
Node.js version
v18.12.1
Obscenity version
v0.2.0
Priority
Terms