Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: renameOutputFile #17

Conversation

richex-cn
Copy link
Contributor

#16

@richex-cn
Copy link
Contributor Author

richex-cn commented Oct 21, 2023

这里默认使用 [hash][ext] 后,filename 始终有一个正确的值,使用 hash+ext 的 path 属性我在项目其他位置没找到有特别用途,是不是没必要增加一个 filename 属性,直接赋值给 path 就行了? @KonghaYao

filename,
path: hashName + ext,

@richex-cn
Copy link
Contributor Author

还有个问题是关于哈希生成的,例如开发者使用自增文件名或者自行生成并未使用到 hash 的情况,这里生成 hash 是不是多余了可以删掉以优化分包速度?

const hashName = md5(transferred);

我找了下项目中唯一用到 hash 的地方是在日志输出的时候,所以看起来没用到 hash 时不输出也没有什么影响。

@KonghaYao
Copy link
Owner

对的,上面提到的两点都可以的,我会合入之后处理一下的,真是太感谢你了😊。

@KonghaYao KonghaYao merged commit 192594b into KonghaYao:feature/renameOutputFile Oct 21, 2023
@KonghaYao
Copy link
Owner

我多附加了一些东西,处理了按需使用 hash 和 filename 的问题,如果您觉得无问题,周日的晚上将会发一次 beta 版本带上这个提交
57ee036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants