( host, username = "anonymous", password = "", port = 21, security = "ftp", mode = "passive", path = "/", )
| 21 | #try = 0; |
| 22 | |
| 23 | constructor( |
| 24 | host, |
| 25 | username = "anonymous", |
| 26 | password = "", |
| 27 | port = 21, |
| 28 | security = "ftp", |
| 29 | mode = "passive", |
| 30 | path = "/", |
| 31 | ) { |
| 32 | if (!host) { |
| 33 | throw new Error("host is required"); |
| 34 | } |
| 35 | this.#host = host; |
| 36 | this.#username = username; |
| 37 | this.#password = password; |
| 38 | this.#port = port; |
| 39 | this.#security = security; |
| 40 | this.#mode = mode; |
| 41 | this.#path = path; |
| 42 | |
| 43 | this.#origin = Url.formate({ |
| 44 | protocol: "ftp:", |
| 45 | hostname: this.#host, |
| 46 | password: this.#password, |
| 47 | username: this.#username, |
| 48 | port: this.#port, |
| 49 | query: { |
| 50 | security: this.#security, |
| 51 | mode: this.#mode, |
| 52 | }, |
| 53 | }); |
| 54 | } |
| 55 | |
| 56 | connect() { |
| 57 | return new Promise((resolve, reject) => { |
nothing calls this directly
no outgoing calls
no test coverage detected