Skip to content

Commit df11ae1

Browse files
committed
fix: small api adjustments
1 parent a0e7f3c commit df11ae1

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

packages/tinyqrc/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "tinyqrc",
33
"description": "A tiny QR code generator, written in TypeScript.",
4-
"version": "0.0.2",
4+
"version": "0.0.3",
55
"author": "Christo Todorov <[email protected]>",
6+
"license": "MIT",
67
"repository": "https://github.com/chroxify/tinyqrc",
78
"keywords": [
89
"qr",
@@ -12,7 +13,6 @@
1213
"qr-code-generator-typescript",
1314
"qr-code-generator-typescript-library"
1415
],
15-
"license": "AGPL-3.0-only",
1616
"module": "src/index.ts",
1717
"exports": {
1818
".": "./src/index.ts",

packages/tinyqrc/src/codegen.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
* Copyright (c) Project Nayuki
77
*
88
* Modified by Christo Todorov <[email protected]>
9-
*
10-
* AGPL-3.0-only
11-
* Copyright (c) Christo Todorov
129
*/
1310

1411
namespace qrcodegen {

packages/tinyqrc/src/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import qrcodegen from "./codegen";
22

3-
export const ERROR_LEVEL_MAP: { [index: string]: qrcodegen.QrCode.Ecc } = {
3+
export const ERROR_CORRECTION_LEVELS: {
4+
[index: string]: qrcodegen.QrCode.Ecc;
5+
} = {
46
L: qrcodegen.QrCode.Ecc.LOW,
57
M: qrcodegen.QrCode.Ecc.MEDIUM,
68
Q: qrcodegen.QrCode.Ecc.QUARTILE,

packages/tinyqrc/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
DEFAULT_LEVEL,
66
DEFAULT_MARGIN,
77
DEFAULT_SIZE,
8-
ERROR_LEVEL_MAP,
8+
ERROR_CORRECTION_LEVELS,
99
} from "./constants";
1010
import type { ImageSettings } from "./types";
1111
import { excavateModules, getImageSettings, generatePath } from "./utils";
@@ -53,7 +53,7 @@ export function generateSVG(options: QRCodeOptions): string {
5353

5454
let cells = qrcodegen.QrCode.encodeText(
5555
value,
56-
ERROR_LEVEL_MAP[effectiveLevel]
56+
ERROR_CORRECTION_LEVELS[effectiveLevel]
5757
).getModules();
5858

5959
const numCells = cells.length + margin * 2;

0 commit comments

Comments
 (0)