nexushub-commands 1.1.3 → 1.1.4

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.
@@ -9,6 +9,8 @@ const formatMessage_1 = require("../../utils/formatMessage");
9
9
  const GetDepositOrder_command_1 = require("./GetDepositOrder.command");
10
10
  // Функция для маскировки реквизитов: оставляет только последние 4 не пробельных символа
11
11
  function maskExceptLast4(str) {
12
+ if (!str)
13
+ return '';
12
14
  const chars = str.split('');
13
15
  let nonSpaceCount = 0;
14
16
  for (let i = chars.length - 1; i >= 0; i--) {
@@ -90,7 +92,7 @@ let DepositCommand = class DepositCommand extends evogram_1.Command {
90
92
  : ``}`, {
91
93
  // prettier-ignore
92
94
  message: order.card ?
93
- `<b>💳 Реквизиты:</b> <code>${maskExceptLast4(order.requisites)}</code>\n` +
95
+ `<b>💳 Реквизиты:</b> <code>${maskExceptLast4(order.card.requisites)}</code>\n` +
94
96
  `<b>👩🏻‍💼 Получатель:</b> ${order.card.holder || '-'}`
95
97
  : '',
96
98
  keyboard: [[{ text: '🚀 Оплатить счет', callback_data: `PaidOrderCommand?orderId=${order.id}` }]],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -6,6 +6,8 @@ import { GetDepositOrderCommand } from './GetDepositOrder.command';
6
6
 
7
7
  // Функция для маскировки реквизитов: оставляет только последние 4 не пробельных символа
8
8
  function maskExceptLast4(str: string): string {
9
+ if (!str) return '';
10
+
9
11
  const chars = str.split('');
10
12
  let nonSpaceCount = 0;
11
13
  for (let i = chars.length - 1; i >= 0; i--) {
@@ -240,7 +242,7 @@ export class DepositCommand extends Command {
240
242
  // prettier-ignore
241
243
  message:
242
244
  order.card ?
243
- `<b>💳 Реквизиты:</b> <code>${maskExceptLast4(order.requisites)}</code>\n` +
245
+ `<b>💳 Реквизиты:</b> <code>${maskExceptLast4(order.card.requisites)}</code>\n` +
244
246
  `<b>👩🏻‍💼 Получатель:</b> ${order.card.holder || '-'}`
245
247
  : '',
246
248
  keyboard: [[{ text: '🚀 Оплатить счет', callback_data: `PaidOrderCommand?orderId=${order.id}` }]],