Module: utils

Methods


<static> createMethodSignature(error, data)

createMethodSignature Create default signature method object.

createMethodSignature Create default signature method object
Parameters:
Name Type Description
error string | object The string or error object if have any
data object | array | number | string | boolean Information about method execution
Source:
Returns:
  • signature - Default methods signature format { error, data }
    Type
    object
  • signature.error - Execution error
    Type
    string | object
  • signature.data - Execution data
    Type
    object | array | number | string | boolean

<static> getSearchTokenStream()

getSearchTokenStream generates a lunr search token.

getSearchTokenStream generates a lunr search token. See lunr search
Source:
Returns:
token
Type
array

<static> mongooseToDexieTableString()

mongooseToDexieTableString convert given Mongoose schema to a Dexie Table columns configuration.

mongooseToDexieTableString convert given Mongoose schema to a Dexie Table columns configuration.
All columns inside returned configuration are indexed at IndexedDB prepend __id as local primary key and _id for remote primary key Local primary key is integer and auto incremented
Source:
Returns:
Dexie table configuration string
Type
string

<static> toJSON(obj)

toJSON - stringify and parse an object
It uses native JSON internally.

toJSON - stringify and parse an object
It uses native JSON internally.
Parameters:
Name Type Description
obj string | object Valid JSON object or string
Source:
Returns:
new JSON object
Type
object

<static> uuid()

uuid generates a Universally unique identifier string.

uuid generates a Universally unique identifier string
Source:
Returns:
guid / uuid
Type
string