Class: Utils

Utils

a class to have static utility functions

Constructor

new Utils()

Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

Methods

(static) arrClone(a) → {Array}

Shallow copy an array
Parameters:
Name Type Description
a Array the array to copy.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
The copy of the array.
Type
Array

(static) checkContains(s1, s2)

Checks whether one dictionary contains all the keys of the other Throws an exceptions if that is not the case.
Parameters:
Name Type Description
s1 object first set.
s2 object second set.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

(static) checkEquals(s1, s2)

Checks whether one dictionary key set equals that of another. other Throws an exceptions if that is not the case.
Parameters:
Name Type Description
s1 object first set.
s2 object second set.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

(static) checkType(v, t)

Check the type of a javascript variable This method will throw an exception if the check fails.
Parameters:
Name Type Description
v anything the variable to check.
t string the string representation of the name of the type v should be of.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

(static) clone(o) → {object}

Clone a javascript object
Parameters:
Name Type Description
o object the object to shalow clone.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
object which is a clone of the original one.
Type
object

(static) fakeUse()

Fake using a parameter. This is mainly used to avoid lint warnings. Pass as many args as you like to this function.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

(static) getType(v) → {string}

Return the type of a variable
Parameters:
Name Type Description
v anything the variable
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
the type.
Type
string

(static) pass()

Fake doing something This is mainly used to avoid lint warnings. Pass as many args as you like to this function.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

(static) unite(o1, o2) → {object}

Unite two javascript objects into a third one. Second trumps the first.
Parameters:
Name Type Description
o1 object first object.
o2 object first object.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
object which is the unification of the two objects.
Type
object

initialize() → {Utils}

creates a new instance
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
the new instance.
Type
Utils