@ibiliaze/stringman 3.9.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -1
- package/dist/seat.js +2 -2
- package/dist/ticket.d.ts +5 -0
- package/dist/ticket.js +3 -1
- package/package.json +2 -2
- package/src/seat.ts +2 -2
- package/src/ticket.ts +10 -0
package/dist/index.d.ts
CHANGED
|
@@ -143,7 +143,11 @@ export declare const invalidPw: (password: string, passwordLength?: number) => s
|
|
|
143
143
|
export declare const b36: (n: number) => string;
|
|
144
144
|
export declare const luhn36: (s: string) => string;
|
|
145
145
|
export declare const ticket: {
|
|
146
|
-
getTicketId:
|
|
146
|
+
getTicketId: ({ fixtureId, sectionName, seatName, }: {
|
|
147
|
+
fixtureId: string;
|
|
148
|
+
sectionName: string;
|
|
149
|
+
seatName: string;
|
|
150
|
+
}) => string;
|
|
147
151
|
buildTicketCode: (args: {
|
|
148
152
|
venueCode: string;
|
|
149
153
|
fixtureLocalIso: string;
|
package/dist/seat.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFromItemId = exports.getItemId = exports.seatMapKey = exports.getSeatColFromName = exports.getSeatRowFromName = void 0;
|
|
4
|
-
const getSeatRowFromName = (seatName) => seatName?.split(':')?.[0];
|
|
4
|
+
const getSeatRowFromName = (seatName) => seatName?.split(':')?.[0] || 'Unassigned seat';
|
|
5
5
|
exports.getSeatRowFromName = getSeatRowFromName;
|
|
6
|
-
const getSeatColFromName = (seatName) => seatName?.split(':')?.[1];
|
|
6
|
+
const getSeatColFromName = (seatName) => seatName?.split(':')?.[1] || 'Unassigned seat';
|
|
7
7
|
exports.getSeatColFromName = getSeatColFromName;
|
|
8
8
|
const seatMapKey = (row, col) => `${row}:${col}`;
|
|
9
9
|
exports.seatMapKey = seatMapKey;
|
package/dist/ticket.d.ts
CHANGED
|
@@ -13,6 +13,11 @@ export declare const buildTicketCodeNumeric: (args: {
|
|
|
13
13
|
dashed?: boolean;
|
|
14
14
|
}) => string;
|
|
15
15
|
export declare const validateTicketCodeNumeric: (code: string) => boolean;
|
|
16
|
+
export declare const getTicketId: ({ fixtureId, sectionName, seatName, }: {
|
|
17
|
+
fixtureId: string;
|
|
18
|
+
sectionName: string;
|
|
19
|
+
seatName: string;
|
|
20
|
+
}) => string;
|
|
16
21
|
export declare const buildTicketCode: (args: {
|
|
17
22
|
venueCode: string;
|
|
18
23
|
fixtureLocalIso: string;
|
package/dist/ticket.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateTicketCode = exports.buildTicketCode = exports.validateTicketCodeNumeric = exports.buildTicketCodeNumeric = exports.rndBlockNum = exports.fixtureBlockNum = exports.seatBlockNum = exports.venueBlockNum = exports.luhn10 = void 0;
|
|
3
|
+
exports.validateTicketCode = exports.buildTicketCode = exports.getTicketId = exports.validateTicketCodeNumeric = exports.buildTicketCodeNumeric = exports.rndBlockNum = exports.fixtureBlockNum = exports.seatBlockNum = exports.venueBlockNum = exports.luhn10 = void 0;
|
|
4
4
|
const node_crypto_1 = require("node:crypto");
|
|
5
5
|
// ---------- helpers ----------
|
|
6
6
|
const pad = (n, len) => n.toString().padStart(len, '0');
|
|
@@ -110,6 +110,8 @@ const validateTicketCodeNumeric = (code) => {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
exports.validateTicketCodeNumeric = validateTicketCodeNumeric;
|
|
113
|
+
const getTicketId = ({ fixtureId, sectionName, seatName, }) => `${sectionName}-${seatName}-${fixtureId}`;
|
|
114
|
+
exports.getTicketId = getTicketId;
|
|
113
115
|
// ---------- compatibility shim (if you want same names as before) ----------
|
|
114
116
|
exports.buildTicketCode = exports.buildTicketCodeNumeric;
|
|
115
117
|
exports.validateTicketCode = exports.validateTicketCodeNumeric;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiliaze/stringman",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"pub": "npm publish --access public",
|
|
10
|
-
"git": "git add .; git commit -m 'changes'; git tag -a v3.
|
|
10
|
+
"git": "git add .; git commit -m 'changes'; git tag -a v3.11.0 -m 'v3.11.0'; git push origin v3.11.0; git push",
|
|
11
11
|
"push": "npm run build; npm run git; npm run pub"
|
|
12
12
|
},
|
|
13
13
|
"author": "Ibi Hasanli",
|
package/src/seat.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const getSeatRowFromName = (seatName: string) => seatName?.split(':')?.[0];
|
|
2
|
-
export const getSeatColFromName = (seatName: string) => seatName?.split(':')?.[1];
|
|
1
|
+
export const getSeatRowFromName = (seatName: string) => seatName?.split(':')?.[0] || 'Unassigned seat';
|
|
2
|
+
export const getSeatColFromName = (seatName: string) => seatName?.split(':')?.[1] || 'Unassigned seat';
|
|
3
3
|
|
|
4
4
|
export const seatMapKey = (row: number, col: number) => `${row}:${col}`;
|
|
5
5
|
|
package/src/ticket.ts
CHANGED
|
@@ -109,6 +109,16 @@ export const validateTicketCodeNumeric = (code: string) => {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
+
export const getTicketId = ({
|
|
113
|
+
fixtureId,
|
|
114
|
+
sectionName,
|
|
115
|
+
seatName,
|
|
116
|
+
}: {
|
|
117
|
+
fixtureId: string;
|
|
118
|
+
sectionName: string;
|
|
119
|
+
seatName: string;
|
|
120
|
+
}) => `${sectionName}-${seatName}-${fixtureId}`;
|
|
121
|
+
|
|
112
122
|
// ---------- compatibility shim (if you want same names as before) ----------
|
|
113
123
|
export const buildTicketCode = buildTicketCodeNumeric;
|
|
114
124
|
export const validateTicketCode = validateTicketCodeNumeric;
|