Method alias
Aliases origin onto obj
Parameters:
obj must be an Object.
(Object receiving aliasing)
origin must be an Object.
(Object providing structure to obj)
Returns an Object
(Object receiving aliasing)
Method clearTimers
Clears deferred & repeating functions
Parameters:
Returns an Undefined
(undefined)
deferred
repeating
Method clone
Clones an Object
Parameters:
obj must be an Object.
(Object to clone)
shallow must be a Boolean.
([Optional] Create a shallow clone, which doesn't maintain prototypes, default is false
)
Returns an Object
(Clone of obj)
If JSON encoding fails due to recursion, the original Object is returned because it's assumed this is for decoration
Decorating Functions that would be lost with JSON encoding/decoding
Method coerce
Coerces a String to a Type
Parameters:
Returns a Mixed
(Primitive version of the String)
Method compile
Recompiles a RegExp by reference This is ideal when you need to recompile a regex for use within a conditional statement
Parameters:
regex must be an Object.
(RegExp)
pattern must be a String.
(Regular expression pattern)
modifiers must be a String.
(Modifiers to apply to the pattern)
Returns a Boolean
(true)
Method css
Creates a CSS stylesheet in the View
Parameters:
content must be a String.
(CSS to put in a style tag)
media must be a String.
([Optional] Medias the stylesheet applies to)
Returns an Object
(Element created or undefined)
Method debounce
Debounces a function
Parameters:
fn must be a Function.
(Function to execute)
ms must be a Number.
(Time to wait to execute in milliseconds, default is 1000)
scope can be of any type.
(this
context during execution, default is global
)
Returns an Undefined
(undefined)
Method define
Allows deep setting of properties without knowing if the structure is valid
Parameters:
args must be a String.
(Dot delimited string of the structure)
value can be of any type.
(Value to set)
obj must be an Object.
(Object receiving value)
Returns an Object
(Object receiving value)
Creating or casting
Do nothing
Setting reference or value
Method defer
Defers the execution of Function by at least the supplied milliseconds Timing may vary under "heavy load" relative to the CPU & client JavaScript engine
Parameters:
fn must be a Function.
(Function to defer execution of)
ms must be a Number.
(Milliseconds to defer execution)
id must be a Number.
([Optional] ID of the deferred function)
repeat must be a Boolean.
([Optional] Describes the execution, default is false
)
Returns a String
(ID of the timer)
Method dom
Queries DOM with fastest method
Parameters:
Returns a Mixed
(undefined, Element, or Array of Elements)
Method domId
Encodes a UUID to a DOM friendly ID
Parameters:
Returns a String
(DOM friendly ID)
Method error
Error handling, with history in .log
Parameters:
e can be of any type.
(Error object or message to display)
args must be an Array.
(Array of arguments from the callstack)
scope can be of any type.
(Entity that was "this")
warning must be a Boolean.
([Optional] Will display as console warning if true)
Returns an Undefined
(undefined)
Method extend
Creates a "class" extending Object, with optional decoration
Parameters:
obj must be an Object.
(Object to extend)
arg must be an Object.
([Optional] Object for decoration)
Returns an Object
(Decorated obj)
Method fib
Fibonacci calculator
Parameters:
i must be a Number.
(Number to calculate)
r must be a Boolean.
(Recursive if true
)
Returns a Number
(Calculated number)
Method genId
Generates an ID value
Parameters:
obj can be of any type.
([Optional] Object to receive id)
dom must be a Boolean.
([Optional] Verify the ID is unique in the DOM, default is false)
Returns a Mixed
(Object or id)
Method hash
Getter / setter for the hashbang
Parameters:
Returns a String
(Current route)
Method hex
Converts RGB to HEX
Parameters:
rgb(255, 255, 255)
or 255, 255, 255
)Returns a String
(Color as HEX)
Method iterate
Iterates an Object and executes a function against the properties Iteration can be stopped by returning false from fn
Parameters:
obj must be an Object.
(Object to iterate)
fn must be a Function.
(Function to execute against properties)
Returns an Object
(Object)
Method loading
Renders a loading icon in a target element, with a class of "loading"
Parameters:
Returns a Mixed
(Element)
Setting loading image
Clearing target element
Creating loading image in target element
Method log
Writes argument to the console
Parameters:
arg must be a String.
(String to write to the console)
target must be a String.
([Optional] Target console, default is "log")
Returns an Undefined
(undefined)
Method merge
Merges obj with arg
Parameters:
obj must be an Object.
(Object to decorate)
arg must be an Object.
(Decoration)
Returns an Object
(Decorated Object)
Method module
Registers a module on abaaso
Parameters:
arg must be a String.
(Module name)
obj must be an Object.
(Module structure)
Returns an Object
(Module registered)
Private method object
Returns Object, or reference to Element
Parameters:
Returns a Mixed
(Entity)
Method parse
Parses a URI into an Object
Parameters:
Returns an Object
(Parsed URI)
'cause IE is ... IE; required for data.batch()
Method property
Sets a property on an Object, if defineProperty cannot be used the value will be set classically
Parameters:
obj must be an Object.
(Object to decorate)
prop must be a String.
(Name of property to set)
descriptor must be an Object.
(Descriptor of the property)
Returns an Object
(Object receiving the property)
Method proto
Sets methods on a prototype object Allows hooks to be overwritten
Parameters:
obj must be an Object.
(Object receiving prototype extension)
type must be a String.
(Identifier of obj, determines what Arrays to apply)
Returns an Object
(obj or undefined)
Method queryString
Parses a query string & coerces values
Parameters:
arg must be a String.
([Optional] Key to find in the querystring)
qstring must be a String.
([Optional] Query string to parse)
Returns a Mixed
(Value or Object of key:value pairs)
Method reflect
Returns an Array of parameters of a Function
Parameters:
Returns an Array
(Array of parameters)
Method repeat
Creates a recursive function Return false from the function to halt recursion
Parameters:
fn must be a Function.
(Function to execute repeatedly)
ms must be a Number.
(Milliseconds to stagger the execution)
id must be a String.
([Optional] Timeout ID)
now must be a Boolean.
(Executes fn
and then setup repetition, default is true
)
Returns a String
(Timeout ID)
Could be valid to return false from initial execution
Creating repeating execution
Method stop
Stops an Event from bubbling
Parameters:
Returns an Object
(Event)
Assumed to always be valid, even if it's not decorated on e
( I'm looking at you IE8 )
Method target
Returns the Event target
Parameters:
Returns an Object
(Event target)
Method tpl
Transforms JSON to HTML and appends to Body or target Element
Parameters:
data must be an Object.
(JSON Object describing HTML)
target can be of any type.
([Optional] Target Element or Element.id to receive the HTML)
Returns an Object
(New Element created from the template)
Method uuid
Generates a version 4 UUID
Parameters:
Returns a String
(UUID)
Method walk
Walks a structure and returns arg
Parameters:
obj can be of any type.
(Object or Array)
arg must be a String.
(String describing the property to return)
Returns a Mixed
(arg)
Method when
Accepts Deferreds or Promises as arguments or an Array
Returns an Object
(Deferred)
Did we receive an Array? if so it overrides any other arguments
How many instances to observe?
None, end on next tick
Setup and wait
Method $
Parameters:
(Comma delimited string of CSS selectors)
Returns a Mixed
(Element or Array of Elements)