Skip to content

Commit

Permalink
fix link for url
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed May 1, 2024
1 parent 777a39b commit 16d9461
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion adapters/mediafile/default/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class LocalMediaFileAdapter extends MediaFileAdapter_1.default {
}
};
const cfg = { ...baseConfig, ...config };
const mediafileExtension = url.match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim)[0].replace('.', '');
const isFilePath = url.match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim);
const mediafileExtension = isFilePath.length > 0 ? isFilePath[0].replace('.', '') : '';
const origin = this.getNameByUrl(url, mediafileExtension);
const name = {
origin: origin,
Expand Down
3 changes: 2 additions & 1 deletion adapters/mediafile/default/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export default class LocalMediaFileAdapter extends MediaFileAdapter {

const cfg = { ...baseConfig, ...config } as unknown as MediaFileConfigInner;

const mediafileExtension = url.match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim)[0].replace('.', '');
const isFilePath = url.match(/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim)
const mediafileExtension = isFilePath.length > 0 ? isFilePath[0].replace('.', '') : '';
const origin = this.getNameByUrl(url, mediafileExtension);

const name = {
Expand Down

0 comments on commit 16d9461

Please sign in to comment.