Closed
Description
Version
18.6.0
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
No response
What steps will reproduce the bug?
import assert from 'node:assert/strict';
import path from 'path';
assert.deepEqual(path.basename('somerandomchars', 'chars'), 'somerandom');
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
Should not accept a non extension string as the ext parameter.
What do you see instead?
I can use path.basename
as a generic end of string removal function.
path.basename('somerandomchars', 'chars')
removes chars
from my path
Additional information
No response