Closed RiskoZoSlovenska closed 2 years ago
Here's a potential third option: If the argument is a string, treat it as the extension to remove (2.x behaviour). Otherwise, if it's true
, remove any extension (proposed behaviour).
I rather like that third option, since it provides the greatest amount of flexibility, and is not all that difficult to implement or understand.
As was mentioned in https://github.com/truemedian/luvit-api-design/pull/9#issuecomment-1050858085,
path.basename
is missing 2.x'sexpected_ext
argument. However, perhaps we would like to consider "anexclude_extension
boolean instead of anexpected_ext
string param".Arguments for:
Arguments against:
basename
command, which takes a suffix to remove.Discuss below.