Skip to content

Ch 20, urlPath function - separator misbehaviour on Windows #446

@HattyJetty

Description

@HattyJetty

https://eloquentjavascript.net/20_node.html#c_LMKrGVrGZP
Here on line 10 the expression !path.startsWith(baseDirectory + "/") might result in the wrong value, because the separator difference on Windows is not taken into account.

I guess this can be avoided by concatenating with the sep from path module.

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