Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is a work in progress.

FnService - Function Service

...

NameSummary
isFChecks if argument is a function.
isAChecks if argument is an array.
isS

Checks if argument is a string.

isOChecks if argument is an object.
containsChecks if an array contains a value.
areFunctionsChecks if given strings are names of functions on an API and whether the API has functions that are not listed.
areFunctionsNonStrictChecks if given strings are names of functions on an API. (Doesn't care about unlisted functions.)
windowSizeReturns inner dimensions of the window minus given values.
isMobileReturns true if the device viewing the GUI is a mobile device.
debugOnReturns true if the debug flag is turned on in query params.
findSearches through an array of objects looking for the object with the tagged property with a given key and a specific property name and property value and returns its index.
inArrayFinds an item's index in the array.
removeFromArrayRemoves the first occurrence of the specified item from the array.
isEmptyObjectReturns true if the object is empty (has no non-default properties).
capReturns the given string with only the first letter capitalized.
noPxReturn the argument without the 'px' suffix.
noPxStyle

Return the element's style property without the 'px' suffix.

endsWithChecks if the given string ends with a given suffix.
parseBitRateReturns a Number version of the given string bit rate.

...

Searches through an array of objects looking for the object with the tagged property with a given key a specific property name (tag) and property value (key) and returns its index.

Example UsageArgumentsDefault ParamsReturn Values
fs.find(key, array, tag);

key: property value you are searching for

array: array of objects to search through

tag: property name you are searching for

tag: 'id'

the index of the object in the array, if found (the index may be 0 – not truthy!)

-1 if it wasn't found

Note: this function searches for a specific name-value pair in an object, as in:

'tag': 'key'

'tag' defaults to 'id' for searching through objects because 'id' is usually unique.

inArray

Finds an item's index in the array.

...