File size: 507 Bytes
f6f0c71
acf17aa
f6f0c71
 
 
 
 
 
 
 
 
acf17aa
f6f0c71
acf17aa
f6f0c71
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { scribdDownloader } from "./service/ScribdDownloader.js"
import * as scribdRegex from "./const/ScribdRegex.js"

class App {
    constructor() {
        if (!App.instance) {
            App.instance = this
        }
        return App.instance
    }

    async execute(url, flag) {
        if (url.match(scribdRegex.DOMAIN)) {
            await scribdDownloader.execute(url, flag)
        } else {
            throw new Error(`Unsupported URL: ${url}`)
        }
    }
}

export const app = new App()