flamerest 1.0.123 → 1.0.124

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.
Files changed (2) hide show
  1. package/REST.ts +3 -2
  2. package/package.json +1 -1
package/REST.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { createHmac } from 'crypto';
2
-
3
1
  /**
4
2
  * Базовый ответ от сервера
5
3
  */
@@ -797,6 +795,9 @@ export class FLAMEREST {
797
795
  const key = encodedKey;
798
796
 
799
797
  if (typeof window === 'undefined') {
798
+ // Динамически импортируем модуль 'crypto' для Node.js, чтобы избежать ошибок на фронтенде,
799
+ // где этот модуль недоступен.
800
+ const { createHmac } = await import('crypto');
800
801
  const hash = createHmac('sha256', key).update(data).digest('hex');
801
802
  return Promise.resolve(hash);
802
803
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flamerest",
3
- "version": "1.0.123",
3
+ "version": "1.0.124",
4
4
  "description": "",
5
5
  "main": "./REST.ts",
6
6
  "typings": "./REST.ts",