Skip to content

Commit

Permalink
Correct default imports (#51)
Browse files Browse the repository at this point in the history
* Correct export default export

* 1.0.4
  • Loading branch information
cozmo authored Mar 2, 2018
1 parent 03595aa commit d37c764
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface QRCode {
bottomRightAlignmentPattern?: Point;
};
}
export default function x(data: Uint8ClampedArray, width: number, height: number): QRCode | null;
declare function jsQR(data: Uint8ClampedArray, width: number, height: number): QRCode | null;
export default jsQR;
5 changes: 3 additions & 2 deletions dist/jsQR.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ var binarizer_1 = __webpack_require__(4);
var decoder_1 = __webpack_require__(5);
var extractor_1 = __webpack_require__(11);
var locator_1 = __webpack_require__(12);
function x(data, width, height) {
function jsQR(data, width, height) {
var binarized = binarizer_1.binarize(data, width, height);
var location = locator_1.locate(binarized);
if (!location) {
Expand All @@ -355,7 +355,8 @@ function x(data, width, height) {
},
};
}
exports.default = x;
jsQR.default = jsQR;
exports.default = jsQR;


/***/ }),
Expand Down
5 changes: 3 additions & 2 deletions docs/jsQR.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ var binarizer_1 = __webpack_require__(4);
var decoder_1 = __webpack_require__(5);
var extractor_1 = __webpack_require__(11);
var locator_1 = __webpack_require__(12);
function x(data, width, height) {
function jsQR(data, width, height) {
var binarized = binarizer_1.binarize(data, width, height);
var location = locator_1.locate(binarized);
if (!location) {
Expand All @@ -355,7 +355,8 @@ function x(data, width, height) {
},
};
}
exports.default = x;
jsQR.default = jsQR;
exports.default = jsQR;


/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsqr",
"version": "1.0.3",
"version": "1.0.4",
"description": "A pure javascript QR code reading library that takes in raw images and will locate, extract and parse any QR code found within.",
"repository": "https://github.com/cozmo/jsQR",
"main": "./dist/jsQR.js",
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface QRCode {
};
}

export default function x(data: Uint8ClampedArray, width: number, height: number): QRCode | null {
function jsQR(data: Uint8ClampedArray, width: number, height: number): QRCode | null {
const binarized = binarize(data, width, height);
const location = locate(binarized);
if (!location) {
Expand Down Expand Up @@ -54,3 +54,6 @@ export default function x(data: Uint8ClampedArray, width: number, height: number
},
};
}

(jsQR as any).default = jsQR;
export default jsQR;
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"typeRoots": [],
"declaration": true,
"outDir": "./dist",
"newLine": "LF",
"newLine": "LF"
},
"files": [
"./src/index.ts"
Expand Down

0 comments on commit d37c764

Please sign in to comment.