Skip to content

path.isAbsolute return false for ~ on Ubuntu #29164

Closed
@arxeiss

Description

@arxeiss
  • Version: v12.8.0
  • Platform: Ubuntu 19.04 (Linux 5.0.0-23-generic Simple project messaging. #24-Ubuntu SMP Mon Jul 29 15:36:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux)

I'm checking if given path in config file is absolute or relative. It works great however not when ~ is used. Then it returns false.

Here is my code

import path from 'path';

path.isAbsolute('/var/www/index.html'); // true
path.isAbsolute('./index.html'); // false
path.isAbsolute('~/Documents/test.json'); // false - THIS IS BAD

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidIssues and PRs that are invalid.pathIssues and PRs related to the path subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions