@ericblade/quagga2 1.6.0 → 1.7.2

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/package.json CHANGED
@@ -1,53 +1,56 @@
1
1
  {
2
2
  "name": "@ericblade/quagga2",
3
- "version": "1.6.0",
3
+ "version": "1.7.2",
4
4
  "description": "An advanced barcode-scanner written in JavaScript",
5
5
  "main": "lib/quagga.js",
6
6
  "types": "type-definitions/quagga.d.ts",
7
7
  "browser": "dist/quagga.min.js",
8
+ "optionalDependencies": {
9
+ "fsevents": "2.3.2"
10
+ },
8
11
  "devDependencies": {
9
- "@babel/core": "^7.17.5",
10
- "@babel/plugin-proposal-class-properties": "^7.16.7",
11
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
12
- "@babel/plugin-proposal-object-rest-spread": "^7.17.3",
13
- "@babel/plugin-proposal-optional-chaining": "^7.16.7",
14
- "@babel/plugin-transform-runtime": "^7.17.0",
15
- "@babel/preset-env": "^7.16.11",
16
- "@babel/preset-typescript": "^7.16.7",
17
- "@babel/runtime": "^7.17.2",
18
- "@cypress/code-coverage": "^3.9.12",
19
- "@cypress/webpack-preprocessor": "5.11.1",
20
- "@types/chai": "^4.3.0",
12
+ "@babel/core": "^7.18.13",
13
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
14
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
15
+ "@babel/plugin-proposal-object-rest-spread": "^7.18.9",
16
+ "@babel/plugin-proposal-optional-chaining": "^7.18.9",
17
+ "@babel/plugin-transform-runtime": "^7.18.10",
18
+ "@babel/preset-env": "^7.18.10",
19
+ "@babel/preset-typescript": "^7.18.6",
20
+ "@babel/runtime": "^7.18.9",
21
+ "@cypress/code-coverage": "^3.10.0",
22
+ "@cypress/webpack-preprocessor": "5.12.2",
23
+ "@types/chai": "^4.3.3",
21
24
  "@types/gl-vec2": "^1.3.2",
22
- "@types/lodash": "^4.14.179",
25
+ "@types/lodash": "^4.14.184",
23
26
  "@types/mocha": "^5.2.7",
24
- "@types/sinon": "^10.0.11",
27
+ "@types/sinon": "^10.0.13",
25
28
  "@types/sinon-chai": "^3.2.8",
26
- "@typescript-eslint/eslint-plugin": "^5.13.0",
27
- "@typescript-eslint/parser": "^5.13.0",
28
- "babel-loader": "^8.2.3",
29
+ "@typescript-eslint/eslint-plugin": "^5.34.0",
30
+ "@typescript-eslint/parser": "^5.34.0",
31
+ "babel-loader": "^8.2.5",
29
32
  "babel-plugin-add-module-exports": "^1.0.4",
30
33
  "babel-plugin-istanbul": "^6.1.1",
31
34
  "chai": "^4.3.6",
32
- "core-js": "^3.21.1",
35
+ "core-js": "^3.24.1",
33
36
  "cross-env": "^7.0.3",
34
- "cypress": "^4.12.1",
35
- "eslint": "^8.10.0",
37
+ "cypress": "^10.0.0",
38
+ "eslint": "^8.22.0",
36
39
  "eslint-config-airbnb-base": "^15.0.0",
37
- "eslint-config-airbnb-typescript": "^16.1.0",
38
- "eslint-config-airbnb-typescript-base": "^3.0.1",
39
- "eslint-plugin-import": "^2.25.4",
40
- "eslint-plugin-jsx-a11y": "^6.5.1",
40
+ "eslint-config-airbnb-typescript": "^17.0.0",
41
+ "eslint-config-airbnb-typescript-base": "^4.0.2",
42
+ "eslint-plugin-import": "^2.26.0",
43
+ "eslint-plugin-jsx-a11y": "^6.6.1",
41
44
  "eslint-plugin-typescript-sort-keys": "^2.1.0",
42
45
  "esm": "^3.2.25",
43
46
  "mocha": "^5.2.0",
44
47
  "nyc": "^15.1.0",
45
- "sinon": "^13.0.1",
48
+ "sinon": "^14.0.0",
46
49
  "sinon-chai": "^3.7.0",
47
50
  "source-map-loader": "^1.1.1",
48
- "ts-mocha": "^9.0.2",
49
- "ts-node": "^10.6.0",
50
- "typescript": "^4.6.2",
51
+ "ts-mocha": "^10.0.0",
52
+ "ts-node": "^10.9.1",
53
+ "typescript": "^4.7.4",
51
54
  "webpack": "^4.44.2",
52
55
  "webpack-cli": "^3.3.12"
53
56
  },
@@ -75,7 +78,7 @@
75
78
  "build": "npm run check-types && npm run build:dev && npm run build:prod && npm run build:node",
76
79
  "watch": "npx cross-env BUILD_ENV=development webpack --watch",
77
80
  "lint": "eslint src",
78
- "upgrade-deps": "npx npm-check-updates && npm install"
81
+ "upgrade-deps": "npx npm-check-updates --doctor"
79
82
  },
80
83
  "repository": {
81
84
  "type": "git",
@@ -129,7 +132,8 @@
129
132
  "Tony Brix <tony@brix.ninja>",
130
133
  "Alex Howes <alex@alexhowes.co.uk>",
131
134
  "Sudham Jayanthi <workwithsudham@gmail.com>",
132
- "Ben Khoo <khoobks@gmail.com>"
135
+ "Ben Khoo <khoobks@gmail.com>",
136
+ "Andy Edinborough <andy@edinborough.org>"
133
137
  ],
134
138
  "license": "MIT",
135
139
  "engines": {
package/tsconfig.json CHANGED
@@ -7,8 +7,13 @@
7
7
  "sourceMap": true /* Generates corresponding '.map' file. */,
8
8
  "target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
9
9
  "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
10
+ "lib": [
11
+ "es2015",
12
+ "dom"
13
+ ] /* Specify library files to be included in the compilation. */,
10
14
  "types": [
11
15
  "mocha",
16
+ "node"
12
17
  ] /* Type declaration files to be included in compilation. */,
13
18
  "module": "esNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
14
19
  "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
@@ -209,7 +209,7 @@ export declare module Readers {
209
209
  FORMAT: string;
210
210
  SINGLE_CODE_ERROR: number;
211
211
  AVG_CODE_ERROR: number;
212
-
212
+
213
213
  decode(row?: Array<number>, start?: BarcodePosition): Barcode | null;
214
214
 
215
215
  protected _findPattern(pattern: ReadonlyArray<number>, offset: number, isWhite?: boolean, tryHarder?: boolean): BarcodeInfo | null;
@@ -229,7 +229,7 @@ export declare module Readers {
229
229
 
230
230
  export class NewCodabarReader extends BarcodeReader {
231
231
  FORMAT: string;
232
-
232
+
233
233
  decode(row?: Array<number>, start?: BarcodePosition | number | null): Barcode | null;
234
234
 
235
235
  protected _computeAlternatingThreshold(offset: number, end: number): number;
@@ -298,7 +298,7 @@ export declare module Readers {
298
298
 
299
299
  export class Code39Reader extends BarcodeReader {
300
300
  FORMAT: string;
301
-
301
+
302
302
  decode(row?: Array<number>, start?: BarcodePosition | number | null): Barcode | null;
303
303
 
304
304
  protected _findStart(): BarcodePosition | null;
@@ -552,16 +552,17 @@ export interface QuaggaJSStatic {
552
552
  * Used for accessing information about the active stream track and available video devices.
553
553
  */
554
554
  export interface QuaggaJSCameraAccess {
555
- requestedVideoElement: HTMLVideoElement | null,
556
- request(video: HTMLVideoElement | null, videoConstraints?: MediaTrackConstraintsWithDeprecated): Promise<void> | never;
557
-
558
- release(): Promise<void>;
559
-
555
+ disableTorch(): Promise<void>;
556
+ enableTorch(): Promise<void>;
560
557
  enumerateVideoDevices(): Promise<MediaDeviceInfo[]> | never;
561
-
562
558
  getActiveStreamLabel(): string;
563
-
564
559
  getActiveTrack(): MediaStreamTrack | null;
560
+ release(): Promise<void>;
561
+ request(
562
+ video: HTMLVideoElement | null,
563
+ videoConstraints?: MediaTrackConstraintsWithDeprecated
564
+ ): Promise<void> | never;
565
+ requestedVideoElement: HTMLVideoElement | null;
565
566
  }
566
567
 
567
568
  /**
@@ -752,7 +753,7 @@ export interface QuaggaJSConfigObject {
752
753
  * Ex: '/test/fixtures/code_128/image-001.jpg'
753
754
  * or: 'data:image/jpg;base64,' + data
754
755
  */
755
- src?: string;
756
+ src?: string | Uint8Array | Buffer;
756
757
 
757
758
  inputStream?: {
758
759
  /**
@@ -800,6 +801,8 @@ export interface QuaggaJSConfigObject {
800
801
  bottom?: string;
801
802
  };
802
803
 
804
+ mime?: string;
805
+
803
806
  singleChannel?: boolean;
804
807
  size?: number;
805
808
  sequence?: boolean;
package/CHANGELOG.md DELETED
@@ -1,213 +0,0 @@
1
-
2
- # Changelog
3
-
4
- - Future changelogs will be posted to the github [releases page](https://github.com/ericblade/quagga2/releases)
5
-
6
- ### 2019-08-13
7
- - Forked to @ericblade/quagga2
8
- - Significantly decrease npm package size by not adding files that were not needed
9
- - Clarify iOS support in documentation
10
- - Updated typescript typings
11
- - drawRect accepts style.lineWidth
12
-
13
- ### 2017-06-07
14
- - Improvements
15
- - added `muted` and `playsinline` to `<video/>` to make it work for Safari 11
16
- Beta (even iOS)
17
- - Fixes
18
- - Fixed [example/live_w_locator.js](https://github.com/serratus/quaggaJS/blob/master/example/live_w_locator.js)
19
-
20
- ### 2017-06-06
21
- - Features
22
- - Support for Standard 2of5 barcodes (See
23
- [\#194](https://github.com/serratus/quaggaJS/issues/194))
24
- - Support for Code 93 barcodes (See
25
- [\#194](https://github.com/serratus/quaggaJS/issues/195))
26
- - Exposing `Quagga.CameraAccess.getActiveTrack()` to get access to the
27
- currently used `MediaStreamTrack`
28
- - Example can be viewed here: [example/live_w_locator.js](https://github.com/serratus/quaggaJS/blob/master/example/live_w_locator.js) and a [demo](https://serratus.github.io/quaggaJS/examples/live_w_locator.html)
29
-
30
- Take a look at the release-notes (
31
- [0.12.0](https://github.com/serratus/quaggaJS/releases/tag/v0.12.0))
32
-
33
- ### 2017-01-08
34
- - Improvements
35
- - Exposing `CameraAccess` module to get access to methods like
36
- `enumerateVideoDevices` and `getActiveStreamLabel`
37
- (see `example/live_w_locator`)
38
- - Update to webpack 2.2 (API is still unstable)
39
-
40
- ### 2016-10-03
41
- - Fixes
42
- - Fixed `facingMode` issue with Chrome >= 53 (see [#128](https://github.com/serratus/quaggaJS/issues/128))
43
-
44
- ### 2016-08-15
45
- - Features
46
- - Proper handling of EXIF orientation when using `Quagga.decodeSingle`
47
- (see [#121](https://github.com/serratus/quaggaJS/issues/121))
48
-
49
- ### 2016-04-24
50
- - Features
51
- - EAN-13 extended codes can now be decoded (See
52
- [\#71](https://github.com/serratus/quaggaJS/issues/71))
53
-
54
- Take a look at the release-notes (
55
- [0.11.0](https://github.com/serratus/quaggaJS/releases/tag/v0.11.0))
56
-
57
- ### 2016-04-19
58
- - Improvements
59
- - Reducing false-positives for Code 128 barcodes (
60
- addresses [\#104](https://github.com/serratus/quaggaJS/issues/104))
61
-
62
- ### 2016-03-31
63
- Take a look at the release-notes (
64
- [0.10.0](https://github.com/serratus/quaggaJS/releases/tag/v0.10.0))
65
-
66
- ### 2016-02-18
67
-
68
- - Internal Changes
69
- - Restructuring into meaningful folders
70
- - Removing debug-code in production build
71
-
72
-
73
- ### 2016-02-15
74
- Take a look at the release-notes (
75
- [0.9.0](https://github.com/serratus/quaggaJS/releases/tag/v0.9.0))
76
-
77
- ### 2015-11-22
78
-
79
- - Fixes
80
- - Fixed inconsistencies for Code 128 decoding (See
81
- [\#76](https://github.com/serratus/quaggaJS/issues/76))
82
-
83
- ### 2015-11-15
84
-
85
- - Fixes
86
- - Fixed inconsistency in Code 39 decoding
87
- - added inline-source-map to quagga.js file
88
-
89
- ### 2015-10-13
90
- Take a look at the release-notes ([0.8.0]
91
- (https://github.com/serratus/quaggaJS/releases/tag/v0.8.0))
92
-
93
- - Improvements
94
- - Replaced RequireJS with webpack
95
-
96
- ### 2015-09-15
97
- Take a look at the release-notes ([0.7.0]
98
- (https://github.com/serratus/quaggaJS/releases/tag/v0.7.0))
99
-
100
- - Features
101
- - Added basic support for running QuaggaJS inside __node__ (see [example]
102
- (#node-example))
103
-
104
- ### 2015-08-29
105
- - Improvements
106
- - Added support for Internet Explorer (only Edge+ supports `getUserMedia`)
107
-
108
- ### 2015-08-13
109
- - Improvements
110
- - Added `offProcessed` and `offDetected` methods for detaching event-
111
- listeners from the event-queue.
112
-
113
- ### 2015-07-29
114
- - Features
115
- - Added basic support for [ITF][i2of5_wiki] barcodes (`i2of5_reader`)
116
-
117
- ### 2015-07-08
118
- - Improvements
119
- - Parameter tweaking to reduce false-positives significantly (for the
120
- entire EAN and UPC family)
121
- - Fixing bug in parity check for UPC-E codes
122
- - Fixing bug in alignment for EAN-8 codes
123
-
124
- ### 2015-07-06
125
- - Improvements
126
- - Added `err` parameter to [Quagga.init()](#quaggainit) callback
127
- function
128
-
129
- ### 2015-06-21
130
- - Features
131
- - Added ``singleChannel`` configuration to ``inputStream`` (in [config]
132
- (#configobject))
133
- - Added ``ResultCollector`` functionality (see [ResultCollector]
134
- (#resultcollector))
135
-
136
- ### 2015-06-13
137
- - Improvements
138
- - Added ``format`` property to ``codeResult`` (in [result](#resultobject))
139
-
140
- ### 2015-06-13
141
- - Improvements
142
- - Added fixes for ``Code39Reader`` (trailing whitespace was missing)
143
-
144
- ### 2015-06-09
145
- - Features
146
- - Introduced the ``area`` property
147
- - Ability to define a rectangle where localization/decoding should be applied
148
-
149
- ### 2015-05-20
150
- - Improvements
151
- - Making EAN and UPC readers even more restrictive
152
- - Added example using requirejs
153
-
154
- ### 2015-05-18
155
- - Improvements
156
- - Making EAN and UPC readers more restrictive
157
- - Added integration-tests for all barcode-readers
158
-
159
- ### 2015-05-09
160
- - Improvements
161
- - Odd image dimensions no longer cause problems
162
-
163
- ### 2015-04-30
164
- - Features
165
- - Added support for [UPC-A and UPC-E][upc_wiki] barcodes
166
- - Added support for [EAN-8][ean_8_wiki] barcodes
167
- - Improvements
168
- - Added extended configuration to the live-video example
169
- - Releasing resources when calling ``Quagga.stop()``
170
-
171
- ### 2015-04-25
172
- - Improvements
173
- - Added extended configuration to the file-input example
174
- - Configurable ``patchSize`` for better adjustment to small/medium/large
175
- barcodes
176
-
177
- ### 2015-04-16
178
- - Features
179
- - Added support for [Codabar][codabar_wiki] barcodes
180
-
181
- ### 2015-03-16
182
- - Improvements
183
- - now includes minified version (23.3KB gzipped)
184
- - No need for configuration of script-name any more
185
-
186
- ### 2015-03-12
187
- - Improvements
188
- - removed dependency on async.js
189
-
190
- ### 2015-03-04
191
- - Features
192
- - Added support for [Code 39][code39_wiki] barcodes
193
-
194
- ### 2015-01-21
195
- - Features
196
- - Added support for web-worker (using 4 workers as default, can be changed
197
- through `config.numOfWorkers`)
198
- - Due to the way how web-workers are created, the name of the script file
199
- (`config.scriptName`) should be kept in sync with your actual filename
200
- - Removed canvas-overlay for decoding (boxes & scanline) which can now be
201
- easily implemented using the existing API (see example)
202
- - API Changes
203
- In the course of implementing web-workers some breaking changes were
204
- introduced to the API.
205
- - The `Quagga.init` function no longer receives the callback as part of the
206
- config but rather as a second argument: `Quagga.init(config, cb)`
207
- - The callback to `Quagga.onDetected` now receives an object containing
208
- much more information in addition to the decoded code.(see
209
- [data](#resultobject))
210
- - Added `Quagga.onProcessed(callback)` which provides a way to get information
211
- for each image processed. The callback receives the same `data` object as
212
- `Quagga.onDetected` does. Depending on the success of the process the `data`
213
- object might not contain any `resultCode` and/or `box` properties.