Utils

bind(scope, fn)

Transform a method attached to an object into a function.

Arguments:
  • scope (Object) – the object on which the method is called

  • fn (function) – the method to call

Returns:

function – the packaged function

safeString(str)

Replace all the special characters in the string by an underscore

Arguments:
  • str (string) –

Returns:

string

clamp(value, min, max)

Standard clamp function

Arguments:
  • value (number) – the value to clamp

  • min (number) – the lower threshold

  • max (number) – the upper threshold

Returns:

number – the clamped value