@anytestforpm/ocr 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/ocr.js +3 -3
  2. package/package.json +1 -1
package/ocr.js CHANGED
@@ -131,10 +131,10 @@ export const recognizeOCR = async (ImageUrl) => {
131
131
  await worker.initialize(OCR_LANGUAGE_MAP[configData.region]);
132
132
 
133
133
  //OCR辨識結果的內文
134
- const result = await worker.recognize(ImageUrl);
135
- const resText = String(result.data.text);
134
+ let result = await worker.recognize(ImageUrl);
135
+ let resText = String(result.data.text);
136
136
  if (configData.region === "VN") {
137
- resText = resText.replace(" ","");
137
+ resText = resText.replace(/\s+/g,"");
138
138
  }
139
139
  console.log("OCR Text >>> ", resText);
140
140
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anytestforpm/ocr",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "",
5
5
  "main": "ocr.js",
6
6
  "scripts": {