Commit 9be2f2b4 authored by nanahira's avatar nanahira

Update src/index.ts

parent f3869e42
Pipeline #17704 passed with stages
in 1 minute and 22 seconds
......@@ -182,12 +182,12 @@ export default class PicsContainer
);
}
async urlToBuffer(url: string, extraConfig: AxiosRequestConfig = {}) {
async urlToBuffer(url: string, extraConfig: AxiosRequestConfig = {}): Promise<Buffer> {
if (url.startsWith('base64://')) {
return Buffer.from(url.slice(9), 'base64');
}
const { data } = this._http.file(url);
return data;
const { data } = await this._http.file(url);
return data as Buffer;
}
bufferToUrl(buffer: Buffer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment