thai-typo-check
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -38,3 +38,2 @@ const wordBreak = require("word-break-trie"); | ||
const inputs = sentenceSplit(correctContent(inputText)); | ||
const typos = []; | ||
@@ -46,9 +45,9 @@ for (let input of inputs) { | ||
if (!currentTrie.hasWord(last)) { | ||
typos.push(last); | ||
return `${ret}${last}`; | ||
} | ||
} | ||
} | ||
if (typos.length > 0) return typos; | ||
// return true when pass all validation | ||
else return undefined; | ||
return undefined; | ||
} | ||
@@ -55,0 +54,0 @@ |
{ | ||
"name": "thai-typo-check", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "for check thai typo", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,5 +34,4 @@ const { thaiTypoCheck, thaiTypoCheckWords } = require("."); | ||
it("returns array of typos if any", () => { | ||
const expectedArray = ["ผผผผ", "ฝฝฝฝ"]; | ||
expect(thaiTypoCheckWords("มาผผผผtestมาฝฝฝฝ")).toEqual(expectedArray); | ||
expect(thaiTypoCheckWords("มาผผผผtestมาฝฝฝฝ")).toBe("มาผผผผ"); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
858840
89