diff --git a/dist/index.d.ts b/dist/index.d.ts index 9aded9c9..4de5ec6b 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -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; diff --git a/dist/jsQR.js b/dist/jsQR.js index f2a4caff..da70103a 100644 --- a/dist/jsQR.js +++ b/dist/jsQR.js @@ -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) { @@ -355,7 +355,8 @@ function x(data, width, height) { }, }; } -exports.default = x; +jsQR.default = jsQR; +exports.default = jsQR; /***/ }), diff --git a/docs/jsQR.js b/docs/jsQR.js index f2a4caff..da70103a 100644 --- a/docs/jsQR.js +++ b/docs/jsQR.js @@ -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) { @@ -355,7 +355,8 @@ function x(data, width, height) { }, }; } -exports.default = x; +jsQR.default = jsQR; +exports.default = jsQR; /***/ }), diff --git a/package.json b/package.json index 4f84247a..ee59093a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index 8e22bbcd..1158048e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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) { @@ -54,3 +54,6 @@ export default function x(data: Uint8ClampedArray, width: number, height: number }, }; } + +(jsQR as any).default = jsQR; +export default jsQR; diff --git a/tsconfig.json b/tsconfig.json index 2f32410c..9ffcf44e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "typeRoots": [], "declaration": true, "outDir": "./dist", - "newLine": "LF", + "newLine": "LF" }, "files": [ "./src/index.ts"