barcode-detector-api-polyfill 1.0.4 → 1.0.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.
- package/README.md +2 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -82,3 +82,5 @@ This section here is for the curious ones who are interested in the development
|
|
|
82
82
|
The implementation of the `detect()` method was a challenge because unlike the BarcodeDetector API, ZXing doesn't have this silver bullet detection method that accepts all kinds of image sources but rather has different methods that decode from different sources (canvas, video, image, stream, etc.). Because of this, the polyfill implementation conditionally calls different methods for one-time detection based on the type of the image source.
|
|
83
83
|
|
|
84
84
|
Another challenge was to align the differences between the barcode formats of ZXing and the BarcodeDetector API. The barcode formats in ZXing are presented as a numeric `enum` while the BarcodeDetector API accepts (and returns) strings. To make the methods of the polyfill work as expected, two special map-like objects had to be created to make it possible to map barcode formats back and forth.
|
|
85
|
+
|
|
86
|
+
For the browser build we use `esbuild` due its many advantages compared to `webpack`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "barcode-detector-api-polyfill",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A polyfill for the BarcodeDetector API using the ZXing library",
|
|
6
6
|
"scripts": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
43
43
|
"@typescript-eslint/parser": "^5.62.0",
|
|
44
44
|
"canvas": "^2.11.2",
|
|
45
|
-
"esbuild": "^0.18.
|
|
46
|
-
"eslint": "^8.
|
|
45
|
+
"esbuild": "^0.18.13",
|
|
46
|
+
"eslint": "^8.45.0",
|
|
47
47
|
"jest": "^29.6.1",
|
|
48
48
|
"jest-canvas-mock": "^2.5.2",
|
|
49
49
|
"jest-environment-jsdom": "^29.6.1",
|