9.0.4 • Published 6 years ago

@webantic/util v9.0.4

Weekly downloads
1
License
SEE LICENSE IN ./...
Repository
github
Last release
6 years ago

Modules

util/array

util/array~move(array, fromIndex, toIndex) ⇒ Array.<any>

Kind: inner method of util/array
Summary: moves an element at a given index to another index
Export:

ParamTypeDescription
arrayArray.<any>an array containing the element to move
fromIndexnumberthe location of the element to move
toIndexnumberthe destination index

util/array~addToSet(array, item) ⇒ Array.<any>

Kind: inner method of util/array
Summary: Returns an array containing item, adding it if it is missing. Note: this only uses indexOf for comparison, so it will not work for objects
Returns: Array.<any> - the new array
Export:

ParamTypeDescription
arrayArray.<any>an array to potentially add item to
itemanyan item to ensure is within array

util/array~addToSetInPlace(set, item) ⇒ boolean

Kind: inner method of util/array
Summary: Adds item to set if it is missing, returns true if set was modified
Returns: boolean - true if set was modified
Export:

ParamTypeDescription
setArray.<any>a set to potentially add item to
itemanyan item to ensure is within set

util/array~first(array) ⇒ any

Kind: inner method of util/array
Summary: returns the first element in an array
Returns: any - the first element of the array
Export:

ParamTypeDescription
arrayArray.<any>the array to search in

util/array~last(array) ⇒ any

Kind: inner method of util/array
Summary: returns the last element in an array
Returns: any - the last element of the array
Export:

ParamTypeDescription
arrayArray.<any>the array to search in

util/array~eachUntil(array, callback)

Kind: inner method of util/array
Summary: calls callback for each item in an array, provided that the previous iteration didn't return false
Export:

ParamTypeDescription
arrayArray.<any>of items to iterate
callbackForEachCallbackthe function to invoke for each element in the supplied array

util/array~remove(array, item) ⇒ Array.<any>

Kind: inner method of util/array
Summary: Remove an item from an array
Returns: Array.<any> - The new array
Export:

ParamTypeDescription
arrayArray.<any>The array to remove item from
itemanyThe item to remove. Cannot be an object

Example

var array = ['a', 'b', 'c']
remove(array, 'b') // returns ['a', 'c']

util/array~removeAll(array, item) ⇒ Array.<any>

Kind: inner method of util/array
Summary: Removes all occurrences of item from array
Returns: Array.<any> - The new array
Export:

ParamTypeDescription
arrayArray.<any>The array to remove all occurrences of item from
itemanyThe item to remove

Example

var array = ['a', 'b', 'b', 'c']
removeAll(array, 'b') // returns ['a', 'c']

util/array~forceArray(input) ⇒ Array.<any>

Kind: inner method of util/array
Summary: wraps the input in an array if it isn't already one
Returns: Array.<any> - always an array

ParamType
inputany

util/array~mapAsync(array, callback, onComplete)

Map an array's values, iterating asynchronously

Kind: inner method of util/array

ParamDescription
arrayThe array to map
callbackA callback to receive the current element & index. Should return the new value
onCompleteA callback which will be called when all elements have been processed

util/array~forEachAsync(array, cb, onComplete)

Iterate the elements in an array, calling the user-supplied callback on each element asynchronously

Kind: inner method of util/array

ParamTypeDescription
arrayArray.<any>The array to iterate
cbArrayTypes.MapCallbackFunctionthe callback to receive the element(s)
onCompleteArrayTypes.CallbackFunctionA callback to be called when all elements have been iterated

util/blaze

util/blaze~attachAPI(blaze, API)

Attach a DDP connection to Blaze so that it is available in templates' this.subscribe

Kind: inner method of util/blaze

ParamTypeDescription
blazeObjecta reference to Blaze
APIObjectThe DDP connection to attachs

util/blaze~onCountChanged(callback)

Add a function to get called when the count changes

Kind: inner method of util/blaze

ParamType
callbackfunction

util/collection

util/collection~insert(collection, items) ⇒ ICollectionReturn

Kind: inner method of util/collection
Summary: Inserts a number of items into the given collection
Export:

ParamTypeDescription
collectionMongo.CollectionA Mongo.Collection
itemsArray.<object>the items to insert.

util/collection~update(collection, items) ⇒ ICollectionReturn

Kind: inner method of util/collection
Summary: Updates a number of items into the given collection
Export:

ParamTypeDescription
collectionMongo.CollectionA Mongo.Collection
itemsArray.<object>the items to update. The _id field is used as a selector, the rest of the object as the modifier

util/collection~remove(collection, _ids) ⇒ ICollectionReturn

Kind: inner method of util/collection
Summary: Remvoves a number of items by their _id from the given collection
Export:

ParamTypeDescription
collectionMongo.CollectionA Mongo.Collection
_idsArray.<string>the _ids of the items to remove.

util/collection~caseInsensitiveSelector(fieldName, str, wordIsPrefix) ⇒ Object

Kind: inner method of util/collection
Summary: Generates a selector for a field which will perform a case-insensitive lookup for the given value
Returns: Object - the Mongo selector object
Export:

ParamTypeDefaultDescription
fieldNamestringthe name of the field to query
strstringthe value to query
wordIsPrefixbooleanfalsewhether the supplied value for str is a prefix or the whole query

util/collection~selectorFromParams(selectorParams) ⇒ Object

Kind: inner method of util/collection
Summary: Parses "skip", "limit", "sort", "before" and "since" into a selector and options object
Returns: Object - The constructed selector & options objects
Export:

ParamTypeDescription
selectorParamsISelectorParamsAn object containing any/all of the defined keys. "createdOrUpdated" can be either "createdAt" (default) or "updatedAt". It determines what "before" and "since" act upon

util/collection~getObserverHandlers(context, collection) ⇒ IObserveHandlers

Kind: inner method of util/collection
Summary: Returns a map of default observe callback handlers
Returns: IObserveHandlers - The map of callback handlers
Export:

ParamTypeDescription
contextanyThe this context. It should contain added, changed and removed methods
collectionstringThe name of the collection to add/change/remove documents to/from

util/collection~mapHelpersToThis(pureHelpers) ⇒ any

Takes an object of helpers and wraps them in functions that use the this context and pass it as the first arg. Allows thisless functions to be used as collection helpers

Kind: inner method of util/collection

ParamTypeDescription
pureHelpersanyhelpers to map

util/collection~IFailedOps : Object

Kind: inner typedef of util/collection
Properties

NameTypeDescription
codenumberthe error code
messagestringthe error message
additionalanymeta information about the error

util/collection~ICollectionReturn : Object

Kind: inner typedef of util/collection
Properties

NameTypeDescription
successbooleanWhether no operations failed
failedArray.<IFailedOps>an array of objects detailling failed operations
succeededArray.<(any|boolean)>an array of objects detailling documents of successful operations

util/collection~IObserveHandlers : Object

Kind: inner typedef of util/collection
Properties

NameType
addedfunction
changedfunction
removedfunction

util/collection~ISelectorParams : Object

Kind: inner typedef of util/collection
Properties

NameTypeDefaultDescription
skipnumberA number indicating how many matching documents to skip
limitnumberA number indicating the maximum number of documents to return
sortObject.<number>An object whose keys equate to database column names and whose values are either 1 or -1 to indicate sort order
createdOrUpdatedstring"\"createdAt\""
beforeDate | string | numberA parsable representation of a date. Only documents whose createdAt or updatedAt (as defined by createdOrUpdated) are greater than the supplied value will be returned
sinceDate | string | numberA parsable representation of a date. Only documents whose createdAt or updatedAt (as defined by createdOrUpdated) are less than the supplied value will be returned
fieldsObject.<number>An object whose keys equate to database column names and whose values are either 1 or 0 to indicate inclusion or exclusion

util/config

util/config~Configuration

Kind: inner class of util/config

new Configuration(collection, Meteor, Tracker, connection)

A configuration class - provides a DB-backed, environment variable / meteor.settings populated set of config values

ParamTypeDescription
collectionMongo.Collectionthe config collection
MeteorObjecta reference to the Meteor object
TrackerObjectan optional reference to Tracker - will be mocked in a non-reactive way if not supplied
connectionObjectan optional override for the DDP connection to use to subscribe to the config pub

util/config~StandaloneConfiguration

Kind: inner class of util/config

new StandaloneConfiguration()

A configuration class - provides an environment variable / codebase-populated set of config values

util/data

util/data~titles(flatten) ⇒ Array.<object> | Array.<string>

Kind: inner method of util/data
Summary: provides a list of name titles
Returns: Array.<object> | Array.<string> - If flatten is true, an array of string values otherwise an array of objects with name and camelized value
Export:

ParamTypeDefaultDescription
flattenbooleanfalsewhether to return an array of plain text values

util/data~genders(flatten) ⇒ Array.<object> | Array.<string>

Kind: inner method of util/data
Summary: provides a list of genders
Returns: Array.<object> | Array.<string> - If flatten is true, an array of string values otherwise an array of objects with name and camelized value
Export:

ParamTypeDefaultDescription
flattenbooleanfalsewhether to return an array of plain text values

util/data~maritalStatuses(flatten) ⇒ Array.<object> | Array.<string>

Kind: inner method of util/data
Summary: provides a list of maritalStatuses
Returns: Array.<object> | Array.<string> - If flatten is true, an array of string values otherwise an array of objects with name and camelized value
Export:

ParamTypeDefaultDescription
flattenbooleanfalsewhether to return an array of plain text values

util/data~nationalities(flatten) ⇒ Array.<object> | Array.<string>

Kind: inner method of util/data
Summary: provides a list of nationalities
Returns: Array.<object> | Array.<string> - If flatten is true, an array of string values otherwise an array of objects with name and camelized value
Export:

ParamTypeDefaultDescription
flattenbooleanfalsewhether to return an array of plain text values

util/date

util/date~randomBetween(from, to) ⇒ Date

Kind: inner method of util/date
Summary: gets a random date between two others
Returns: Date - the random date
Export:

ParamTypeDescription
fromDaterandom date must be greater than this
toDaterandom date must be less than this

util/date~getDate(startEnd, prevNext, interval) ⇒ Date

Gets a Date object of a given offset from now

Kind: inner method of util/date
Returns: Date - the date object

ParamTypeDefaultDescription
startEndstringEither 'start' or 'end' to round the date to the start or end of the day
prevNextstring"'prev'"
intervalstring"'day'"

util/date~yesterday(startEnd) ⇒ Date

Return a Date object from 24 hours ago

Kind: inner method of util/date
Returns: Date - the date object

ParamTypeDescription
startEndstringeither 'start' or 'end' - determines whether to round the date to the start or end of the day

util/date~tomorrow(startEnd) ⇒ Date

Return a Date object for 24 hours in the future

Kind: inner method of util/date
Returns: Date - the date object

ParamTypeDescription
startEndstringeither 'start' or 'end' - determines whether to round the date to the start or end of the day

util/date~lastWeek(startEnd) ⇒ Date

Return a Date object from 7 days ago

Kind: inner method of util/date
Returns: Date - the date object

ParamTypeDescription
startEndstringeither 'start' or 'end' - determines whether to round the date to the start or end of the day

util/date~nextWeek(startEnd) ⇒ Date

Return a Date object for 7 days in the future

Kind: inner method of util/date
Returns: Date - the date object

ParamTypeDescription
startEndstringeither 'start' or 'end' - determines whether to round the date to the start or end of the day

util/date~lastMonth(startEnd) ⇒ Date

Return a Date object from 30 days ago

Kind: inner method of util/date
Returns: Date - the date object

ParamTypeDescription
startEndstringeither 'start' or 'end' - determines whether to round the date to the start or end of the day

util/date~nextMonth(startEnd) ⇒ Date

Return a Date object for 30 days in the future

Kind: inner method of util/date
Returns: Date - the date object

ParamTypeDescription
startEndstringeither 'start' or 'end' - determines whether to round the date to the start or end of the day

util/date~getPreviousDay(day) ⇒ string

Can be passed either a full or three-letter day name and will return the previous day's name

Kind: inner method of util/date
Returns: string - the name of the previous day

ParamTypeDescription
daystringa full or three-letter day name

util/date~getNextDay(day) ⇒ string

Can be passed either a full or three-letter day name and will return the next day's name

Kind: inner method of util/date
Returns: string - the name of the next day

ParamTypeDescription
daystringa full or three-letter day name

util/emitter

util/emitter.MultiEmitter

Kind: static class of util/emitter
Export:

new MultiEmitter()

Slightly more advanced event emitter style class that allows listening to different events via string arguments

util/emitter.Emitter

Kind: static class of util/emitter
Export:

new Emitter()

Basic class that represents an event that can be listened to and broadcasted

util/emitter.MultiEmitter#listen(event, callback)

Add a callback to be ran whenver this event is broadcasted

Kind: static method of util/emitter

ParamDescription
eventthe event as a string to be listened to
callbackthe callback to run whenever said event is triggered

util/emitter.MultiEmitter#broadcast(event, value)

Broadcast an event of the given type

Kind: static method of util/emitter

ParamDescription
eventeven type to broadcast
valuevalue to be passed to each callback

util/emitter.MultiEmitter#removeListeners(event)

Remove all attached listeners for a specific event type

Kind: static method of util/emitter

Param
event

util/emitter.Emitter#listen()

Add a callback to be ran whenver this event is broadcasted

Kind: static method of util/emitter

util/emitter.Emitter#broadcast(value)

Calls all callbacks that have been registered with the given value

Kind: static method of util/emitter

ParamDescription
valuevalue to broadcast, if any

util/emitter.Emitter#removeListeners()

Remove all attached listeners

Kind: static method of util/emitter

util/http

util/http~getBaseParameter({ location, type, required }) ⇒ Object

Kind: inner method of util/http
Summary: returns a basic Swagger parameter field
Export:

ParamTypeDefault
{ location, type, required }*{}

util/http~requiredBodyString(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a required body string parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~requiredBodyNumber(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a required body number parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~requiredBodyDate(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a required body string parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~requiredBodyBoolean(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a required body boolean parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~requiredBodyObject(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a required body object parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~optionalBodyString(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a optional body string parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~optionalBodyNumber(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a optional body number parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~optionalBodyDate(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a optional body string parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~optionalBodyBoolean(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a optional body boolean parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/http~optionalBodyObject(extendedDef) ⇒ Object

Kind: inner method of util/http
Summary: scaffolds a optional body object parameter
Export:

ParamTypeDescription
extendedDefObjectthe rest of the definition

util/image

util/image~dataURIToBlob(dataURI) ⇒ blob

Kind: inner method of util/image
Summary: converts a data uri to a blob://
Returns: blob - the uri as a blob
Export:

ParamTypeDescription
dataURIstringthe data uri to convert into a blob

util/image~toDataURI(file, callback)

Kind: inner method of util/image
Summary: converts an image file to a data uri
Export:

ParamTypeDescription
fileFilethe image file to convert
callbackfunctiona function to receive the result of the conversion

util/location

util/location~calculateDistance(lat1, lon1, lat2, lon2) ⇒ number

Kind: inner method of util/location
Summary: Get the distance in KM between two latitude/longitude pairs
Returns: number - The distance between the two points, in KM
Export:

ParamTypeDescription
lat1numberThe first latitude
lon1numberThe first longitude
lat2numberThe second latitude
lon2numberThe second longitude

util/meteor

util/meteor~assert(assertion, errorCode, meta)

Kind: inner method of util/meteor
Summary: if the assertion is falsey, throws an error
Export:

ParamTypeDescription
assertionanyanything that should be truthy to not throw an error
errorCodenumberthe error code
metaanyadditional info to include with the error

util/meteor~assertString(value, name)

Assert that the typeof ${value} is 'string'

Kind: inner method of util/meteor

ParamDescription
valueany value to check the type of
namethe name of the value being checked

util/meteor~assertBoolean(value, name)

Assert that the typeof ${value} is 'boolean'

Kind: inner method of util/meteor

ParamDescription
valueany value to check the type of
namethe name of the value being checked

util/meteor~assertNumber(value, name)

Assert that the typeof ${value} is 'number'

Kind: inner method of util/meteor

ParamDescription
valueany value to check the type of
namethe name of the value being checked

util/meteor~assertInt(value, name)

Assert that the ${value} is an integer

Kind: inner method of util/meteor

ParamDescription
valueany value to check the type of
namethe name of the value being checked

util/meteor~assertObject(value, name)

Assert that the typeof ${value} is 'object'

Kind: inner method of util/meteor

ParamDescription
valueany value to check the type of
namethe name of the value being checked

util/meteor~assertArray(value, name, type)

Assert that the ${value} is an array

Kind: inner method of util/meteor

ParamDescription
valueany value to check the type of
namethe name of the value being checked
typethe expected datatype of every item within the supposed array

util/meteor~assertDate(value, options)

Assert that the typeof ${value} is 'Date'

Kind: inner method of util/meteor

ParamDescription
valueany value to check the type of
optionswhether to parse the date

util/model

util/model~ModelDefinition

Kind: inner class of util/model
Export:

new ModelDefinition(t)

Class to generate model definitions

ParamTypeDescription
tstringThe type for this definition

ModelDefinition.ModelDefinition#auto(func) ⇒ this

Define an autoValue

Kind: static method of ModelDefinition

ParamTypeDescription
funcfunctionThe autovalue function

ModelDefinition.ModelDefinition#maybe() ⇒ this

Set this field as optional

Kind: static method of ModelDefinition

ModelDefinition.ModelDefinition#max(val, exclusive) ⇒ this

Set this field's maximum allowed value / length

Kind: static method of ModelDefinition

ParamTypeDefaultDescription
valnumberThe max value / length
exclusivebooleanfalseWhether this value is an exclusive max

ModelDefinition.ModelDefinition#min(val, exclusive) ⇒ this

Set this field's minimum allowed value / length

Kind: static method of ModelDefinition

ParamTypeDefaultDescription
valnumberThe min value / length
exclusivebooleanfalseWhether this value is an exclusive min

ModelDefinition.ModelDefinition#maxCount(val) ⇒ this

Set the maximum number of allowed elements in an array field

Kind: static method of ModelDefinition

ParamTypeDescription
valnumberThe max number of elements

ModelDefinition.ModelDefinition#minCount(val) ⇒ this

Set the minimum number of allowed elements in an array field

Kind: static method of ModelDefinition

ParamTypeDescription
valnumberThe min number of elements

ModelDefinition.ModelDefinition#subtype(format) ⇒ this

Set the subtype / format of this field. E.g. "float" for a number type

Kind: static method of ModelDefinition

ParamTypeDescription
formatstringThe format / subtype

ModelDefinition.ModelDefinition#prop(name, value) ⇒ this

Define a single property of an object-type field

Kind: static method of ModelDefinition

ParamTypeDescription
namestringThe property name
valueModelDefinitionThe property value

ModelDefinition.ModelDefinition#props(properties) ⇒ this

Define all properties of an object-type field

Kind: static method of ModelDefinition

ParamTypeDescription
properties*The property definitions

ModelDefinition.ModelDefinition#elems(definition) ⇒ this

Define the elements of an array-type field

Kind: static method of ModelDefinition

ParamTypeDescription
definitionModelDefinitionThe definition which applies to all elements

ModelDefinition.ModelDefinition#regex(pattern) ⇒ this

Define a RegEx pattern which applies to a string-type field

Kind: static method of ModelDefinition

ParamTypeDescription
patternRegExThe pattern

ModelDefinition.ModelDefinition#in(values) ⇒ this

Define a list of permitted values for this field

Kind: static method of ModelDefinition

ParamTypeDescription
valuesArray | ILinkThe array of allowed values

ModelDefinition.ModelDefinition#join(model, field, where) ⇒ this

Define a link to another Model

Kind: static method of ModelDefinition

ParamTypeDefaultDescription
modelstringThe name of the model
fieldstring"'_id'"The field on the other model to join on
where*An optional selector for items in the foreign model

ModelDefinition.ModelDefinition#other(key, value) ⇒ this

Set a custom definition key

Kind: static method of ModelDefinition

ParamTypeDescription
keystringThe key name
value*The value

util/model~def ⇒ this

Shorthand to get an instance of ModelDefinition

Kind: inner constant of util/model

ParamTypeDescription
typestringThe type of the field (e.g. 'string' / 'boolean')

util/model~ILinkWhere : Object

Kind: inner typedef of util/model
Properties

NameType
**

util/model~ILink : Object

Kind: inner typedef of util/model
Properties

NameType
modelstring
fieldstring
whereILinkWhere

util/number

util/number~clamp(val, min, max) ⇒ number

Kind: inner method of util/number
Summary: ensures that a number falls between two others, constraining it if necessary
Returns: number - the clamped number
Export:

ParamTypeDescription
valnumberthe number to clamp
minnumberthe minimum that the number should be
maxnumberthe maximum that the number should be

util/number~random(min, max)

Kind: inner method of util/number
Summary: Returns a random integer, optionally between an min and max
Export:

ParamTypeDescription
minnumberThe minimum acceptable value
maxnumberThe maximum acceptable value

util/number~pad(num, width, char) ⇒ string

Kind: inner method of util/number
Summary: pads out a number to specified width with specified char or 0
Returns: string - the padded number
Export:

Param
num
width
char

util/object

util/object~map(object, callback) ⇒ any

Kind: inner method of util/object
Summary: passes each key=>value pair to callback, setting the result to a new object under a key of the same name
Returns: any - a new object with the same key names but mapped values
Export:

ParamTypeDescription
objectanythe object whose values to map
callbackfunctiona function to pass each key=>value pair to

util/object~transform(object, callback)

Kind: inner method of util/object
Summary: Like map, but able to transform the key too. Map the object into a completely different

ParamDescription
objectthe object to transform
callbackcallback to perform the transformation, return an array like key, value

util/object~forEach()

Kind: inner method of util/object
Summary: Like array.forEach, but for an object, gets keys and values

util/object~filter(object, callback) ⇒ any

Kind: inner method of util/object
Summary: passes each key=>value pair of an object to callback, copying them over if the result is truthy
Returns: any - a filtered copy of the input object
Export:

ParamTypeDescription
objectanythe object whose keys to filter
callbackfunctionthe function to pass each key=>value pair to

util/object~resolve() ⇒ any | undefined

Kind: inner method of util/object
Summary: get a nested property of an object by string e.g. resolve(myObj, 'nested.property')
Returns: any | undefined - resolved value or undefined if intermediate values are undefined
Export:

util/object~didResolve() ⇒ boolean

Kind: inner method of util/object
Summary: report whether an attempt to resolve a nested property of an object was successful or not.
Returns: boolean - whether the nested property exists
Export:

util/object~resolveIf() ⇒ any | null

Kind: inner method of util/object
Summary: same as resolve but sets the property to val
Returns: any | null - The resolved value or null
Export:

util/object~resolveSet() ⇒ boolean

Kind: inner method of util/object
Summary: same as resolve but sets the property to val
Returns: boolean - whether setting was successful
Export:

util/object~transformPathsToObjects(obj) ⇒

Transform an entire object by converting all of its keys into object paths using resolveSet

Kind: inner method of util/object
Returns: obj for convenience, although transformed in place

ParamDescription
objthe object to transform (transformed in place)

util/object~flatten(input, _output, _prefix)

Convert a deep object into one which is flat (has a max depth of 1 level). The output object's keys will use dot notation to symbolise depth. If a property contains a dot, this will be converted to "dot"

Kind: inner method of util/object

ParamTypeDescription
inputobjectAn input object. Required
_outputobjectPrivate param used in recursion
_prefixstringPrivate param used in recursion

Example

var deepObj = {person: {profile: {name: 'Carl', age: 26}, password: 'foobar', '.withDot': true}}
    var res = flatten(deepObj)
    // res === {
    //   'person.profile.name': 'Carl',
    //   'person.profile.age': 26,
    //   'person.password': 'foobar',
    //   'person.[dot]withDot': true
    // }

util/object~flattenAll(input, _output, _prefix)

Convert a deep object into one which is flat (has a max depth of 1 level). The output object's keys will use dot notation to symbolise depth. Also processes arrays

Kind: inner method of util/object

ParamTypeDescription
inputobjectAn input object. Required
_outputobjectPrivate param used in recursion
_prefixstringPrivate param used in recursion

Example

var deepObj = {person: {profile: {name: 'Carl', age: 26}, things: ['foo', 'bar'], '.withdot': true}}
    flattenAll(deepObj)
    // returns {
    //   'person.profile.name': 'Carl',
    //   'person.profile.age': 26,
    //   'person.things.0': 'foo',
    //   'person.things.1': 'bar'
    //   'person.[dot]withDot: true
    // }

util/object~resolveSetP(outerObj, outerPath, outerVal) ⇒ boolean

Kind: inner method of util/object
Summary: same as resolveSet, but will create paths down into objects where they don't exist
Returns: boolean - whether the op was successful
Export:

ParamTypeDescription
outerObjobjectthe object to create the value in
outerPathstringthe path (dot notation) into the object
outerValanythe new value

util/object~mapAsync

Kind: inner typedef of util/object
Summary: passes each key=>value pair to callback asynchronously, setting the result to a new object under a key of the same name. Calls onComplete when all keys have been mapped
Export:

ParamTypeDescription
objectanythe object whose values to map
callbackfunctiona function to pass each key=>value pair to
onCompletefunctiona callback which will receive two arguments, error and res

util/object~transformAsync

Kind: inner typedef of util/object
Summary: Like map, but able to transform the key too. Map the object into a completely different shape. Iterates asynchronously
Export:

ParamTypeDescription
objectanythe object to transform
cbfunctioncallback to perform the transformation, return an array like key, value
onCompletefunctiona callback which will received two arguments, error and res

util/popover

util/popover~open(source, content, options)

Opens a popover with the specified content located on the edge of the source object

Kind: inner method of util/popover

ParamDescription
sourcethe target element this popover should be attached to
contentthe content to show in the popover
options

util/popover~openDropdown(source, dropDownItems, options)

Opens a dropdown, which internally is still a popover with some special additions

Kind: inner method of util/popover(#mod

9.0.4

6 years ago

9.0.3

6 years ago

9.0.2

6 years ago

9.0.1

6 years ago

9.0.0

6 years ago

8.7.2

6 years ago

8.7.1

6 years ago

8.7.0

6 years ago

8.6.0

6 years ago

8.5.2

6 years ago

8.5.1

6 years ago

8.5.0

6 years ago

8.4.1

6 years ago

8.4.0

6 years ago

8.3.1

7 years ago

8.3.0

7 years ago

8.2.4

7 years ago

8.2.3

7 years ago

8.2.2

7 years ago

8.1.1

7 years ago

8.1.0

7 years ago

8.0.1

7 years ago

7.4.0

7 years ago

7.3.0

7 years ago

7.2.0

7 years ago

7.1.0

7 years ago

7.0.0

7 years ago

6.2.7

7 years ago

6.2.6

7 years ago

6.2.5

7 years ago

6.2.4

7 years ago

6.2.2

7 years ago

6.2.1

7 years ago

6.2.0

7 years ago

6.1.0

7 years ago

6.0.9

7 years ago

6.0.8

7 years ago

6.0.7

7 years ago

6.0.6

7 years ago

6.0.5

7 years ago

6.0.4

7 years ago

6.0.3

7 years ago

6.0.2

7 years ago

6.0.1

7 years ago

5.5.3

7 years ago

5.5.1

7 years ago

5.5.0

7 years ago

5.4.1

7 years ago

5.4.0

7 years ago

5.3.8

7 years ago

5.3.7

7 years ago

5.3.6

7 years ago

5.3.5

7 years ago

5.3.4

7 years ago

5.3.3

7 years ago

5.3.2

7 years ago

5.3.1

7 years ago

5.3.0

7 years ago

5.2.1

7 years ago

5.2.0

7 years ago

5.1.0

7 years ago

5.0.7

7 years ago

5.0.6

7 years ago

5.0.5

7 years ago

5.0.4

7 years ago

5.0.3

7 years ago

5.0.2

7 years ago

5.0.1

7 years ago

5.0.0

7 years ago

4.1.1

7 years ago

4.1.0

7 years ago

4.0.5

7 years ago

4.0.4

7 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.16.9

7 years ago

3.16.8

7 years ago

3.16.7

7 years ago

3.16.6

7 years ago

3.16.5

7 years ago

3.16.4

7 years ago

3.16.3

7 years ago

3.16.2

7 years ago

3.16.1

7 years ago

3.16.0

7 years ago

3.15.0

7 years ago

3.14.10

7 years ago

3.14.9

7 years ago

3.14.8

7 years ago

3.14.7

7 years ago

3.14.6

7 years ago

3.14.5

7 years ago

3.14.4

7 years ago

3.14.3

7 years ago

3.14.2

7 years ago

3.14.1

7 years ago

3.14.0

7 years ago

3.13.1

7 years ago

3.12.8

7 years ago

3.12.7

7 years ago

3.12.6

7 years ago

3.12.5

7 years ago

3.12.4

7 years ago

3.12.3

7 years ago

3.12.2

7 years ago

3.12.1

7 years ago

3.12.0

7 years ago

3.11.3

7 years ago

3.11.2

7 years ago

3.11.1

7 years ago

3.11.0

7 years ago

3.10.6

7 years ago

3.10.5

7 years ago

3.10.4

7 years ago

3.10.3

7 years ago

3.10.2

7 years ago

3.10.1

7 years ago

3.10.0

7 years ago

3.9.9

7 years ago

3.9.8

7 years ago

3.9.6

7 years ago

3.9.5

7 years ago

3.9.4

7 years ago

3.9.3

7 years ago

3.9.2

7 years ago

3.9.1

7 years ago

3.9.0

7 years ago

3.8.0

7 years ago

3.7.0

7 years ago

3.6.0

7 years ago

3.5.0

7 years ago

3.4.4

7 years ago

3.4.3

7 years ago

3.4.2

7 years ago

3.4.1

7 years ago

3.4.0

7 years ago

3.3.4

8 years ago

3.3.3

8 years ago

3.3.2

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.6

8 years ago

3.1.6

8 years ago

3.1.5

8 years ago

3.1.4

8 years ago

3.1.3

8 years ago

3.1.2

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.11.1

8 years ago

2.11.0

8 years ago

2.10.0

8 years ago

2.9.0

8 years ago

2.8.0

8 years ago

2.7.1

8 years ago

2.7.0

8 years ago

2.6.0

8 years ago

2.5.1

8 years ago

2.5.0

8 years ago

2.4.2

8 years ago

2.4.1

8 years ago

2.4.0

8 years ago

2.3.0

8 years ago

2.2.15

8 years ago

2.2.14

8 years ago

2.2.13

8 years ago

2.2.12

8 years ago

2.2.11

8 years ago

2.2.10

8 years ago

2.2.9

8 years ago

2.2.8

8 years ago

2.2.7

8 years ago

2.2.6

8 years ago

2.2.5

8 years ago

2.2.4

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago