Versions Compared

Key

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

...

Example UsageArgumentsReturn Values
fs.contains(ax);

a - the array to search

x - the item to look for

the index of x if it is in a (the index may be 0 – not truthy!)

false if a isn't an array

-1 if x isn't in the array

areFunctions

Checks if given strings are names of functions on an API and whether the API has functions that are not listed. This is used for unit testing.

Example UsageArgumentsReturn Values
fs.areFunctions(api, fnNames);

api: the factory API object to check

fnNames: an array of strings of function names that should be on the API

true if

  • fnNames given are names of functions on api 
  • api only contains the functions in fnNames

false if

  • fnNames isn't an array
  • if there are names in fnNames that api doesn't have
  • api has functions not accounted for in fnNames
 

 

areFunctionsNonStrict

Checks if given strings are names of functions on an API. This function is similar to areFunctions, but doesn't care about unlisted functions.

Example UsageArgumentsReturn Values
fs.areFunctionsNonStrict(api, fnNames);

api: the factory API object to check

fnNames: an array of strings of function names that should be on the API

true if

  • fnNames given are names of functions on api 

false if

  • fnNames isn't an array
  • if there are names in fnNames that api doesn't have
   

windowSize

Returns inner dimensions of the browser window minus given values.

...