Skip to content

wired result of basename(file, extname(file)) #1905

@wsw0108

Description

@wsw0108

use ext from call extname for basename return wired result:

const ext = await extname('some-json-file.json'); // 'json'
const nameNoExt = await basename('some-json-file.json', ext); // 'some--file.'

Maybe the correct usage is as below?:

const ext = await extname('some-json-file.json'); // 'json'
const nameNoExt = await basename('some-json-file.json', '.' + ext); // some-json-file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions