mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add "strictNullChecks"
This commit is contained in:
@@ -15,12 +15,12 @@ import { BufferJSON } from './generics'
|
||||
export const useMultiFileAuthState = async(folder: string): Promise<{ state: AuthenticationState, saveCreds: () => Promise<void> }> => {
|
||||
|
||||
const writeData = (data: any, file: string) => {
|
||||
return writeFile(join(folder, fixFileName(file)), JSON.stringify(data, BufferJSON.replacer))
|
||||
return writeFile(join(folder, fixFileName(file)!), JSON.stringify(data, BufferJSON.replacer))
|
||||
}
|
||||
|
||||
const readData = async(file: string) => {
|
||||
try {
|
||||
const data = await readFile(join(folder, fixFileName(file)), { encoding: 'utf-8' })
|
||||
const data = await readFile(join(folder, fixFileName(file)!), { encoding: 'utf-8' })
|
||||
return JSON.parse(data, BufferJSON.reviver)
|
||||
} catch(error) {
|
||||
return null
|
||||
@@ -29,7 +29,7 @@ export const useMultiFileAuthState = async(folder: string): Promise<{ state: Aut
|
||||
|
||||
const removeData = async(file: string) => {
|
||||
try {
|
||||
await unlink(fixFileName(file))
|
||||
await unlink(fixFileName(file)!)
|
||||
} catch{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user