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

Replace regexp function with basic string operation #7

Open
thecatontheflat opened this issue Dec 22, 2014 · 2 comments
Open

Replace regexp function with basic string operation #7

thecatontheflat opened this issue Dec 22, 2014 · 2 comments

Comments

@thecatontheflat
Copy link
Contributor

https://github.com/runk/connect-jade-static/blob/master/index.js#L54

I think it would make sense to perform a simple string operation here:

var urlpath = parsed.pathname.replace(/html$/, 'jade').replace(opts.baseUrl, '');

As far as I understood - the logic is to replace the string from the end. It can be achieved in more efficient ways :) I'll create a PR later

@runk
Copy link
Owner

runk commented Dec 22, 2014

Sure, all improvements are welcome 👍

@thecatontheflat
Copy link
Contributor Author

I've updated my PR #6

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

2 participants