- Linting (ESLint): Remove now unneeded config and add per new update
- Refactoring: Prefer for-of, event.key (newly enforced linting) - Refactoring: Better var. names - npm: Update devDeps and update local copies
This commit is contained in:
@@ -19,7 +19,7 @@ function toAbsoluteURL (url) {
|
||||
/**
|
||||
* Add any of the whitelisted attributes to the script tag.
|
||||
* @param {HTMLScriptElement} script
|
||||
* @param {PlainObject.<string, string>} atts
|
||||
* @param {PlainObject<string, string>} atts
|
||||
* @returns {void}
|
||||
*/
|
||||
function addScriptAtts (script, atts) {
|
||||
@@ -36,15 +36,14 @@ function addScriptAtts (script, atts) {
|
||||
* @property {string} global The variable name to set on `window` (when not using the modular version)
|
||||
* @property {boolean} [returnDefault=false]
|
||||
*/
|
||||
/* eslint-disable jsdoc/check-types */
|
||||
|
||||
/**
|
||||
* @function module:importModule.importSetGlobalDefault
|
||||
* @param {string|string[]} url
|
||||
* @param {string|GenericArray<Any>} url
|
||||
* @param {module:importModule.ImportConfig} config
|
||||
* @returns {Promise<*>} The value to which it resolves depends on the export of the targeted module.
|
||||
* @returns {Promise<Any>} The value to which it resolves depends on the export of the targeted module.
|
||||
*/
|
||||
export function importSetGlobalDefault (url, config) {
|
||||
/* eslint-enable jsdoc/check-types */
|
||||
return importSetGlobal(url, {...config, returnDefault: true});
|
||||
}
|
||||
/**
|
||||
@@ -113,18 +112,16 @@ export function importScript (url, atts = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
/* eslint-disable jsdoc/check-types */
|
||||
/**
|
||||
*
|
||||
* @param {string|string[]} url
|
||||
* @param {PlainObject} [atts={}]
|
||||
* @param {PlainObject} opts
|
||||
* @param {boolean} [opts.returnDefault=false} = {}]
|
||||
* @returns {Promise<*>} Resolves to value of loading module or rejects with
|
||||
* @returns {Promise<Any>} Resolves to value of loading module or rejects with
|
||||
* `Error` upon a script loading error.
|
||||
*/
|
||||
export function importModule (url, atts = {}, {returnDefault = false} = {}) {
|
||||
/* eslint-enable jsdoc/check-types */
|
||||
if (Array.isArray(url)) {
|
||||
return Promise.all(url.map((u) => {
|
||||
return importModule(u, atts);
|
||||
|
||||
Reference in New Issue
Block a user