Fix breaking change causing null and booleans to make a breaking error #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A change in Release 2.4.0 has made null and boolean inputs to trigger an error. This was not the case before.
`const { profanity, CensorType } = require('@2toad/profanity');
console.log(profanity.exists('I like big butts and I cannot lie'));
console.log(profanity.exists('I like cheeseburgers'));
console.log(profanity.exists(null));
console.log(profanity.exists(true));
`
`node_modules@2toad\profanity\dist\profanity.js:17
const lowercaseText = text.toLowerCase();
^
TypeError: Cannot read properties of null (reading 'toLowerCase')
at Profanity.exists (C:\Users\User\Documents\soundbites\src\soundbites\node_modules@2toad\profanity\dist\profanity.js:17:36)
at Object. (C:\Users\User\Documents\soundbites\src\soundbites\testing.js:5:23)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49`