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

adding ref capturing #42

Merged
merged 2 commits into from
Jan 26, 2018
Merged

Conversation

choldgraf
Copy link
Contributor

@choldgraf choldgraf commented Dec 23, 2017

This is a first shot at ref / filepath capturing. Still a WIP but is this in the right direction?

to do:

  • Add tests
  • Confirm API / naming is 👍

will close #41

lib/index.js Outdated

urlInfo.ref = "";
urlInfo.filepath = "";
if ((splits.length > 3) & (["blob", "tree"].indexOf(splits[2]) != -1)) {
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of indexOf(...) != -1 you can do: ["blob", "tree"].includes(splits[2]).

Also, I think & is a typo (unless you really meant it), I assume it should be &&.

Maybe it would be helpful to add the type to the urlInfo (tree or blob).

😁

// Find a better property name maybe
urlInfo.type = splits[2]

Nice work overall! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 to comments, I think they're all addressed in latest push (+ a test).

LMKWYT!

@choldgraf
Copy link
Contributor Author

friendly ping! anything else I should do on this one?

@IonicaBizau
Copy link
Owner

Sorry for delay... some unexpected things happened and I my schedule was modified. 🙈

@IonicaBizau
Copy link
Owner

Umm, tests are not passing, can you please double-check that?

@choldgraf
Copy link
Contributor Author

ah oops - github said travis passed so I didn't double-check it, lemme see what's up

@IonicaBizau
Copy link
Owner

IonicaBizau commented Jan 21, 2018 via email

@choldgraf
Copy link
Contributor Author

oops, I think I missed a >= instead of a >. let's see if tests pass now

@choldgraf
Copy link
Contributor Author

all travis errors but one are fixed:

["blob","tree"].includes is not a function

looks like a JS version error, yeah?

@choldgraf
Copy link
Contributor Author

swapped out includes for indexOf and that got the tests passing

@choldgraf
Copy link
Contributor Author

(I think this is ready to go whenever you are @IonicaBizau :-) )

@IonicaBizau IonicaBizau mentioned this pull request Jan 26, 2018
@IonicaBizau IonicaBizau merged commit 3880dd0 into IonicaBizau:master Jan 26, 2018
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.

Possible to grab reference information as well?
2 participants