diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index b1339ef..e4863b4 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -400,7 +400,8 @@ export class HTTP extends Service { async file(this: HTTP, url: string, options: FileOptions = {}): Promise { const task = await this[Context.origin].serial(this, 'http/file', url, options) if (task) return task - const capture = /^data:([\w/-]+);base64,(.*)$/.exec(url) + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types + const capture = /^data:([\w/.+-]+);base64,(.*)$/.exec(url) if (capture) { const [, type, base64] = capture let name = 'file' diff --git a/tsconfig.base.json b/tsconfig.base.json index b804dde..4274e7c 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,7 +1,8 @@ { "compilerOptions": { "target": "es2022", - "module": "nodenext", + "module": "esnext", + "moduleResolution": "bundler", "declaration": true, "emitDeclarationOnly": true, "strict": true,