Skip to content

Unified copy#136

Closed
CxRes wants to merge 4 commits into
jeff-zucker:masterfrom
CxRes:unified-copy
Closed

Unified copy#136
CxRes wants to merge 4 commits into
jeff-zucker:masterfrom
CxRes:unified-copy

Conversation

@CxRes

@CxRes CxRes commented Mar 17, 2020

Copy link
Copy Markdown
Contributor

I have created a unified copy function that works for files and folders:

  • It determines whether source is a file or folder from the get request (though rather clumsily but not incorrectly for now, hopefully this can be made RDF based later).
  • It rejects if source is a file and destination uses a trailing slash (through not vice-versa)
  • older copyFile and copyFolder have not been touched.

I have kept the logic absolutely unchanged, only rearranged and optimized the code. Fingers crossed nothing should break. Old functionality is untouched!

I am unable to run tests on my windows machine - unrelated tests keep failing. Hence the draft PR, so that hopefully someone else can test this before merging.

Changed the cjs require statements to esm imports at the top of the file for consistency.

Moved solid-namespace from depDependencies to dependencies in Package.json
The new `copy` function unifies both `copyFile` and `copyFolder`.
It determines whether the source is a file or folder from the network response (without the need for an extra network request) instead of the trailing slash on provided source url.
Reuses prior get and put responses to get links for copying.
This saves unnecessary multiple head calls being made to fetch links.
@CxRes CxRes marked this pull request as ready for review March 17, 2020 06:40
@CxRes CxRes mentioned this pull request Mar 17, 2020
@CxRes

CxRes commented Mar 17, 2020

Copy link
Copy Markdown
Contributor Author

There are few linting errors on my part and a couple of typos (It seems the original was not linted either). I'll PR a clean version merging into master.

@jeff-zucker

Copy link
Copy Markdown
Owner

I am recovering from eye surgery and not able to get to these suggestions at the moment. @CxRes thanks for your ongoing contributions. @bourgeoa if you want to merge or otherwise change anything, please go ahead. OTOH, do not feel obligated to. I will look at all this more carefully in a couple of weeks.

@CxRes

CxRes commented Mar 17, 2020

Copy link
Copy Markdown
Contributor Author

@jeff-zucker We can discuss this when you feel better. Hope you get well soon!!!

@CxRes CxRes closed this Apr 10, 2020
@CxRes CxRes deleted the unified-copy branch April 10, 2020 22:08
@CxRes CxRes restored the unified-copy branch April 10, 2020 22:10
@CxRes CxRes mentioned this pull request Apr 11, 2020
@CxRes

CxRes commented Apr 11, 2020

Copy link
Copy Markdown
Contributor Author

Please look at #138 instead, which is a more comprehensive PR!

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.

2 participants