Versions Compared

Key

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

...

Note: some of these functions are repeats of jQuery functions. Since we are not using jQuery, we wrote our own implementationimplementations.

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 one with the tagged property with a given key.
inArrayChecks if an item is in the array.
removeFromArrayRemoves specified item from the array.
isEmptyObjectReturns true if the object is empty.
capReturns the 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.

 

Function Descriptions

isF

Short for "is Function".

Example Usage

fs.isF(f);

Arguments

f - the variable to check if it is a function.

Return Value

Truthy: f if typeof is 'function'.

Falsy: null if f is not a function.

isA

Short for "is Array".

Example Usage

fs.isA(a);

Arguments

a - the variable to check if it is an array.

Return Value

Truthy: a if isArray (ECMA5) returns true.

Falsy: null if a is not an array.

isS

Short for "is String".

Example Usage

fs.isS(s);

Arguments

s - the variable to check if it is a string.

Return Value

Truthy: s if typeof is 'string'.

Falsy: null if s is not a string.

isO

Short for "is Object".

Example Usage

fs.isO(o);

Arguments

o - the variable to check if it is an object.

Return Value

Truthy: o if typeof is 'object' and the constructor is Object.

Falsy: null if o is not an object.

contains

Example Usage

fs.contains(a, x);

Arguments

a - the array to search

x - the item to look for

Return Value

Truthy: The index of the item you are looking for.

Falsy: False if a isn't an array, or -1 if x isn't in the array.

areFunctions

areFunctionsNonStrict

...