Class: Util

Util

Util is a utility class containing methods commonly used throughout Shiviz. Util is not instantiable and only contains public static methods. No method in Util is allowed to modify any sort of global state.

Constructor

new Util()

Util is not an instantiable class. Do not call this constructor
Source:

Methods

(static) objectShallowCopy(obj) → {Object}

Creates a shallow copy of a raw object
Parameters:
Name Type Description
obj Object the object to clone
Source:
Returns:
the clone
Type
Object

(static) removeFromArray(arr, arg)

Removes elements from an array
Parameters:
Name Type Description
arr Array The array
arg function | any A function that matches elements to be removed, or the element to be removed
Source:

(static) reverseString(string) → {String}

Produce a new string that is the reverse of the given string.
Parameters:
Name Type Description
string String to be reversed
Source:
Returns:
reverse of input string
Type
String

(static) svgElement(tag) → {jQuery.selection}

Creates an SVG element with the proper namespace, and returns a jQuery reference to the new element
Parameters:
Name Type Description
tag String The tag name for the element to create
Source:
Returns:
A jQuery selection instance of the element
Type
jQuery.selection