1.0.3 • Published 7 years ago

spook-utils v1.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

spookUtils : object

Kind: global namespace

spookUtils.cloneObject(inputObject, targetObj) ⇒ object

Creates a new object that shares the same property values as an original object

Kind: static method of spookUtils
Returns: object - The object result of the cloning operation

ParamTypeDescription
inputObjectobjectThe object to clone
targetObjobjectAn optional target object to clone to

spookUtils.combineObjects(objArray) ⇒ object

Combines a collection of objects and returns the resulting object

Kind: static method of spookUtils
Returns: object - The result of combining the objects

ParamTypeDescription
objArrayarrayAn array of objects to combine

spookUtils.isValidObject(inputObject) ⇒ boolean

Determines if an object is a valid, non-null object

Kind: static method of spookUtils
Returns: boolean - The boolean result of evaluating inputObject

ParamTypeDescription
inputObjectobjectThe object to validate

spookUtils.validBoolean(inputObject, returnValue) ⇒ boolean

Attempts to parse an object as a valid boolean

Kind: static method of spookUtils
Returns: boolean - The boolean result of evaluating inputObject

ParamTypeDescription
inputObjectobjectThe object to validate as a boolean
returnValuebooleanThe default value to return, defaults to false

spookUtils.validNumber(inputObject, returnValue) ⇒ number

Attempts to parse an object as a valid base-10 number

Kind: static method of spookUtils
Returns: number - The numerical result of evaluating inputObject

ParamTypeDescription
inputObjectobjectThe object to validate as a number
returnValuenumberThe default value to return, defaults to 0

spookUtils.validObject(inputObject, returnValue) ⇒ object

Attempts to parse an object as a valid object

Kind: static method of spookUtils
Returns: object - The object result of evaluating inputObject

ParamTypeDescription
inputObjectobjectThe object to validate as an object
returnValueobjectThe default value to return, defaults to null

spookUtils.validString(inputObject, returnValue) ⇒ string

Attempts to parse an object as a valid string

Kind: static method of spookUtils
Returns: string - The string result of evaluating inputObject

ParamTypeDescription
inputObjectobjectThe object to validate as an object
returnValuestringThe default value to return, defaults to ''