@nuintun/qrcode
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -76,7 +76,7 @@ 'use strict'; | ||
var canOverwriteImage = options.canOverwriteImage, greyScaleWeights = options.greyScaleWeights, inversionAttempts = options.inversionAttempts; | ||
var invert = inversionAttempts === 'attemptBoth' || inversionAttempts === 'invertFirst'; | ||
var tryInvertedFirst = inversionAttempts === 'onlyInvert' || inversionAttempts === 'invertFirst'; | ||
var invert = inversionAttempts === 'attemptBoth' || tryInvertedFirst; | ||
var _a = binarizer.binarize(data, width, height, invert, greyScaleWeights, canOverwriteImage), binarized = _a.binarized, inverted = _a.inverted; | ||
var result = scan(tryInvertedFirst ? inverted : binarized); | ||
if (!result && invert) { | ||
if (!result && (options.inversionAttempts === 'attemptBoth' || options.inversionAttempts === 'invertFirst')) { | ||
result = scan(tryInvertedFirst ? binarized : inverted); | ||
@@ -83,0 +83,0 @@ } |
@@ -74,7 +74,7 @@ import { __assign } from 'tslib'; | ||
var canOverwriteImage = options.canOverwriteImage, greyScaleWeights = options.greyScaleWeights, inversionAttempts = options.inversionAttempts; | ||
var invert = inversionAttempts === 'attemptBoth' || inversionAttempts === 'invertFirst'; | ||
var tryInvertedFirst = inversionAttempts === 'onlyInvert' || inversionAttempts === 'invertFirst'; | ||
var invert = inversionAttempts === 'attemptBoth' || tryInvertedFirst; | ||
var _a = binarize(data, width, height, invert, greyScaleWeights, canOverwriteImage), binarized = _a.binarized, inverted = _a.inverted; | ||
var result = scan(tryInvertedFirst ? inverted : binarized); | ||
if (!result && invert) { | ||
if (!result && (options.inversionAttempts === 'attemptBoth' || options.inversionAttempts === 'invertFirst')) { | ||
result = scan(tryInvertedFirst ? binarized : inverted); | ||
@@ -81,0 +81,0 @@ } |
{ | ||
"name": "@nuintun/qrcode", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A pure JavaScript QRCode encode and decode library.", | ||
@@ -35,3 +35,3 @@ "main": "es5/index.js", | ||
"del": "^5.1.0", | ||
"rollup": "^1.26.3", | ||
"rollup": "^1.27.2", | ||
"typescript": "^3.7.2", | ||
@@ -38,0 +38,0 @@ "acorn-walk": "^7.0.0", |
401391