Skip to content

Commit 8de1aa4

Browse files
authored
Merge pull request #76 from rvalitov/fix/typos
[fix] typos
2 parents 2e6590f + 101ac8b commit 8de1aa4

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/common/HTMLCanvasElementLuminanceSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class HTMLCanvasElementLuminanceSource extends LuminanceSource {
139139
tempCanvasElement.height = newHeight;
140140

141141
const tempContext = tempCanvasElement.getContext('2d');
142-
if (!tempContext) { throw new Error('Could not create a Convas Context element.'); }
142+
if (!tempContext) { throw new Error('Could not create a Canvas Context element.'); }
143143

144144
// Draw at center of temp canvas to prevent clipping of image data
145145
tempContext.translate(newWidth / 2, newHeight / 2);

src/common/IScannerControls.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export interface IScannerControls {
22
/**
3-
* Stops the scan proccess loop.
3+
* Stops the scan process loop.
44
*/
55
stop: () => void;
66
/**
7-
* @experimental This is higly unstable and Torch support is not ready on browsers. Use at YOUR OWN risk.
7+
* @experimental This is highly unstable and Torch support is not ready on browsers. Use at YOUR OWN risk.
88
*/
99
switchTorch?: (onOff: boolean) => Promise<void>;
1010
/**

src/common/navigator-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ export function hasNavigator() {
77
/**
88
* If mediaDevices under navigator is supported.
99
*/
10-
function isMediaDevicesSuported() {
10+
function isMediaDevicesSupported() {
1111
return hasNavigator() && !!navigator.mediaDevices;
1212
}
1313
/**
1414
* If enumerateDevices under navigator is supported.
1515
*/
1616
export function canEnumerateDevices() {
17-
return !!(isMediaDevicesSuported() && navigator.mediaDevices.enumerateDevices);
17+
return !!(isMediaDevicesSupported() && navigator.mediaDevices.enumerateDevices);
1818
}

src/readers/BrowserCodeReader.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class BrowserCodeReader {
5757
/**
5858
* Enables or disables the torch in a media stream.
5959
*
60-
* @experimental This doesn't work accross all browsers and is still a Draft.
60+
* @experimental This doesn't work across all browsers and is still a Draft.
6161
*/
6262
public static async mediaStreamSetTorch(track: MediaStreamTrack, onOff: boolean) {
6363
await track.applyConstraints({
@@ -199,7 +199,7 @@ export class BrowserCodeReader {
199199
*/
200200
public static isImageLoaded(img: HTMLImageElement) {
201201
// During the onload event, IE correctly identifies any images that
202-
// werent downloaded as not complete. Others should too. Gecko-based
202+
// weren't downloaded as not complete. Others should too. Gecko-based
203203
// browsers act like NS4 in that they report this incorrectly.
204204
if (!img.complete) {
205205
return false;
@@ -231,7 +231,7 @@ export class BrowserCodeReader {
231231
}
232232

233233
/**
234-
* Ovewriting this allows you to manipulate the snapshot image in anyway you want before decode.
234+
* Overwriting this allows you to manipulate the snapshot image in anyway you want before decode.
235235
*/
236236
public static drawImageOnCanvas(canvasElementContext: CanvasRenderingContext2D, srcElement: HTMLVisualMediaElement) {
237237
canvasElementContext.drawImage(srcElement, 0, 0);
@@ -252,7 +252,7 @@ export class BrowserCodeReader {
252252
};
253253
}
254254

255-
throw new Error('Couldn\'t find the Source\'s dimentions!');
255+
throw new Error('Couldn\'t find the Source\'s dimensions!');
256256
}
257257

258258
/**
@@ -765,7 +765,7 @@ export class BrowserCodeReader {
765765
*
766766
* @param {string|null} [deviceId] the id of one of the devices obtained after calling
767767
* getVideoInputDevices. Can be undefined, in this case it will decode from one of the
768-
* available devices, preffering the main camera (environment facing) if available.
768+
* available devices, preferring the main camera (environment facing) if available.
769769
* @param {string|HTMLVideoElement|null} [video] the video element in page where to show the video
770770
* while decoding. Can be either an element id or directly an HTMLVideoElement. Can be undefined,
771771
* in which case no video will be shown.
@@ -903,7 +903,7 @@ export class BrowserCodeReader {
903903
*
904904
* @param deviceId the id of one of the devices obtained after calling getVideoInputDevices.
905905
* Can be undefined, in this case it will decode from one of the available devices,
906-
* preffering the main camera (environment facing) if available.
906+
* preferring the main camera (environment facing) if available.
907907
* @param videoSource the video element in page where to show the video while decoding.
908908
* Can be either an element id or directly an HTMLVideoElement. Can be undefined,
909909
* in which case no video will be shown.
@@ -1014,7 +1014,7 @@ export class BrowserCodeReader {
10141014
*
10151015
* @param element HTML element to scan/decode from. It will not be disposed or destroyed.
10161016
* @param callbackFn Called after every scan attempt, being it successful or errored.
1017-
* @param finalizeCallback Called after scan proccess reaches the end or stop is called.
1017+
* @param finalizeCallback Called after scan process reaches the end or stop is called.
10181018
*/
10191019
public scan(
10201020
element: HTMLVisualMediaElement,

src/readers/IBrowserCodeReaderOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ export interface IBrowserCodeReaderOptions {
33
delayBetweenScanSuccess?: number;
44
/** Delay time between decode attempts made by the scanner. */
55
delayBetweenScanAttempts?: number;
6-
/** Timeout for wating the video 'canplay' event. */
6+
/** Timeout for waiting the video 'canplay' event. */
77
tryPlayVideoTimeout?: number;
88
}

0 commit comments

Comments
 (0)