@ibiliaze/stringman 3.7.0 → 3.8.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 CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './seat';
1
2
  /**
2
3
  * Clean up extra whitespace in a string.
3
4
  *
package/dist/index.js CHANGED
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.ticket = exports.luhn36 = exports.b36 = exports.invalidPw = exports.getPublicIP = exports.isVideoUrl = exports.getRandomString = exports.extractImageSrcs = exports.select = exports.query = exports.getCloudinaryPublicId = exports.dp = exports.megaTrim = exports.superTrim = void 0;
18
+ __exportStar(require("./seat"), exports);
4
19
  const ticket_1 = require("./ticket");
5
20
  /**
6
21
  * Clean up extra whitespace in a string.
package/dist/seat.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export declare const getSeatRowFromName: (seatName: string) => string;
2
+ export declare const getSeatColFromName: (seatName: string) => string;
3
+ export declare const seatMapKey: (row: number, col: number) => string;
4
+ export declare const getItemId: (fixtureId: string, sectionId: string, seatId: string) => string;
5
+ export declare const getFromItemId: (itemId: string) => {
6
+ fixtureId: string;
7
+ sectionId: string;
8
+ seatId: string;
9
+ };
package/dist/seat.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFromItemId = exports.getItemId = exports.seatMapKey = exports.getSeatColFromName = exports.getSeatRowFromName = void 0;
4
+ const getSeatRowFromName = (seatName) => seatName?.split(':')?.[0];
5
+ exports.getSeatRowFromName = getSeatRowFromName;
6
+ const getSeatColFromName = (seatName) => seatName?.split(':')?.[1];
7
+ exports.getSeatColFromName = getSeatColFromName;
8
+ const seatMapKey = (row, col) => `${row}:${col}`;
9
+ exports.seatMapKey = seatMapKey;
10
+ const getItemId = (fixtureId, sectionId, seatId) => JSON.stringify({ fixtureId, sectionId, seatId });
11
+ exports.getItemId = getItemId;
12
+ const getFromItemId = (itemId) => JSON.parse(itemId);
13
+ exports.getFromItemId = getFromItemId;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ibiliaze/stringman",
3
- "version": "3.7.0",
3
+ "version": "3.8.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.7.0 -m 'v3.7.0'; git push origin v3.7.0; git push",
10
+ "git": "git add .; git commit -m 'changes'; git tag -a v3.8.0 -m 'v3.8.0'; git push origin v3.8.0; git push",
11
11
  "push": "npm run build; npm run git; npm run pub"
12
12
  },
13
13
  "author": "Ibi Hasanli",
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './seat';
1
2
  import { buildTicketCode, fixtureBlock, getTicketId, rndBlock, seatBlock, validateTicketCode } from './ticket';
2
3
 
3
4
  /**
package/src/seat.ts ADDED
@@ -0,0 +1,10 @@
1
+ export const getSeatRowFromName = (seatName: string) => seatName?.split(':')?.[0];
2
+ export const getSeatColFromName = (seatName: string) => seatName?.split(':')?.[1];
3
+
4
+ export const seatMapKey = (row: number, col: number) => `${row}:${col}`;
5
+
6
+ export const getItemId = (fixtureId: string, sectionId: string, seatId: string) =>
7
+ JSON.stringify({ fixtureId, sectionId, seatId });
8
+
9
+ export const getFromItemId = (itemId: string): { fixtureId: string; sectionId: string; seatId: string } =>
10
+ JSON.parse(itemId);