dart-lang/path

Handle parsing multiple extensions

Closed this issue · 5 comments

path.extension("main.dart.js"); // -> ".js"

Maybe, add an optional parameter to ask it to return ".dart.js".

Thanks.

I would like to work on this issue.

@nex3 @natebosch If the level (lets say the optional parameter level) exceeds the number of dots (like path.extension('hello.world.foo.bar.dart', level = 50)) what the output should be - the whole path or an empty path or some exception?

nex3 commented

I would expect that to return "hello". The path package generally avoids throwing exceptions if at all possible.

@nex3 Don't you think it should be .world.foo.bar.dart, as only hello will not denote an extension?

nex3 commented

Sorry, I was thinking about withoutExtensions. You're right, it would be .world.foo.bar.dart.