@marteye/studiojs 1.1.44 → 1.1.45
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.
- package/dist/index.esm.js +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -5938,7 +5938,8 @@ class CattlePassport {
|
|
|
5938
5938
|
}
|
|
5939
5939
|
static parse(code) {
|
|
5940
5940
|
let raw = code;
|
|
5941
|
-
|
|
5941
|
+
// Strip ASCII control characters (GS, CR, etc.) that barcode scanners may append
|
|
5942
|
+
let trimmed = code.replace(/[\x00-\x1F\x7F]/g, "").trim();
|
|
5942
5943
|
if (trimmed.length < CattlePassport.BARCODE_MIN_LENGTH ||
|
|
5943
5944
|
trimmed.length > CattlePassport.BARCODE_MAX_LENGTH)
|
|
5944
5945
|
return null;
|
package/dist/index.js
CHANGED
|
@@ -5942,7 +5942,8 @@ class CattlePassport {
|
|
|
5942
5942
|
}
|
|
5943
5943
|
static parse(code) {
|
|
5944
5944
|
let raw = code;
|
|
5945
|
-
|
|
5945
|
+
// Strip ASCII control characters (GS, CR, etc.) that barcode scanners may append
|
|
5946
|
+
let trimmed = code.replace(/[\x00-\x1F\x7F]/g, "").trim();
|
|
5946
5947
|
if (trimmed.length < CattlePassport.BARCODE_MIN_LENGTH ||
|
|
5947
5948
|
trimmed.length > CattlePassport.BARCODE_MAX_LENGTH)
|
|
5948
5949
|
return null;
|