Skip to content

Replace regexp function with basic string operation #7

@thecatontheflat

Description

@thecatontheflat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions