remove duplicate method

This commit is contained in:
dakkar 2024-03-02 17:34:31 +00:00
parent 23f476dbf3
commit 6ecfe7c7c3

View file

@ -130,17 +130,6 @@ export class ImportNotesProcessorService {
return typeof obj[Symbol.iterator] === 'function'; return typeof obj[Symbol.iterator] === 'function';
} }
private parseTwitterFile(str : string) : null | [{ tweet: any }] {
const removed = str.replace(new RegExp('window\\.YTD\\.tweets\\.part0 = ', 'g'), '');
try {
return JSON.parse(removed);
} catch (error) {
//The format is not what we expected. Either this file was tampered with or twitters exports changed
return null;
}
}
@bindThis @bindThis
private parseTwitterFile(str : string) : { tweet: object }[] { private parseTwitterFile(str : string) : { tweet: object }[] {
const jsonStr = str.replace(/^\s*window\.YTD\.tweets\.part0\s*=\s*/, ''); const jsonStr = str.replace(/^\s*window\.YTD\.tweets\.part0\s*=\s*/, '');