Current section
Files
Jump to
Current section
Files
src/internal@path.erl
-module(internal@path).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/internal/path.gleam").
-export([basename/1]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(false).
-file("src/internal/path.gleam", 5).
?DOC(false).
-spec basename(binary()) -> binary().
basename(Path) ->
_pipe = gleam@string:split(Path, <<"/"/utf8>>),
_pipe@1 = gleam@list:last(_pipe),
gleam@result:unwrap(_pipe@1, <<""/utf8>>).