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:
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"version": [2, 3000, 1023223821]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const version = [2, 3000, 1023223821] as const;
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user