Replace deprecated assert with import attributes syntax (#1619)

* replace assert with

* assert with

* more ts way for version

* fix: remove JSON import assert syntax for Node.js compatibility

- Replace JSON imports with generated .js imports
- Fixes compatibility between Node.js versions (assert vs with syntax)
- Maintains same functionality while avoiding syntax issues
This commit is contained in:
steflsd
2025-07-27 01:59:54 +04:00
committed by GitHub
parent cdd2f0d53f
commit f61221f73a
4 changed files with 6 additions and 8 deletions
-3
View File
@@ -1,3 +0,0 @@
{
"version": [2, 3000, 1023223821]
}
+1
View File
@@ -0,0 +1 @@
export const version = [2, 3000, 1023223821] as const;
+2 -3
View File
@@ -3,9 +3,8 @@ import { makeLibSignalRepository } from '../Signal/libsignal'
import type { AuthenticationState, MediaType, SocketConfig, WAVersion } from '../Types'
import { Browsers } from '../Utils'
import logger from '../Utils/logger'
import defaultVersion from './baileys-version.json' assert { type: 'json' }
const { version } = defaultVersion
// @ts-ignore - This file is generated during build
import { version } from './baileys-version.js'
export const UNAUTHORIZED_CODES = [401, 403, 419]