(info) This AI is still in early stages of development.

Check.versionOf()

Check the version of a dependency.

 

Syntax

var version = Check.versionOf(file);

Parameters

ParameterTypeMandatoryNotesUtil.js version
fileString(tick)Name of the file you want to get the version of.1.0

Return Values

ValueTypeNotesUtil.js version
Check.NOT_LOADEDConstantThe file is not yet loaded.1.0
<number>Number

The version of the file that's been loaded.

1.0
<error>ErrorAn error occurred, most likely invalid parameters.1.0

Example

Run code based on file version...
var version = Check.versionOf("foo.js");
 
if (version === Check.NOT_LOADED) { // foo.js isn't loaded yet
 ...
} else if (version >= 2.1) { // v2.1 or higher
 ...
} else { // version less than 2.1
 ...
}
 
// Note:
// if (version === Check.NOT_LOADED) { // foo.js isn't loaded yet
// is equivalent to:
// if (!version) { // foo.js isn't loaded yet
Availability BETA

Requires:

Contents

Jump to:

Dependency Checking

Topics: