View Source Recode.Utils (Recode v0.5.2)

This module provides utility functions for recode.

Summary

Functions

Returns true id value ends with suffix.

Functions

Link to this function

ends_with?(value, suffix)

View Source
@spec ends_with?(value :: list() | module(), suffix :: list() | module()) :: boolean()

Returns true id value ends with suffix.

Both, value and suffix must be lists or module aliases.

Examples

iex> Recode.Utils.ends_with?(Foo.Bar, Bar)
true
iex> Recode.Utils.ends_with?(Foo, Foo.Bar)
false
iex> Recode.Utils.ends_with?(Foo.Bar, Baz)
false

iex> Recode.Utils.ends_with?([1, 2, 3], [2, 3])
true
iex> Recode.Utils.ends_with?([1, 2, 3], [2, 9])
false