assertion

functions

assert-equal

@function assert-equal($pExpected, $pValue, $pMessage: _equal_fail($pExpected), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be equal to $pExpected.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pExpected

the value expected from $pValue

Any none
$pValue

the value to test against $pExpected

Any none
$pMessage

the error message if this assertion fails (optional)

Any_equal_fail($pExpected)
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws an error

Requires

Used by

assert-unequal

@function assert-unequal($pUnexpected, $pValue, $pMessage: _unequal_fail($pExpected), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be unequal to $pUnexpected.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pUnexpected

the value not expected from $pValue

Any none
$pValue

the value to test against $pUnexpected

Any none
$pMessage

the error message if this assertion fails (optional)

Any_unequal_fail($pExpected)
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws an error

Requires

Used by

assert-true

@function assert-true($pValue, $pMessage: "condition must be true", $pHandler: default-throw-handler()) { ... }

Description

Asserts $pCondition to be equal to true.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to check

Any none
$pMessage

the error message if this assertion fails (optional)

Any"condition must be true"
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pCondition is returned.
  2. If the assertion fails and the handler does not terminate, $pCondition is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws an error

Requires

Used by

assert-false

@function assert-false($pValue, $pMessage: "condition must be false", $pHandler: default-throw-handler()) { ... }

Description

Asserts $pCondition to be equal to false.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to check

Any none
$pMessage

the error message if this assertion fails (optional)

Any"condition must be false"
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pCondition is returned.
  2. If the assertion fails and the handler does not terminate, $pCondition is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws an error

Requires

Used by

[private] _equal_fail

@function _equal_fail($pExpected) { ... }

Description

Returns an error message that is specific to when the equal assertion fails.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pExpected

the expected value

Any none

Returns

String

the final error message

[private] _unequal_fail

@function _unequal_fail($pExpected) { ... }

Description

Returns an error message that is specific to when the unequal assertion fails.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pExpected

the expected value

Any none

Returns

String

the final error message

default-throw-handler

@function default-throw-handler() { ... }

Description

Returns the default throw-handler used for assertions. The currently defined default handler is the 'exit' handler, that, by default, throws an error using the at-error directive which terminates the compilation when invoked. The termination is not guaranteed since the 'exit' handler can be overridden using throw-handler-replace, which might change the implementation details.

Parameters

None.

Returns

Function

the handler function associated with 'exit'

Requires

check-is-empty

@function check-is-empty($pIterableOrString, $pMessage: "must be empty", $pHandler: default-throw-handler()) { ... }

Description

Asserts $pIterableOrString to be empty. The asserted value ($pIterableOrString) must either be type of string, list, map or arglist. If it is neither, the assertion fails.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pIterableOrString

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any"must be empty"
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, given value is returned.
  2. If the assertion fails and the handler does not terminate, given value is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-not-empty

@function check-not-empty($pIterableOrString, $pMessage: "must not be empty", $pHandler: default-throw-handler()) { ... }

Description

Asserts $pIterableOrString to not be empty. The asserted value ($pIterableOrString) must either be type of string, list, map or arglist. If it is neither, the assertion succeeds.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pIterableOrString

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any"must not be empty"
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, given value is returned.
  2. If the assertion fails and the handler does not terminate, given value is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-map

@function check-is-map($pValue, $pMessage: _generic_fail($pValue, "not a map"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type map.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a map")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-list

@function check-is-list($pValue, $pMessage: _generic_fail($pValue, "not a list"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type list.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a list")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-arglist

@function check-is-arglist($pValue, $pMessage: _generic_fail($pValue, "not an arglist"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type arglist.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not an arglist")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-function

@function check-is-function($pValue, $pMessage: _generic_fail($pValue, "not a function"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type function.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a function")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-iterable

@function check-is-iterable($pValue, $pMessage: _generic_fail($pValue, "not an iterable"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type iterable. An iterable is either a list, arglist or map.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not an iterable")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-undefined

@function check-is-undefined($pValue, $pMessage: _generic_fail($pValue, "not undefined"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be undefined. Undefined means it is either literal null or "none".

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not undefined")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-primitive

@function check-is-primitive($pValue, $pMessage: _generic_fail($pValue, "not a primitive"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a primitive. A primitive is either a string, number, color or boolean.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a primitive")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-string

@function check-is-string($pValue, $pMessage: _generic_fail($pValue, "not a string"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type string.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a string")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-number

@function check-is-number($pValue, $pMessage: _generic_fail($pValue, "not a number"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type number.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a number")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-color

@function check-is-color($pValue, $pMessage: _generic_fail($pValue, "not a color"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be of type color.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a color")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-bool

@function check-is-bool($pValue, $pMessage: _generic_fail($pValue, "not a boolean"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a boolean (type of bool).

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a boolean")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-truthy

@function check-is-truthy($pValue, $pMessage: _generic_fail($pValue, "not truthy"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be extensively truthy. A value is extensively truthy if it is natively truthy and neither an empty string, an empty list, an empty map nor numeric null.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not truthy")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-falsy

@function check-is-falsy($pValue, $pMessage: _generic_fail($pValue, "not falsy"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be extensively falsy. A value is extensively falsy if it is natively falsy or either an empty string, an empty list, an empty map or numeric null.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not falsy")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-has-unit

@function check-has-unit($pValue, $pUnitList, $pMessage: _has_unit_fail($pValue, $pUnitList), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to has a unit that is contained in given list.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test (not the unit standalone)

Any none
$pUnitList

the list of all units to spec for

Any none
$pMessage

the error message if this assertion fails (optional)

Any_has_unit_fail($pValue, $pUnitList)
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-time

@function check-is-time($pValue, $pMessage: _generic_fail($pValue, "not a time"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a time value.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a time")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-duration

@function check-is-duration($pValue, $pMessage: _generic_fail($pValue, "not a duration"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a duration.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a duration")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-angle

@function check-is-angle($pValue, $pMessage: _generic_fail($pValue, "not an angle"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be an angle.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not an angle")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-frequency

@function check-is-frequency($pValue, $pMessage: _generic_fail($pValue, "not a frequency"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a frequency.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a frequency")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-integer

@function check-is-integer($pValue, $pMessage: _generic_fail($pValue, "not an integer"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be an integer.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not an integer")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-relative-length

@function check-is-relative-length($pValue, $pMessage: _generic_fail($pValue, "not a relative length"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a relative length.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a relative length")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-absolute-length

@function check-is-absolute-length($pValue, $pMessage: _generic_fail($pValue, "not an absolute length"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be an absolute length.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not an absolute length")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-percentage

@function check-is-percentage($pValue, $pMessage: _generic_fail($pValue, "not a percentage"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a percentage.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a percentage")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-length

@function check-is-length($pValue, $pMessage: _generic_fail($pValue, "not a length"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a relative or absolute length.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a length")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-resolution

@function check-is-resolution($pValue, $pMessage: _generic_fail($pValue, "not a resolution"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a resolution.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a resolution")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

check-is-position

@function check-is-position($pValue, $pMessage: _generic_fail($pValue, "not a position"), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be a position.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none
$pMessage

the error message if this assertion fails (optional)

Any_generic_fail($pValue, "not a position")
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Returns

Any type —

Returns conditionally.

  1. If the assertion does not fail, $pValue is returned.
  2. If the assertion fails and the handler does not terminate, $pValue is returned if the handler returns null. Otherwise, returns the handler's return value.
  3. Returns never if the assertion fails and the handler terminates (as in stops the compilation).

Throws

  • if the assertion fails and the handler throws

Requires

mixins

assert-equal

@mixin assert-equal($pExpected, $pValue, $pMessage: _equal_fail($pExpected), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be equal to $pExpected. This mixin is an alias for the function assert-equal.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pExpected

the value expected from $pValue

Any none
$pValue

the value to test against $pExpected

Any none
$pMessage

the error message if this assertion fails (optional)

Any_equal_fail($pExpected)
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Throws

  • if the assertion fails and the handler throws an error

Requires

assert-unequal

@mixin assert-unequal($pUnexpected, $pValue, $pMessage: _equal_fail($pExpected), $pHandler: default-throw-handler()) { ... }

Description

Asserts $pValue to be unequal to $pUnexpected. This mixin is an alias for the function assert-unequal.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pUnexpected

the value not expected from $pValue

Any none
$pValue

the value to test against $pUnexpected

Any none
$pMessage

the error message if this assertion fails (optional)

Any_equal_fail($pExpected)
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Throws

  • if the assertion fails and the handler throws an error

Requires

assert-true

@mixin assert-true($pValue, $pMessage: "condition must be true", $pHandler: default-throw-handler()) { ... }

Description

Asserts $pCondition to be equal to true. This mixin is an alias for the function assert-true.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to check

Any none
$pMessage

the error message if this assertion fails (optional)

Any"condition must be true"
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Throws

  • if the assertion fails and the handler throws an error

Requires

assert-false

@mixin assert-false($pValue, $pMessage: "condition must be false", $pHandler: default-throw-handler()) { ... }

Description

Asserts $pCondition to be equal to false. This mixin is an alias for the function assert-false.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to check

Any none
$pMessage

the error message if this assertion fails (optional)

Any"condition must be false"
$pHandler

the handler that is used if the assertion fails (optional)

String or Functiondefault-throw-handler()

Throws

  • if the assertion fails and the handler throws an error

Requires

error

handler name with throw-invoke.

variables

[private] _ErrorHandlers

$_ErrorHandlers: (
  // <HANDLER> ::= <HANDLER_NAME>: <HANDLER_FUNCTION>
  // Following are default handlers compliant with `handler-add`
  'exit': meta.get-function('error', $module: report),
  'warn': meta.get-function('warn', $module: report)
) !default;

Description

A private map of all throw-handler functions associated to their handler name. This map acts as a registry of throw-handlers used to handle certain exception throws with better Developer Experience (DX).

Type

Map

Used by

functions

throw-handlers

@function throw-handlers() { ... }

Description

Returns the global map of all current throw-handler functions associated to their handler names.

Parameters

None.

Returns

Map

the handler register map

Requires

throw-handler-exists

@function throw-handler-exists($pHandlerName) { ... }

Description

Returns true if a handler (function) with given name currently exists. The letter casing does matter.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pHandlerName

the name of the target handler

String none

Returns

Boolean

true if a handler with given name exists

Throws

  • Error if $pHandlerName is not a string

Requires

Used by

throw-handler-get

@function throw-handler-get($pHandlerName) { ... }

Description

Returns the with given name associated handler function, if found. If no handler with given name is found, an error is thrown.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pHandlerName

the name of the target handler

String none

Returns

Function

the function associated with given name

Throws

  • Error if no handler $pHandlerName is found

Requires

Used by

throw-handler-add

@function throw-handler-add($pHandlerName, $pHandlerFunction) { ... }

Description

Associates $pHandlerFunction with $pHandlerName in the global handler map if no handler with given name exists. If a handler with given name is already known, an error is thrown. A handler function must accept one argument that is the error message. Registered handler functions can be invoked using their handler name with throw-invoke.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pHandlerName

name of the new handler

String none
$pHandlerFunction

function of the new handler. The function accepts one argument being the error message (any type) and returns whatever. If the function returns null on invocation, the return value may be discarded and another value prioritised, but a non-null return should not be discarded.

Function none

Returns

String

$pHandlerName if the operation succeeded

Throws

  • Error if a handler with given name is already existing, or if $pHandlerFunction is not a valid function reference.

Requires

throw-handler-replace

@function throw-handler-replace($pHandlerName, $pHandlerFunction) { ... }

Description

Replaces the with $pHandlerName associated function with $pHandlerFunction if there is a handler with given name. If no handler with an equal name is found, an error is thrown. A handler function must accept one argument that is the error message. Registered handler functions can be invoked using their handler name with throw-invoke.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pHandlerName

name of the handler to replace

String none
$pHandlerFunction

the new function of the handler. The function accepts one argument being the error message (any type) and returns whatever. If the function returns null on invocation, the return value may be discarded and another value prioritised, but a non-null return should not be discarded.

Function none

Returns

String

$pHandlerName if the operation succeeded

Throws

  • Error if no handler with given name is currently existing, or if $pHandlerFunction is not a valid function reference.

Requires

throw-invoke

@function throw-invoke($pHandler, $vaArgs...) { ... }

Description

Invokes $pHandler with $vaArgs as the call arguments.

  • If $pHandler is a string, the function associated to given string is called using $vaArgs. If that function is not found, as in no handler with $pHandler as name is found, an error is thrown.
  • If $pHandler is a function, the function is called immediately using given $vaArgs.

If $pHandler is neither a string nor a function, an error is thrown.

Be aware: usually $vaArgs should be exactly one argument, since all handler functions are required to accept one argument. But theoretically, if you invoke custom handlers, you can pass more arguments to them using this function.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pHandler

the target handler to invoke. Can be a string to reference an existing handler, or a function that is not required to be registered as a handler - as in not required to be associated to a certain handler name in the handler map.

Function or String none
$vaArgs

the arguments passed to the call of the handler

Arglist none

Returns

Any type —

the result of the handler function call

Throws

  • Error if the invoke failed, $pHandler is not a string nor a function, or if $pHandler is a string but no handler with that string as a name is found.

Requires

Used by

throw-exit-handler

@function throw-exit-handler() { ... }

Description

Returns the exit handler, that when invoked throws an error with input message and terminates the compilation, by default. The termination of the compilation is not guaranteed, since the exit-handler's implementation can be overwritten, but should not.

Parameters

None.

Returns

Function

the exit handler function

Used by

throw-warn-handler

@function throw-warn-handler() { ... }

Description

Returns the warn handler, that when invoked throws a warning with input message and continues the compilation, by default. The return value of that function is always null.

Parameters

None.

Returns

Function

the warn handler function

report-error

@function report-error($pMessage) { ... }

Description

Simple referencable function that throws an error with given message. It utilizes the at-error directive, if available, which terminates the compilation.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pMessage

the error message

Any none

Returns

Never or Null

never returns unless the at-error directive is disabled, which will trigger a warning and a null return

report-warn

@function report-warn($pMessage, $pReturnValue: null) { ... }

Description

Simple referencable function that throws a warning with given message. It utilizes the at-warn directive.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pMessage

the warn message

Any none
$pReturnValue

the value returned after warning (optional)

Anynull

Returns

Any type —

returns $pReturnValue

throw

@function throw($pMessage, $pHandler: handlers.exit-handler(), $pIfNull: null) { ... }

Description

Invokes given handler with $pMessage as the call argument.

  • If $pHandler is a string, the function associated to given string is called using $pMessage. If that function is not found, as in no handler with $pHandler as a name is found in the handler map, an error is thrown.
  • If $pHandler is a function, the function is called immediately using given $pMessage as argument.
  • If $pHandler is undefined, as in literal null or "none", the handler is not invoked and $pIfNull returned. The throw is essentially ignored - so be careful with passing the right handler.

If the result of the function call on the handler is not null, the result is returned. Otherwise, $pIfNull is returned.
If $pHandler is neither undefined (null or "none), a function nor a string, an error is thrown.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pMessage

the error message passed to the handler

Any none
$pHandler

the target handler to invoke. Can be a string to reference an existing handler, or a function that is not required to be registered as a handler - as in not required to be associated to a certain handler name in the handler map. (optional)

Function or Stringhandlers.exit-handler()
$pIfNull

the value returned alternatively, if the function call on the final handler that is used returns null (optional)

Anynull

Returns

Any type —

Returns conditionally.

  1. Returns never if the used handler terminates the compilation.
  2. If the handler does not terminate, $pIfNull is returned if the result of the handler invocation is null. Otherwise, returns the result of the invocation.

Throws

  • Error if the invoke failed, the handler throws, $pHandler is neither undefined, a string nor a function, or if $pHandler is a string but no handler with that string as a name is found in the handler map.

Requires

Used by

warn-throw

@function warn-throw($pMessage, $pIfNull: null) { ... }

Description

Throws a warning using given message and the default throw-warn-handler.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pMessage

the message passed to the warn handler

Any none
$pIfNull

the value returned alternatively, if the function call on the warn handler returns null - which it does by default (optional)

Anynull

Returns

Any type —

Returns conditionally.

  1. Returns never if the used handler terminates the compilation.
  2. If the handler does not terminate, $pIfNull is returned if the result of the handler invocation is null. Otherwise, returns the result of the invocation.

Throws

  • error if the handler throws (which it does by default)

Requires

Used by

mixins

throw

@mixin throw($pMessage, $pHandler: handlers.exit-handler(), $pIfNull: null) { ... }

Description

Mixin alias that invokes throw using given arguments.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pMessage

the error message passed to the handler

Any none
$pHandler

the target handler to invoke. Can be a string to reference an existing handler, or a function that is not required to be registered as a handler - as in not required to be associated to a certain handler name in the handler map. (optional)

Function or Stringhandlers.exit-handler()
$pIfNull

the value returned alternatively, if the function call on the final handler that is used returns null (optional)

Anynull

Throws

  • Error if the invoke failed, the handler throws, $pHandler is neither undefined, a string nor a function, or if $pHandler is a string but no handler with that string as a name is found in the handler map.

Requires

exit-throw

@mixin exit-throw($pMessage) { ... }

Description

Throws an error using given message and the default throw-exit-handler, that terminates the compilation by default.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pMessage

the message passed to the exit handler

Any none

Throws

  • error if the handler throws (which it does by default)

Requires

warn-throw

@mixin warn-throw($pMessage) { ... }

Description

Throws a warning using given message and the default throw-warn-handler.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pMessage

the message passed to the warn handler

Any none

Throws

  • error if the handler throws (which it does by default)

Requires

utils

functions

nonnull-or

@function nonnull-or($pValue, $pIfNull) { ... }

Description

Returns $pValue if $pValue is not null. Otherwise, returns $pIfNull.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test to be not null

Any none
$pIfNull

the value returned if $pValue is null

Any none

Returns

Any type —

$pValue if not null, else $pIfNull

Used by

truthy-or

@function truthy-or($pValue, $pIfFalsy) { ... }

Description

Returns $pValue if $pValue is extensively truthy. Otherwise, returns $pIfFalsy. Given value is extensively truthy if it is neither numeric zero, an empty list, an empty map, an empty string nor false or null.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test to be truthy

Any none
$pIfFalsy

the value returned if $pValue is falsy

Any none

Returns

Any type —

$pValue if truthy, else $pIfFalsy

Requires

falsy-or

@function falsy-or($pValue, $pIfTruthy) { ... }

Description

Returns $pValue if $pValue is extensively falsy. Otherwise, returns $pIfTruthy. Given value is extensively falsy if it is either numeric zero, an empty list, an empty map, an empty string, false or null.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test to be falsy

Any none
$pIfTruthy

the value returned if $pValue is truthy

Any none

Returns

Any type —

$pValue if falsy, else $pIfTruthy

Requires

is-empty

@function is-empty($pValue) { ... }

Description

Returns true if $pValue is empty. Given value must either be of type list, arglist, map or string. If the value is neither type, false is returned.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue noneList or Arglist or Map or String none

Returns

Boolean

true if $pValue is empty

Requires

Used by

count

@function count($pIterableOrString, $pFallback) { ... }

Description

Returns the length of $pIterableOrString and returns $pFallback if it is neither of type list, arglist, map nor string.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pIterableOrString

the value which list or string length is returned (if possible)

List or Arglist or Map or String none
$pFallback

returned if the value is neither an iterable nor a string

Any none

Returns

Boolean

the length of given value if possible, else $pFallback

Requires

Used by

is-map

@function is-map($pValue) { ... }

Description

Returns true if $pValue is of type map.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a map

Used by

is-list

@function is-list($pValue) { ... }

Description

Returns true if $pValue is of type list.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a list

Used by

is-arglist

@function is-arglist($pValue) { ... }

Description

Returns true if $pValue is of type arglist.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is an arglist

Used by

is-function

@function is-function($pValue) { ... }

Description

Returns true if $pValue is of type function.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a function

Used by

is-iterable

@function is-iterable($pValue) { ... }

Description

Returns true if $pValue is an iterable. Given value is an iterable if it is either a list, an arglist or a map.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is an iterable

Requires

Used by

is-undefined

@function is-undefined($pValue) { ... }

Description

Returns true if $pValue is undefined. A value is undefined if it is null or "none".

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is undefined

Used by

is-primitive

@function is-primitive($pValue) { ... }

Description

Returns true if $pValue is a primitive. Given value is a primitive if it is either a string, number, color or boolean.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a primitive

Requires

Used by

is-string

@function is-string($pValue) { ... }

Description

Returns true if $pValue is a string.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a string

Used by

is-number

@function is-number($pValue) { ... }

Description

Returns true if $pValue is a number.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a number

Used by

is-color

@function is-color($pValue) { ... }

Description

Returns true if $pValue is a color.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a color

Used by

is-bool

@function is-bool($pValue) { ... }

Description

Returns true if $pValue is a boolean.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a boolean

Used by

as-boolean

@function as-boolean($pValue) { ... }

Description

Returns a boolean value if $pValue is natively truthy. A value is natively truthy if it is not null and not false.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to return as a boolean

Any none

Returns

Boolean

true if $pValue is truthy

is-truthy

@function is-truthy($pValue) { ... }

Description

Returns true if $pValue is extensively truthy. A value is extensively truthy if it is natively truthy and neither an empty string, an empty list, an empty map nor numeric null.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a extensively truthy

Used by

is-falsy

@function is-falsy($pValue) { ... }

Description

Returns true if $pValue is extensively falsy. A value is extensively falsy if it is natively falsy or either an empty string, an empty list, an empty map or numeric null.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a extensively falsy

Requires

Used by

has-unit

@function has-unit($pValue) { ... }

Description

Returns true if the $pValue's unit is contained in $pUnitList.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pUnitList contains the unit of $Value

Requires

Used by

is-time

@function is-time($pValue) { ... }

Description

Returns true if $pValue is a time or duration.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a time value

Requires

Used by

is-duration

@function is-duration($pValue) { ... }

Description

Returns true if $pValue is a duration or time.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a time value

Requires

Used by

is-angle

@function is-angle($pValue) { ... }

Description

Returns true if $pValue is an angle.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is an angle value

Requires

Used by

is-frequency

@function is-frequency($pValue) { ... }

Description

Returns true if $pValue is a frequency.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a frequency value

Requires

Used by

is-integer

@function is-integer($pValue) { ... }

Description

Returns true if $pValue is an integer.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is an integer

Requires

Used by

is-relative-length

@function is-relative-length($pValue) { ... }

Description

Returns true if $pValue is a relative length.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a relative length

Requires

Used by

is-absolute-length

@function is-absolute-length($pValue) { ... }

Description

Returns true if $pValue is an absolute length.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is an absolute length

Requires

Used by

is-percentage

@function is-percentage($pValue) { ... }

Description

Returns true if $pValue is a percentage.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a percentage

Requires

Used by

is-length

@function is-length($pValue) { ... }

Description

Returns true if $pValue is a length value. Given value is a length if it is either a relative- or absolute length.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a length value

Requires

Used by

is-resolution

@function is-resolution($pValue) { ... }

Description

Returns true if $pValue is a resolution.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a resolution

Requires

Used by

is-position

@function is-position($pValue) { ... }

Description

Returns true if $pValue is a position.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$pValue

the value to test

Any none

Returns

Boolean

true if $pValue is a position

Requires

Used by

unit-times

@function unit-times() { ... }

Description

Returns a list of all CSS time units.

Parameters

None.

Returns

List

a list of all time units

Used by

unit-angles

@function unit-angles() { ... }

Description

Returns a list of all CSS angle units.

Parameters

None.

Returns

List

a list of all angle units

Used by

unit-frequencies

@function unit-frequencies() { ... }

Description

Returns a list of all CSS frequency units.

Parameters

None.

Returns

List

a list of all angle units

Used by

unit-relative-lengths

@function unit-relative-lengths() { ... }

Description

Returns a list of all CSS relative length units.

Parameters

None.

Returns

List

a list of all relative length units

Used by

unit-absolute-lengths

@function unit-absolute-lengths() { ... }

Description

Returns a list of all CSS absolute length units.

Parameters

None.

Returns

List

a list of all absolute length units

Used by

unit-resolutions

@function unit-resolutions() { ... }

Description

Returns a list of all CSS resolution units.

Parameters

None.

Returns

List

a list of all resolution units

Used by

unit-positions

@function unit-positions() { ... }

Description

Returns a list of all CSS position units.

Parameters

None.

Returns

List

a list of all position units

Used by