Skip to content

Commit

Permalink
update husky config
Browse files Browse the repository at this point in the history
  • Loading branch information
davikstone2 committed Jan 23, 2024
1 parent 85fe873 commit 51367aa
Show file tree
Hide file tree
Showing 133 changed files with 54,014 additions and 54,014 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run pretty && npx eslint . --fix
npx eslint . --fix
144 changes: 72 additions & 72 deletions lib/helpers/qrcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,24 +518,24 @@ var QRCode;
},
getMask: function (maskPattern, i, j) {
switch (maskPattern) {
case QRMaskPattern.PATTERN000:
return (i + j) % 2 == 0;
case QRMaskPattern.PATTERN001:
return i % 2 == 0;
case QRMaskPattern.PATTERN010:
return j % 3 == 0;
case QRMaskPattern.PATTERN011:
return (i + j) % 3 == 0;
case QRMaskPattern.PATTERN100:
return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
case QRMaskPattern.PATTERN101:
return ((i * j) % 2) + ((i * j) % 3) == 0;
case QRMaskPattern.PATTERN110:
return (((i * j) % 2) + ((i * j) % 3)) % 2 == 0;
case QRMaskPattern.PATTERN111:
return (((i * j) % 3) + ((i + j) % 2)) % 2 == 0;
default:
throw new Error('bad maskPattern:' + maskPattern);
case QRMaskPattern.PATTERN000:
return (i + j) % 2 == 0;
case QRMaskPattern.PATTERN001:
return i % 2 == 0;
case QRMaskPattern.PATTERN010:
return j % 3 == 0;
case QRMaskPattern.PATTERN011:
return (i + j) % 3 == 0;
case QRMaskPattern.PATTERN100:
return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
case QRMaskPattern.PATTERN101:
return ((i * j) % 2) + ((i * j) % 3) == 0;
case QRMaskPattern.PATTERN110:
return (((i * j) % 2) + ((i * j) % 3)) % 2 == 0;
case QRMaskPattern.PATTERN111:
return (((i * j) % 3) + ((i + j) % 2)) % 2 == 0;
default:
throw new Error('bad maskPattern:' + maskPattern);
}
},
getErrorCorrectPolynomial: function (errorCorrectLength) {
Expand All @@ -548,42 +548,42 @@ var QRCode;
getLengthInBits: function (mode, type) {
if (1 <= type && type < 10) {
switch (mode) {
case QRMode.MODE_NUMBER:
return 10;
case QRMode.MODE_ALPHA_NUM:
return 9;
case QRMode.MODE_8BIT_BYTE:
return 8;
case QRMode.MODE_KANJI:
return 8;
default:
throw new Error('mode:' + mode);
case QRMode.MODE_NUMBER:
return 10;
case QRMode.MODE_ALPHA_NUM:
return 9;
case QRMode.MODE_8BIT_BYTE:
return 8;
case QRMode.MODE_KANJI:
return 8;
default:
throw new Error('mode:' + mode);
}
} else if (type < 27) {
switch (mode) {
case QRMode.MODE_NUMBER:
return 12;
case QRMode.MODE_ALPHA_NUM:
return 11;
case QRMode.MODE_8BIT_BYTE:
return 16;
case QRMode.MODE_KANJI:
return 10;
default:
throw new Error('mode:' + mode);
case QRMode.MODE_NUMBER:
return 12;
case QRMode.MODE_ALPHA_NUM:
return 11;
case QRMode.MODE_8BIT_BYTE:
return 16;
case QRMode.MODE_KANJI:
return 10;
default:
throw new Error('mode:' + mode);
}
} else if (type < 41) {
switch (mode) {
case QRMode.MODE_NUMBER:
return 14;
case QRMode.MODE_ALPHA_NUM:
return 13;
case QRMode.MODE_8BIT_BYTE:
return 16;
case QRMode.MODE_KANJI:
return 12;
default:
throw new Error('mode:' + mode);
case QRMode.MODE_NUMBER:
return 14;
case QRMode.MODE_ALPHA_NUM:
return 13;
case QRMode.MODE_8BIT_BYTE:
return 16;
case QRMode.MODE_KANJI:
return 12;
default:
throw new Error('mode:' + mode);
}
} else {
throw new Error('type:' + type);
Expand Down Expand Up @@ -942,16 +942,16 @@ var QRCode;
};
QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
switch (errorCorrectLevel) {
case QRErrorCorrectLevel.L:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
case QRErrorCorrectLevel.M:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
case QRErrorCorrectLevel.Q:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
case QRErrorCorrectLevel.H:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
default:
return undefined;
case QRErrorCorrectLevel.L:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
case QRErrorCorrectLevel.M:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
case QRErrorCorrectLevel.Q:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
case QRErrorCorrectLevel.H:
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
default:
return undefined;
}
};
function QRBitBuffer() {
Expand Down Expand Up @@ -1131,7 +1131,7 @@ var QRCode;
var Drawing = useSVG
? svgDrawer
: !_isSupportCanvas()
? (function () {
? (function () {
var Drawing = function (el, htOption) {
this._el = el;
this._htOption = htOption;
Expand Down Expand Up @@ -1197,7 +1197,7 @@ var QRCode;

return Drawing;
})()
: (function () {
: (function () {
// Drawing in Canvas
function _onMakeImage() {
this._elImage.src = this._elCanvas.toDataURL('image/png');
Expand Down Expand Up @@ -1427,18 +1427,18 @@ var QRCode;
var nLimit = 0;

switch (nCorrectLevel) {
case QRErrorCorrectLevel.L:
nLimit = QRCodeLimitLength[i][0];
break;
case QRErrorCorrectLevel.M:
nLimit = QRCodeLimitLength[i][1];
break;
case QRErrorCorrectLevel.Q:
nLimit = QRCodeLimitLength[i][2];
break;
case QRErrorCorrectLevel.H:
nLimit = QRCodeLimitLength[i][3];
break;
case QRErrorCorrectLevel.L:
nLimit = QRCodeLimitLength[i][0];
break;
case QRErrorCorrectLevel.M:
nLimit = QRCodeLimitLength[i][1];
break;
case QRErrorCorrectLevel.Q:
nLimit = QRCodeLimitLength[i][2];
break;
case QRErrorCorrectLevel.H:
nLimit = QRCodeLimitLength[i][3];
break;
}

if (length <= nLimit) {
Expand Down
2 changes: 1 addition & 1 deletion lib/saito/ui/game-cardbox/game-cardbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class GameCardbox {
*/
attachEvents() {
console.log(
"For the Saito Cardbox, don't use attachEvents, use attachCardEvents"
'For the Saito Cardbox, don\'t use attachEvents, use attachCardEvents'
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/saito/ui/game-cardfan/game-cardfan.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GameCardfan {
}

if (!cards_html) {
console.log("Error? Card Fan can't find player hand");
console.log('Error? Card Fan can\'t find player hand');
}

document.getElementById('cardfan').innerHTML = cards_html;
Expand Down
4 changes: 2 additions & 2 deletions lib/saito/ui/game-cardstack/game-cardstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ class GameCardStack {
html += `<div id="cardstack_${this.name}_${index}"
class="card-slot ${face}"
style="z-index:${index};${shift}">${this.mod.returnCardImageHTML(
card
)}</div>`;
card
)}</div>`;
index++;
}
container_obj.innerHTML = html;
Expand Down
Loading

0 comments on commit 51367aa

Please sign in to comment.