Skip to content

Commit

Permalink
Fixed method name typo
Browse files Browse the repository at this point in the history
  • Loading branch information
samsam2310 committed Jun 5, 2020
1 parent 6ad1ad2 commit dda7a84
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zbar.wasm",
"version": "2.0.1",
"version": "2.0.2",
"description": "A wasm build of C/C++ Zbar barcode scanning library.",
"main": "dist/index.js",
"browser": {
Expand Down
2 changes: 1 addition & 1 deletion src/Image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class Image extends CppObject {
return new this(ptr, inst);
}

destory(): void {
destroy(): void {
this.checkAlive();
this.inst.Image_destory(this.ptr);
this.ptr = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/ImageScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ImageScanner extends CppObject {
return new this(ptr, inst);
}

destory(): void {
destroy(): void {
this.checkAlive();
this.inst.ImageScanner_destory(this.ptr);
this.ptr = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const scanGrayBuffer = async (
): Promise<Array<Symbol>> => {
const image = await Image.createFromGrayBuffer(width, height, buffer);
const res = await scanImage(image, scanner);
image.destory();
image.destroy();
return res;
};

Expand All @@ -42,7 +42,7 @@ export const scanRGBABuffer = async (
): Promise<Array<Symbol>> => {
const image = await Image.createFromRGBABuffer(width, height, buffer);
const res = await scanImage(image, scanner);
image.destory();
image.destroy();
return res;
};

Expand Down
8 changes: 4 additions & 4 deletions src/test/Image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ test('Image', async () => {
image = await Image.createFromGrayBuffer(2, 2, data.buffer);
syms = image.getSymbols();
expect(syms).toHaveLength(0);
image.destory();
image.destroy();
expect(() => {
image.destory();
image.destroy();
}).toThrow('Call after destroyed');
expect(() => {
image.getSymbols();
Expand All @@ -18,9 +18,9 @@ test('Image', async () => {
image = await Image.createFromRGBABuffer(1, 1, data.buffer);
syms = image.getSymbols();
expect(syms).toHaveLength(0);
image.destory();
image.destroy();
expect(() => {
image.destory();
image.destroy();
}).toThrow('Call after destroyed');
expect(() => {
image.getSymbols();
Expand Down
6 changes: 3 additions & 3 deletions src/test/ImageScanner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test('ImageScanner', async () => {
).toEqual(0);
expect(scanner.setConfig(87, ZBarConfigType.ZBAR_CFG_ENABLE, 0)).toEqual(1);

image.destory();
image.destroy();
expect(() => {
scanner.scan(image);
}).toThrow('Call after destroyed');
Expand All @@ -33,9 +33,9 @@ test('ImageScanner', async () => {
}).toThrow('Call after destroyed');

image = await Image.createFromGrayBuffer(2, 2, data.buffer);
scanner.destory();
scanner.destroy();
expect(() => {
scanner.destory();
scanner.destroy();
}).toThrow('Call after destroyed');
expect(() => {
scanner.getResults();
Expand Down
2 changes: 1 addition & 1 deletion src/test/module.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ test('Barcode', async () => {
expect(res[0].type).toEqual(ZBarSymbolType.ZBAR_EAN13);
expect(res[0].decode()).toEqual('9781234567897');

scanner.destory();
scanner.destroy();
expect(scanImageData(img5, scanner)).rejects.toThrow('Call after destroyed');
});

0 comments on commit dda7a84

Please sign in to comment.