The core package is specialized in functions utilities that are highly reusable without creating any dependencies : arrays, strings, chars, objects, numbers, maths, date, colors, etc.
You can consider a library as a set of functions organized into classes, here with a "core" library in some cases we organize the functions in the package definitions without assembling them into a class.
Those functions are allowed to reuse the builtin types (Object, Array, Date, etc.), the Javascript API classes and packages, but nothing else.
Namespaces
- arrays
- The
core.arrayspackage is a modular JavaScript library that provides extraArraymethods. - chars
- The
core.charspackage is a modular JavaScript library that provides extraStringmethods to validate and transform a basic character. - colors
- The
core.colorspackage is a modular JavaScript library that provides extra rgb color methods. - date
- The
core.datepackage is a modular JavaScript library that provides extraDatemethods. - easings
- The
core.easingslibrary contains all the easing functions to create the specific tweening effects. - functors
- The
core.functorspackage is a modular JavaScript library that provides extraFunctionmethods. - maths
- The
core.mathspackage is a modular JavaScript library that provides extramathematicsmethods and implementations. - numbers
- The
core.numberspackage is a modular JavaScript library that provides extraNumbermethods and implementations. - objects
- The
core.objectspackage is a modular JavaScript library that provides extraObjectmethods and implementations. - random
- The
core.objectspackage is a modular JavaScript library that provides extra methods to generates a random number. - reflect
- The
core.reflectpackage is a modular JavaScript library that provides extra methods to to obtain information about loaded objects or generate it. - strings
- The
core.stringspackage is a modular JavaScript library that provides extraStringmethods.
Members
-
<constant> global
-
The
globalnamespace (reference to the global scope of the application), this object can target thewindowor thedocumentglobal objects in the browser or an other global reference.
Methods
-
cancelAnimationFrame(requestID)
-
Cancels an animation frame request previously scheduled through a call to requestAnimationFrame.
Parameters:
Name Type Description requestIDnumber The ID value returned by the call to requestAnimationFrame that requested the callback.
Example
var start = performance.now() ; var id ; function step( timestamp ) { var progress = timestamp - start; console.log( 'step: ' + progress ) ; if (progress < 2000) { id = requestAnimationFrame(step); } } id = requestAnimationFrame(step); cancelAnimationFrame(id); // abord the animation -
dump(value [, prettyprint] [, indent] [, indentor=])
-
Dumps a string representation of any object reference.
Parameters:
Name Type Argument Default Description value* Any object to dump.
prettyprintboolean <optional>
false boolean option to output a pretty printed string
indentnumber <optional>
0 initial indentation
indentor=string <optional>
initial string used for the indent.
Returns:
The string expression of the dump.
Example
var object ={ name : "vegas" , count : 10 , time : new Date() , flag : true , values : [1,2,3]} ;trace( dump( object ) ) ; -
dumpArray(value [, prettyprint] [, indent] [, indentor=])
-
Dumps a string representation of any Array reference.
Parameters:
Name Type Argument Default Description valueArray The Array to dump.
prettyprintboolean <optional>
false boolean option to output a pretty printed string
indentnumber <optional>
0 initial indentation
indentor=string <optional>
initial string used for the indent.
Returns:
The dump string representation of any Array reference.
-
dumpDate(value [, timestamp])
-
Dumps a string representation of any Date reference.
Parameters:
Name Type Argument Default Description valueDate A Date object to dump.
timestampboolean <optional>
false The optional timestamp flag.
Returns:
The string representation of any Date reference.
-
dumpObject(value [, prettyprint] [, indent] [, indentor=])
-
Dumps a string representation of an object.
Parameters:
Name Type Argument Default Description valueObject An object to dump.
prettyprintboolean <optional>
false The option to output a pretty printed string.
indentnumber <optional>
0 The initial indentation value.
indentor=string <optional>
The initial string used for the indent.
Returns:
The string expression of the dump.
-
dumpString(str)
-
Dumps a string representation of any String value.
Parameters:
Name Type Description strstring a String to transform.
Returns:
The dump string representation of any String value.
-
isBoolean(object)
-
Indicates if the specific object is a Boolean.
Parameters:
Name Type Description objectObject The object to check.
Returns:
trueif the object is a Boolean.- Type
- boolean
Example
trace( isBoolean(0) ) ; // false trace( isBoolean(true) ) ; // true trace( isBoolean(false) ) ; // true trace( isBoolean(3>2) ) ; // true trace( isBoolean(null) ) ; // false
-
isFloat(value)
-
Indicates if an value is a float number.
Parameters:
Name Type Description valuenumber The value to evaluates.
Returns:
trueif the passed-in value is a float.Example
trace( isFloat(0) ) ; // false trace( isFloat(0.5) ) ; // true trace( isFloat(1) ) ; // false
-
isInt(value)
-
Indicates if an value is an integer.
Parameters:
Name Type Description valuenumber The value to evaluates.
Returns:
trueif the passed-in value is an integer.Example
trace( isInt(-1) ) ; // true trace( isInt(0) ) ; // true trace( isInt(0.5) ) ; // false trace( isInt(1) ) ; // true
-
isNumber(object)
-
Indicates if the specific object is a Number.
Parameters:
Name Type Description objectObject The object to check.
Returns:
trueif the object is a Number.- Type
- boolean
Example
trace( isNumber(0) ) ; // true trace( isNumber(0.5) ) ; // true trace( isNumber(true) ) ; // true trace( isNumber(null) ) ; // false trace( isNumber(NaN) ) ; // true
-
isString(object)
-
Indicates if the specific object is a String.
Parameters:
Name Type Description objectObject The object to check.
Returns:
trueif the object is a String.Example
trace( isString(0) ) ; // false trace( isString(true) ) ; // false trace( isString(null) ) ; // false trace( isString('hello') ) ; // true trace( isString(new String('hello')) ) ; // true -
isUint(value)
-
Indicates if an value is an upper integer.
Parameters:
Name Type Description valuenumber The value to evaluates.
Returns:
trueif the passed-in value is an upper integer.Example
trace( isUint(-1) ) ; // false trace( isUint(0) ) ; // true trace( isUint(0.5) ) ; // false trace( isUint(1) ) ; // true
-
requestAnimationFrame(callback)
-
The
requestAnimationFrame()method tells the browser that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint. The method takes as an argument a callback to be invoked before the repaint.Parameters:
Name Type Description callbackfunction A parameter specifying a function to call when it's time to update your animation for the next repaint. The callback has one single argument, a
DOMHighResTimeStamp, which indicates the current time (the time returned fromPerformance.now()) for when requestAnimationFrame starts to fire callbacks.Returns:
A long integer value, the request id, that uniquely identifies the entry in the callback list. This is a non-zero value, but you may not make any other assumptions about its value. You can pass this value to window.cancelAnimationFrame() to cancel the refresh callback request.
- Type
- number
Example
var start = performance.now() ; function step( timestamp ) { var progress = timestamp - start; console.log( 'step: ' + progress ) ; if (progress < 2000) { id = requestAnimationFrame(step); } } var id = requestAnimationFrame(step);