View Source Resourceful.Util (Resourceful v0.1.3)

Extra utility functions. These are for miscellaneous shared functions that don't really fit with any other module but are shared across multiple modules.

Link to this section Summary

Functions

Allows :except or :only options to be set in a keyword set of options. The options and the set are given as arguments and, depending on the options, a subset (or the set itself) will be returned.

Link to this section Functions

Link to this function

except_or_only!(opts, set)

View Source
@spec except_or_only!(
  keyword(),
  %MapSet{map: term(), version: term()} | list()
) :: list()

Allows :except or :only options to be set in a keyword set of options. The options and the set are given as arguments and, depending on the options, a subset (or the set itself) will be returned.

An exception will be raised if invalid arguments are passed or if both :except and :only are passed.