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

fixed for utils.js/resolve #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fixed for utils.js/resolve #293

wants to merge 1 commit into from

Conversation

cbbfcd
Copy link

@cbbfcd cbbfcd commented Aug 21, 2019

as the test case:

resolve("users/.././users", "/");   // will feedback '/users/.././users'

so, i fixed it, and it's feedback "/users" now.

ps:

  1. This project is great, but is it not maintained?
  2. hi, everybody, if u run npm run test got a error info just like SecurityError: localStorage is not available for opaque origins, just add a jest config: "testURL": "http://localhost".

@@ -84,6 +84,10 @@ describe("resolve", () => {
expect(resolve("/groups?some=query", "/users?some=thing")).toEqual(
"/groups?some=query"
);
expect(resolve("users/.././users", "/")).toEqual("/users");
expect(resolve("some/.././users/../info/./address", "/users")).toEqual(
"/users/info/address"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this be /info/address?

/users
some -> /users/some
.. -> /users
. -> /users
.. -> /
info -> /info
. -> /info
address -> /info/address

Copy link
Author

@cbbfcd cbbfcd Sep 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks to review.

// equal this:
/users/some/.././users/../info/./address
// delete /xx/..:
/users/./info/./address
// then:
/users/info/address

just like a cd operation:
nm50Xt.png

So I wonder if I missed it.?

@ryanflorence ryanflorence added the bug Something isn't working with a test case on codesandbox or an actual test. label Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working with a test case on codesandbox or an actual test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants