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

Nice to know #33

Open
xIrusux opened this issue Nov 21, 2019 · 0 comments
Open

Nice to know #33

xIrusux opened this issue Nov 21, 2019 · 0 comments

Comments

@xIrusux
Copy link

xIrusux commented Nov 21, 2019

const extension = url.split(".")[1];

You have split the extension type off here brilliantly :) but I remember seeing the below piece of code and finding it real cool. It uses the path node core module and is a saver way of getting the endpoint when for example there are too many dots in the pathname and things may get convoluted with a ".split()".

const extension = path.extname(endpoint);

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

No branches or pull requests

1 participant