(data: object)
| 33 | #credentials: Record<string, APICredential> = {}; |
| 34 | |
| 35 | deserialize(data: object) { |
| 36 | if (!data) // accepts empty config |
| 37 | data = {}; |
| 38 | if (typeof data != 'object') |
| 39 | throw new Error(`Unknown data for "apis": ${data}.`); |
| 40 | this.#credentials = {}; |
| 41 | for (const id in data) { |
| 42 | const credential = APICredential.deserialize(data[id]); |
| 43 | credential.id = id; |
| 44 | this.#credentials[id] = credential; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | serialize() { |
| 49 | const data = {}; |
nothing calls this directly
no test coverage detected