0.1.5 • Published 18 days ago

@leaddreamer/genericutilities v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
18 days ago

view on
npm

@leaddreamer/GenericUtilities

Useful cross-project utilities to be shared between Back and Front End - not browser services.

Modules

GenericUtilities

useful cross-project utilities, to be shared between Back and Front End - not browser services.

Utilities

Typedefs, constants, support functions and database operations for general Utilities

Utilities.simpleObjectCompare(object1, object2) ⇒ boolean

Simple top-level object compare - assumes objects have similar structure - or AT LEAST all the fields of object1 are present in object2

Kind: static method of Utilities

ParamType
object1object
object2object

Utilities.formatItem(thisItem, thisFormat) ⇒ string

Allows string substitution from an object field names support Dot notation field names allow ":" extension for alternate formatting

Kind: static method of Utilities

ParamTypeDescription
thisItemobjectobject to create formated string from
thisFormatstringstring describing formatted output - fieldname wrapped in {} will be substituted. DOT notation allowed for fields.

Utilities.compare(thisItem, anotherItem, sort) ⇒ string

Kind: static method of Utilities

ParamTypeDescription
thisItemobjectone of two objects being compared
anotherItemobjectthe other of two objects being compared
sortstringstring describing sort - format "fieldName:sortType" - sort Type is "string, "date" or "number" (default)

Utilities.anyInAny(findFrom, findIn) ⇒ boolean

An array based compare function - is any entry of findFrom present in findIn

Kind: static method of Utilities

ParamType
findFromArray.any
findInArray.any

Utilities.PromisePoolRunner(entryArray, actionFunction, promiseOptions) ⇒ Promise

Kind: static method of Utilities

ParamType
entryArrayArray.object
actionFunctioncallback
promiseOptionsPromiseOptions

Utilities.lesserOf(args) ⇒ number

A convenience function for legibility

Kind: static method of Utilities
Returns: number - the least of any of the arguments b

ParamTypeDescription
argsanyunbounded list of arguments

Utilities.largerOf(args) ⇒ number

Kind: static method of Utilities
Returns: number - the largest of any of the arguments

ParamTypeDescription
argsanyunbounded list of arguments

Utilities.bound(value, lowerBound, upperBound) ⇒ number

clips value to given bounds

Kind: static method of Utilities

ParamType
valuenumber
lowerBoundnumber
upperBoundnumber

Utilities.blindPush(targetArray, newObject)

function to push an element to an array which may not be initialized

Kind: static method of Utilities

ParamType
targetArrayArray.object
newObjectobject

Utilities.addToArrayObject(arrayObject, key, object)

Kind: static method of Utilities

ParamTypeDescription
arrayObjectArray.Array.object
keystringkey or index to choose which Array.object to add this object to
objectobject

Utilities.makeHexAsNeeded(color) ⇒ string

Kind: static method of Utilities
Returns: string - hex value of named color

ParamTypeDescription
colorstringname of color

Utilities~PromisePool

Kind: inner constant of Utilities

Utilities~promiseOptionsDefault : PromiseOptions

Kind: inner constant of Utilities
Default: {"concurrency":3,"rate":10}
Read only: true

Utilities~generateIterator(entryArray, actionFunction)

An Action Iterator Generator. Cycles through the entries in the passed array, yielding the result of a function for each entry. Only cares that inputs are an array, and a function that returns a promise

Kind: inner method of Utilities

ParamType
entryArrayArray.any
actionFunctioncallback

Utilities~PromiseOptions : object

Kind: inner typedef of Utilities
Properties

NameType
concurrencynumber
ratenumber

PromiseQueue

Typedefs, constants, support functions and database operations related to Promise getQueueSize Thes era euseful for scheduling large serial asynchronous operations


© 2020-2024 Tracy Hall / Dreams and Logic Inc / SaltSweetSpirits

0.1.5

18 days ago

0.1.4

26 days ago

0.1.3

1 month ago

0.1.3-beta.2

2 months ago

0.1.3-beta.1

2 months ago

0.1.3-beta.0

2 months ago

0.1.2

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago

0.1.0-beta.6

3 months ago

0.1.0-beta.5

4 months ago

0.1.0-beta.4

4 months ago