- Source:
Determines if the passed value is an instance of the referenced type.
Methods
ish.type.is(x, t) → {boolean}
- Source:
Determines if the passed value is an instance of the passed type.
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
t |
variant
|
Type to use during interrogation. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is an instance of the passed type. |
ish.type.is.collection(x, vOptionsopt) → {boolean}
- Source:
Determines if the passed value is a list type (e.g. HTMLCollection|HTMLFormControlsCollection|HTMLOptionsCollection|NodeList|NamedNodeMap|Arguments + Object to support <IE9).
Parameters:
Name |
Type |
Attributes |
Default |
Description |
x |
variant
|
|
|
Value to interrogate. |
vOptions |
object
|
boolean
|
<optional>
|
false
|
Value representing if empty collections are to be ignored or the desired options:
Properties
Name |
Type |
Attributes |
Default |
Description |
disallow0Length |
boolean
|
<optional>
|
false
|
Value representing if empty collections are to be ignored. |
allowObject |
boolean
|
<optional>
|
false
|
Value representing if Objects are to be included in the test (to support <IE9). |
allowArray |
boolean
|
<optional>
|
false
|
Value representing if Arrays are to be included in the test. |
|
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is a collection type. |
ish.type.is.ish(x) → {boolean}
- Source:
Determines if the passed value is an instance of ish.js.
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is an instance of ish.js. |
ish.type.is.ish.import(a_sImport, oOptionsopt)
- Source:
Imports ish.js mixin functionality.
Parameters:
Name |
Type |
Attributes |
Description |
a_sImport |
Array.<string>
|
|
Value representing the mixin paths to import. |
oOptions |
object
|
<optional>
|
Value representing the following options:
Properties
Name |
Type |
Attributes |
Default |
Description |
callback |
boolean
|
<optional>
|
fire:ish.pluginsLoaded
|
Value representing the function to be called on completion; oOptions.callback(a_oProcessedUrls, bAllLoaded) . |
onAppend |
boolean
|
<optional>
|
setAttribute:importedBy
|
Value representing the function to be called when the DOM element is added; oOptions.onAppend(_dom, sUrl) . |
onError |
boolean
|
<optional>
|
|
Value representing the function to be called when an error occurs; oOptions.onError(_dom, sUrl) . |
waitSeconds |
boolean
|
<optional>
|
7
|
Value representing the maximum number of seconds to wait before an error is returned. |
baseUrl |
boolean
|
<optional>
|
""
|
Value representing the base URL to prepend on the src attribute (must end with / ). |
urlArgs |
boolean
|
<optional>
|
""
|
Value representing the URL's querystring to append on the src attribute (must start with ? ). |
importedBy |
boolean
|
<optional>
|
"ish.type.is.ish.import"
|
Value to be set in the DOM element's importedBy attribute. |
|
ish.type.is.native(x) → {boolean}
- Source:
- See:
-
Determines if the passed value is a native Javascript function or object.
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is a native Javascript function or object. |
ish.type.is.numeric(x) → {boolean}
- Source:
Determines if the passed value is a numeric value (includes implicit casting per the Javascript rules, see: {@link: ish.type.int.mk}).
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is a numeric type. |
[mixin]
ish.type.is.numeric.cmp(vNumber, vRelativeTo) → {integer}
- Source:
Compares the passed value to the reference value, determining if it is greater then, less then or equal.
From Mixin: ish.type-ex.js
must be included for ishJS
to access this functionality.
Note: The passed values are implicitly casted per the Javascript rules (see:
ish.type.float.mk).
Parameters:
Name |
Type |
Description |
vNumber |
variant
|
Value representing the number to compare. |
vRelativeTo |
variant
|
Value representing the relative number to compare to. |
Returns:
Type |
Description |
integer
|
Value representing if the passed value is greater then (1 ), less then (-1 ) or equal to (0 ) the passed relative value with undefined indicating one of the passed values was non-numeric. |
[mixin]
ish.type.is.numeric.eq(x, y) → {boolean}
- Source:
Determines if the passed values are equal.
From Mixin: ish.type-ex.js
must be included for ishJS
to access this functionality.
Note: The passed values are implicitly casted per the Javascript rules (see:
ish.type.float.mk).
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
y |
variant
|
Value to interrogate. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed values are equal. |
- Source:
Extracts the passed value's numeric characters.
From Mixin: ish.type-ex.js
must be included for ishJS
to access this functionality.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
x |
variant
|
|
|
Value to interrogate. |
vDefaultVal |
variant
|
<optional>
|
0
|
Value representing the default return value if casting fails. |
Returns:
Type |
Description |
integer
|
Value representing the passed value's numeric characters. |
- Source:
- See:
-
Formats the passed value based on the passed format.
From Mixin: ish.type-ex.js
must be included for ishJS
to access this functionality.
Parameters:
Name |
Type |
Attributes |
Description |
vOptions |
object
|
<optional>
|
Value representing the number of decimal places or the following options:
Properties
Name |
Type |
Attributes |
Default |
Description |
decimalPlaces |
boolean
|
<optional>
|
2
|
Value representing the number of decimal places. |
decimal |
boolean
|
<optional>
|
'.'
|
Value representing the decimal place delimiter. |
section |
boolean
|
<optional>
|
','
|
Value representing the thousands section delimiter. |
sectionLength |
boolean
|
<optional>
|
3
|
Value representing the thousands section length. |
|
Returns:
Type |
Description |
string
|
Value representing the formatted number. |
[mixin]
ish.type.is.numeric.stats(a_vCollection, vPathopt) → {integer}
- Source:
Statistical analysis (mean/average, median, mode, range, sum, count and sorted list of values) of the referenced numbers in the passed value.
From Mixin: ish.type-ex.js
must be included for ishJS
to access this functionality.
Parameters:
Name |
Type |
Attributes |
Description |
a_vCollection |
Array.<integer>
|
Array.<object>
|
|
Value representing the numbers to analyse. |
vPath |
string
|
Array.<string>
|
<optional>
|
Value representing the path to the requested property as a period-delimited string (e.g. "parent.child.array.0.key") or an array of strings. |
Returns:
Type |
Description |
integer
|
Value representing sum of the passed values. |
[mixin]
ish.type.is.numeric.sum(vCollection, vPathopt) → {integer}
- Source:
Sums the referenced numbers in the passed value.
From Mixin: ish.type-ex.js
must be included for ishJS
to access this functionality.
Parameters:
Name |
Type |
Attributes |
Description |
vCollection |
Array.<integer>
|
Array.<object>
|
object
|
|
Value representing the numbers to sum. |
vPath |
string
|
Array.<string>
|
<optional>
|
Value representing the path to the requested property as a period-delimited string (e.g. "parent.child.array.0.key") or an array of strings. |
Returns:
Type |
Description |
integer
|
Value representing sum of the passed values. |
ish.type.is.primitive(x) → {boolean}
- Source:
Determines if the passed value is a primitive (i.e. null
, undefined
, Boolean
, Number
, String
or Symbol
).
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is a primitive. |
[mixin]
ish.type.is.truthy(x) → {boolean}
- Source:
Determines if the passed value is truthy.
From Mixin: ish.type-ex.js
must be included for ishJS
to access this functionality.
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is truthy. |
ish.type.is.value(x) → {boolean}
- Source:
Determines if the passed value is set (i.e. !== undefined
&& !== null
).
Parameters:
Name |
Type |
Description |
x |
variant
|
Value to interrogate. |
Returns:
Type |
Description |
boolean
|
Value representing if the passed value is set. |