This AI is still in early stages of development.
Check.required()
- Aubergine
Owned by Aubergine
Thrown a descriptive error if dependency check fails...
Syntax
Check.required(dependencies, sdo);
Parameters
Parameter | Type | Mandatory | Notes | Util.js version |
---|---|---|---|---|
dependencies | Dependency Descriptor Object | The dependencies required by your script. | 1.0 | |
sdo | Self Descriptor Object | The SDO of your script. The dependency check will fail if your script is already provided (to prevent double-loading the same script). | 1.0 |
Return Values
Value | Type | Notes | Util.js version |
---|---|---|---|
true | Boolean | All dependency checks were successful. | 1.0 |
<error> | Error | One or more dependency checks failed. The error message is very descriptive and should allow easy debugging. | 1.0 |
Example
Checking dependencies in a sandbox
void (function ProcessAPI(){ // https://warzone.atlassian.net/wiki/display/EGG/Self+Descriptor+Object var self = { file: "Process.js", ver : 0.3 } // https://warzone.atlassian.net/wiki/display/EGG/Dependency+Descriptor+Object var dependencies = { "Util.js": Check.ANY_VERSION, "Diag.js": 0.1 } Check.required(dependencies, self); // rest of your code Check.provide(self); // only gets called if no errors above })();
Contents
Jump to:
Dependency Checking
Topics:
- Tricks for including files — Some tricks with the include() function...
- Dependency Descriptor Object — Define one or more dependencies for your script...
- Check() — Perform a soft-check to see if a dependency is available...
- Check.basePath — The base path to the folder that contains the APIs folder...
- Check.paths[] — Define one or more folder paths to enable autoloading...
- Check.doWhen() — Perform a task when dependencies become available.
- Check.has() — Check if a dependency is available, try and load it if not, return availability state...
- Check.LAZY_LOAD — Disable autoloading during a dependency check...
- Check.required() — Thrown a descriptive error if dependency check fails...
- Check.NOT_LOADED — Indicates a script is not yet loaded, or must not be loaded, depending on the Check function being used...
- Check.ANY_VERSION — Skip version checking for a dependency check...
- Check.provide() — Indicate a file is now available.
- Check.versionOf() — Check the version of a dependency.
- Self Descriptor Object — Define the filename and version of your script...