diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9f89119..3174ab1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 892108c..b627b2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [v1.3.1] ### Fixed - **ProfanityResolver**: Updated the `errors` object structure in `ProfanityResolver` to align with expected test output. diff --git a/package.json b/package.json index 851f7a8..ae8f709 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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" } diff --git a/src/core.ts b/src/core.ts index 4b52e02..c3793b7 100644 --- a/src/core.ts +++ b/src/core.ts @@ -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 = [];