Skip to content

Commit f9e5cd4

Browse files
committed
chore: update
1 parent b80b082 commit f9e5cd4

File tree

7 files changed

+538
-900
lines changed

7 files changed

+538
-900
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "@devmehq/react-qr-code",
33
"version": "1.0.9",
4-
"private": false,
54
"description": "React component to generate QR codes",
65
"keywords": [
76
"react",
@@ -43,7 +42,7 @@
4342
"build": "rollup -c rollup.config.mjs",
4443
"build:prod": "NODE_ENV=production rollup -c rollup.config.mjs",
4544
"lint-js": "eslint src/**/*.ts",
46-
"prepare": "yarn husky install",
45+
"prepare": "husky",
4746
"prepublishOnly": "rm -rf dist/* && NODE_ENV=production rollup -c rollup.config.mjs",
4847
"prettier": "prettier --write '**/*.{ts,tsx,css,scss}'",
4948
"test": "echo \"Error: no test specified\"",
@@ -63,13 +62,13 @@
6362
"@types/jest": "30.0.0",
6463
"@types/react": "19.1.12",
6564
"@types/react-dom": "19.1.9",
66-
"@typescript-eslint/eslint-plugin": "8.41.0",
67-
"@typescript-eslint/parser": "8.41.0",
68-
"eslint": "9.34.0",
65+
"@typescript-eslint/eslint-plugin": "8.42.0",
66+
"@typescript-eslint/parser": "8.42.0",
67+
"eslint": "9.35.0",
6968
"eslint-config-prettier": "10.1.8",
7069
"husky": "9.1.7",
71-
"jest": "30.1.1",
72-
"lint-staged": "16.1.5",
70+
"jest": "30.1.3",
71+
"lint-staged": "16.1.6",
7372
"prettier": "3.6.2",
7473
"pretty-quick": "4.2.2",
7574
"rollup": "4.50.0",
@@ -81,5 +80,6 @@
8180
"peerDependencies": {
8281
"react": ">=17.0.2",
8382
"react-dom": ">=17.0.2"
84-
}
83+
},
84+
"packageManager": "[email protected]"
8585
}

src/qr-js/js-qr-code.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ function JsQrCode(typeNumber: any, errorCorrectLevel: any) {
1717
const proto = JsQrCode.prototype
1818

1919
proto.addData = function (data: any) {
20-
var newData = new QR8bitByte(data)
20+
const newData = new QR8bitByte(data)
2121
this.dataList.push(newData)
2222
this.dataCache = null
2323
}
2424

25-
proto.isDark = function (row: string | number, col: string | number) {
25+
proto.isDark = function (row: number, col: number) {
2626
if (
2727
row < 0 ||
2828
this.moduleCount <= row ||

src/qr-js/qr-8-bit-byte.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { qrModeEnum } from './qr-mode-enum'
22

3-
function QR8bitByte(data) {
3+
function QR8bitByte(data: number[]) {
44
this.mode = qrModeEnum.MODE_8BIT_BYTE
55
this.data = data
66
}

src/qr-js/qr-bit-buffer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ function QrBitBuffer() {
44
}
55

66
QrBitBuffer.prototype = {
7-
get: function (index) {
7+
get: function (index: number) {
88
const bufIndex = Math.floor(index / 8)
99
return ((this.buffer[bufIndex] >>> (7 - (index % 8))) & 1) == 1
1010
},
1111

12-
put: function (num, length) {
12+
put: function (num: number, length: number) {
1313
for (let i = 0; i < length; i++) {
1414
this.putBit(((num >>> (length - i - 1)) & 1) == 1)
1515
}

src/qr-js/qr-rs-block.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,15 @@ function getRsBlockTable(typeNumber, errorCorrectLevel) {
262262
}
263263
}
264264

265-
function QRRSBlock(totalCount, dataCount?) {
265+
function QRRSBlock(totalCount: number, dataCount?: number) {
266266
this.totalCount = totalCount
267267
this.dataCount = dataCount
268268
}
269269

270-
QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
270+
QRRSBlock.getRSBlocks = function (
271+
typeNumber: number,
272+
errorCorrectLevel: number
273+
) {
271274
const rsBlock = getRsBlockTable(typeNumber, errorCorrectLevel)
272275

273276
if (rsBlock == undefined) {

src/qr-js/qr-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const QRUtil = {
136136
return a
137137
},
138138

139-
getLengthInBits: function (mode: number, type: string | number) {
139+
getLengthInBits: function (mode: number, type: number) {
140140
if (1 <= type && type < 10) {
141141
// 1 - 9
142142

0 commit comments

Comments
 (0)