Skip to content

Commit

Permalink
update to v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SkidGod4444 committed Oct 27, 2024
1 parent fe4a870 commit f51866c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '^21.7.1'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run prepublish
- run: npm run pre-publish
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [Unreleased]
## [v1.3.1]

### Fixed
- **ProfanityResolver**: Updated the `errors` object structure in `ProfanityResolver` to align with expected test output.
Expand Down
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "profanity-validator",
"version": "1.0.0",
"description": "Profanity validation for React forms with react-hook-form & profanity.dev support",
"version": "1.3.3",
"description": "Profanity validation for React forms with react-hook-form & zod supported",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
Expand All @@ -11,14 +11,16 @@
"scripts": {
"build": "rollup -c",
"test": "jest",
"prepublish": "npm run test && npm run build"
"pre-publish": "npm run test && npm run build"
},
"keywords": [
"profanity",
"validation",
"react",
"react-hook-form",
"form"
"form",
"profanity-validator",
"profanity-guard"
],
"author": "Saidev Dhal",
"license": "MIT",
Expand Down Expand Up @@ -50,9 +52,5 @@
"bugs": {
"url": "https://github.com/SkidGod4444/profanity-validator/issues"
},
"homepage": "https://github.com/SkidGod4444/profanity-validator#readme",
"dependencies": {
"node-fetch": "^3.3.2",
"whatwg-fetch": "^3.6.20"
}
"homepage": "https://github.com/SkidGod4444/profanity-validator#readme"
}
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Profanity {
if(data){
if(this.config.heat! <= data.score) {
hasProfanity = data.isProfanity;
profaneWords = data.flaggedFor;
profaneWords = Array.isArray(data.flaggedFor) ? data.flaggedFor : [data.flaggedFor];
} else {
hasProfanity = false;
profaneWords = [];
Expand Down

0 comments on commit f51866c

Please sign in to comment.