clientside-require
Advanced tools
Comparing version 3.3.2 to 3.3.4
{ | ||
"name": "clientside-require", | ||
"version": "3.3.2", | ||
"version": "3.3.4", | ||
"description": "require() modules, js, css, html, and json in the browser with as little effort as loading jquery", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -196,2 +196,3 @@ | ||
var path = base_path + main; // generate path based on the "main" data in the package json | ||
var package_options = package_json["clientside-require"]; | ||
@@ -202,3 +203,3 @@ /* | ||
var injection_require_type = // define require mode for module; overwrites user selected and percolated injection_require_type passed as an argument to this function | ||
(typeof package_json.require_mode == "undefined" || package_json.require_mode !== "async")? "sync" : "async"; // either user package.json defines injection_require_type="async", or we assume its "sync"; | ||
(typeof package_options == "undefined" || typeof package_options.require_mode == "undefined" || package_options.require_mode !== "async")? "sync" : "async"; // either user package.json defines injection_require_type="async", or we assume its "sync"; | ||
if(injection_require_type == "sync"){ // extract dependencies from pacakge list and parsed file | ||
@@ -217,7 +218,6 @@ var module_dependencies = (typeof package_json.dependencies == "undefined")? [] : Object.keys(package_json.dependencies); // get modules this module is dependent on | ||
*/ | ||
var default_options_functions_path = package_json.require_options_functions; | ||
if(typeof default_options_functions_path == "undefined"){ | ||
var promise_default_options_functions = false; // empty | ||
if(typeof package_options == "undefined" || typeof package_options.default_properties == "undefined"){ | ||
var promise_default_options_functions = {}; // empty | ||
} else { | ||
var full_path_to_options_functions = base_path + default_options_functions_path; | ||
var full_path_to_options_functions = base_path + package_options.default_properties; | ||
var promise_default_options_functions = clientside_require.require(full_path_to_options_functions) // retreive the config file | ||
@@ -300,3 +300,3 @@ } | ||
append_functions_to_promise : function(original_promise, promise_default_options_functions){ // options.functions functionality | ||
if(promise_default_options_functions === false) return original_promise; // if no default options are requested, dont wrap the promise. | ||
var promise_options_functions = promise_default_options_functions; | ||
@@ -356,3 +356,4 @@ // generate asnyc property promises rather than regular promises. Uses a proxy and a builder to do so. | ||
} | ||
var async_property_promise = new AsyncPropertyPromise(original_promise, promise_default_options_functions); | ||
var async_property_promise = new AsyncPropertyPromise(original_promise, promise_options_functions); | ||
return async_property_promise; | ||
@@ -430,2 +431,3 @@ }, | ||
var promise_default_options_functions = cache.default_options_functions; | ||
//console.log("resolving here..."); | ||
var promise_resolution = this.package_defaults_functionality.append_functions_to_promise(promise_resolution, promise_default_options_functions); // options.functions functionality | ||
@@ -432,0 +434,0 @@ return promise_resolution; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75159
450