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: custom file (re)naming, sanitizing - use the new options.filename #591

Merged
merged 6 commits into from Apr 2, 2020

Conversation

tunnckoCore
Copy link
Member

@tunnckoCore tunnckoCore commented Mar 20, 2020

If options.filename is passed and is function, it is passed with part.
Must return full absolute filepath for the file.
Still works with options.keepExtensions.

By default we rename the files to random id (joined to the uploadDir), generated from hexoid package.

If `options.filename` is passed and is function, it is passed with `part`.
Must return full absolute filepath for the file.
Still works with `options.keepExtensions`.

By default we rename the files to random id (joined to the uploadDir), generated from `hexoid` package.

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
@auto-comment
Copy link

auto-comment bot commented Mar 20, 2020

Thank you for raising your pull request. Please make sure again that you have followed our contributing guidelines and the code of conduct. We will review it as soon as possible.
/cc @tunnckoCore @GrosSacASac

@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #591 into master will decrease coverage by 0.05%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #591      +/-   ##
==========================================
- Coverage   83.98%   83.93%   -0.06%     
==========================================
  Files          14       14              
  Lines         637      635       -2     
  Branches      103      104       +1     
==========================================
- Hits          535      533       -2     
+ Misses         94       93       -1     
- Partials        8        9       +1
Impacted Files Coverage Δ
src/Formidable.js 76.23% <84.61%> (-0.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d67c66c...f803364. Read the comment docs.

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
@tunnckoCore tunnckoCore changed the title feat: custom file (re)naming, sanitizing - use options.filename feat: custom file (re)naming, sanitizing - use the new options.filename Mar 20, 2020
GrosSacASac
GrosSacASac previously approved these changes Mar 21, 2020
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
@tunnckoCore
Copy link
Member Author

tunnckoCore commented Apr 2, 2020

@GrosSacASac can you try quickly this branch? Clone and try to run the tests yarn test. For some reason on CI works, on my machine don't. It's probably only on my end but I can't be sure.

anyway, realized what it was and fixed it.

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
@tunnckoCore tunnckoCore merged commit 6ef3a0d into master Apr 2, 2020
@tunnckoCore tunnckoCore deleted the file-renaming branch April 2, 2020 11:17
tunnckoCore added a commit that referenced this pull request Apr 2, 2020
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
tunnckoCore added a commit that referenced this pull request Apr 2, 2020
* fix: make opts.filename from #591 work with opts.keepExtensions
* chore: tweaks for failing tests
* fix: extension problems

Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants