Skip to content

Check to see if path part ends in dot or space #2

@nmoinvaz

Description

@nmoinvaz

Windows has a hard time handling path parts that end in a period. It would be great if you had a check that could look for that. Example:

c:\.\  <- OK
c:\x\..\ <- OK
c:\x.\y\ <- NOT OK
c:\x\y \ <- NOT OK

Perhaps this JS will do:

const isValidPath = path.split(sep).every((p) => p.length <= 1 || p === ".." || !p.endsWith(".") || !p.endsWith(" "))

Thanks for your package!

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