diff --git a/application/source/constraints/abstractoperator.mjs b/application/source/constraints/abstractoperator.mjs index 87527a969e13ecaceaee5572c5872e22f1c5b913..cb6bcd81785bbe8ce016cc8f68d3604601c56041 100644 --- a/application/source/constraints/abstractoperator.mjs +++ b/application/source/constraints/abstractoperator.mjs @@ -34,7 +34,7 @@ class AbstractOperator extends AbstractConstraint { constructor(operantA, operantB) { super(); - if (!(operantA instanceof AbstractConstraint) || !(operantB instanceof AbstractConstraint)) { + if (!((operantA instanceof AbstractConstraint) && (operantB instanceof AbstractConstraint))) { throw new TypeError("parameters must be from type AbstractConstraint") } diff --git a/application/source/constraints/oroperator.mjs b/application/source/constraints/oroperator.mjs index 25e86c447dcac6b21b80f38e97df119531c8b612..d09ffa6ebf3462e161aae2fa56e401739cc0ef04 100644 --- a/application/source/constraints/oroperator.mjs +++ b/application/source/constraints/oroperator.mjs @@ -35,7 +35,8 @@ class OrOperator extends AbstractOperator { var self = this; return new Promise(function (resolve, reject) { - let a, b; + let a; + let b; self.operantA.isValid(value) .then(function () { diff --git a/application/source/data/buildmap.mjs b/application/source/data/buildmap.mjs index 08f10a4f955a5dc1cef9e7e4531ac2e05a2764c1..94fd01c2faf3a074d7617b1e18917553d873f048 100644 --- a/application/source/data/buildmap.mjs +++ b/application/source/data/buildmap.mjs @@ -111,7 +111,8 @@ function buildFlatMap(subject, selector, key, parentMap) { if (key === undefined) key = []; let parts = selector.split(DELIMITER); - let current = "", currentPath = []; + let current = ""; + let currentPath = []; do { current = parts.shift(); diff --git a/application/source/data/datasource.mjs b/application/source/data/datasource.mjs index 3c8f43b0aad74cc044f1e9b7524861eaab99c703..89b743265ed50ad26b0c352a30549cd367d832a7 100644 --- a/application/source/data/datasource.mjs +++ b/application/source/data/datasource.mjs @@ -232,7 +232,7 @@ function parseOptionsJSON(data) { validateObject(obj); return obj; } catch (e) { - throw new Error('the options does not contain a valid json definition (actual: ' + data + ').'); + throw new Error(`the options does not contain a valid json definition (actual: ${data}).`); } } diff --git a/application/source/data/datasource/server.mjs b/application/source/data/datasource/server.mjs index b3cf3ea84adab0424156f12c48d26a6c38d66f20..53378fc94728a736167981e80f951737c4bf6f39 100644 --- a/application/source/data/datasource/server.mjs +++ b/application/source/data/datasource/server.mjs @@ -88,10 +88,10 @@ class Server extends Datasource { */ function doTransform(type, obj) { const self = this; - let transformation = self.getOption(type + '.mapping.transformer'); + let transformation = self.getOption(`${type}.mapping.transformer`); if (transformation !== undefined) { const pipe = new Pipe(transformation); - const callbacks = self.getOption(type + '.mapping.callbacks') + const callbacks = self.getOption(`${type}.mapping.callbacks`) if (isObject(callbacks)) { for (const key in callbacks) { diff --git a/application/source/data/datasource/server/restapi.mjs b/application/source/data/datasource/server/restapi.mjs index 191a29f146307766ca582cc2571d6092967926c2..2264dde586c1ad0116fa04535d8ad01a630116ea 100644 --- a/application/source/data/datasource/server/restapi.mjs +++ b/application/source/data/datasource/server/restapi.mjs @@ -168,13 +168,13 @@ function fetchData(init, key, callback) { let response; - return fetch(self.getOption(key + '.url'), init).then(resp => { + return fetch(self.getOption(`${key}.url`), init).then(resp => { response = resp; - const acceptedStatus = self.getOption(key + '.acceptedStatus', [200]); + const acceptedStatus = self.getOption(`${key}.acceptedStatus`, [200]); if (acceptedStatus.indexOf(resp.status) === -1) { - throw Error('the data cannot be ' + key + ' (response ' + resp.status + ')') + throw Error(`the data cannot be ${key} (response ${resp.status})`) } return resp.text() @@ -188,10 +188,10 @@ function fetchData(init, key, callback) { } catch (e) { if (body.length > 100) { - body = body.substring(0, 97) + '...'; + body = `${body.substring(0, 97)}...`; } - throw new Error('the response does not contain a valid json (actual: ' + body + ').'); + throw new Error(`the response does not contain a valid json (actual: ${body}).`); } if (callback && isFunction(callback)) { diff --git a/application/source/data/extend.mjs b/application/source/data/extend.mjs index 4824f1bef9285f9b0b76712a99f1165d0243983d..873b0e45231c9203989c764ddad69d341e0723ae 100644 --- a/application/source/data/extend.mjs +++ b/application/source/data/extend.mjs @@ -23,15 +23,21 @@ export {extend} * @memberOf Monster.Data * @throws {Error} unsupported argument * @throws {Error} type mismatch + * @throws {Error} unsupported argument */ -function extend() { - let o, i; +function extend(...args) { + let o; + let i; + + if (typeof args !== 'object' || args[0] === null) { + throw new Error(`unsupported argument ${JSON.stringify(args[0])}`); + } - for (i = 0; i < arguments.length; i++) { - let a = arguments[i]; + for (i = 0; i < args.length; i++) { + let a = args[i]; if (!(isObject(a) || isArray(a))) { - throw new Error('unsupported argument ' + JSON.stringify(a)); + throw new Error(`unsupported argument ${JSON.stringify(a)}`); } if (o === undefined) { @@ -57,7 +63,7 @@ function extend() { } } else { if (typeOf(o[k]) !== typeOf(v)) { - throw new Error("type mismatch: " + JSON.stringify(o[k]) + "(" + typeOf(o[k]) + ") != " + JSON.stringify(v) + "(" + typeOf(v) + ")"); + throw new Error(`type mismatch: ${JSON.stringify(o[k])}(${typeOf(o[k])}) != ${JSON.stringify(v)}(${typeOf(v)})`); } } diff --git a/application/source/data/pathfinder.mjs b/application/source/data/pathfinder.mjs index ef16b67d43bb5b8ad28521d3febdd5046856621e..28a067d437e3aa049f98affb6e9ac1ce194922fb 100644 --- a/application/source/data/pathfinder.mjs +++ b/application/source/data/pathfinder.mjs @@ -255,7 +255,7 @@ function getValueViaPath(subject, path, check) { } if (parts.length > 0) { - throw Error("the journey is not at its end (" + parts.join(DELIMITER) + ")"); + throw Error(`the journey is not at its end (${parts.join(DELIMITER)})`); } @@ -272,7 +272,7 @@ function getValueViaPath(subject, path, check) { } - throw TypeError("unsupported type " + typeof subject) + throw TypeError(`unsupported type ${typeof subject}`) } @@ -331,8 +331,8 @@ function setValueViaPath(object, path, value) { let anchor = getValueViaPath.call(this, object, subpath); - if (!isObject(object) && !isArray(object)) { - throw TypeError("unsupported type: " + typeof object); + if (!(isObject(object) || isArray(object))) { + throw TypeError(`unsupported type: ${typeof object}`); } if (anchor instanceof Map || anchor instanceof WeakMap) { diff --git a/application/source/data/transformer.mjs b/application/source/data/transformer.mjs index 363b67ef4650b70cbcc04c28377e3800aed40313..0ff171ac20b40f1f344b0129b538556033122ded 100644 --- a/application/source/data/transformer.mjs +++ b/application/source/data/transformer.mjs @@ -190,7 +190,7 @@ function disassemble(command) { let c = g?.['char']; if (p && c) { - let r = '__' + new ID().toString() + '__'; + let r = `__${new ID().toString()}__`; placeholder.set(r, c); command = command.replace(p, r); } @@ -243,7 +243,8 @@ function transform(value) { const console = getGlobalObject('console'); let args = clone(this.args); - let key, defaultValue; + let key; + let defaultValue; switch (this.command) { @@ -263,7 +264,7 @@ function transform(value) { return value.toUpperCase(); case 'tostring': - return "" + value; + return `${value}`; case 'tointeger': let n = parseInt(value); @@ -367,7 +368,7 @@ function transform(value) { return value.length; } - throw new TypeError("unsupported type " + typeof value); + throw new TypeError(`unsupported type ${typeof value}`); case 'to-base64': case 'btoa': @@ -532,7 +533,7 @@ function transform(value) { defaultValue = defaultValue.toLowerCase() return ((defaultValue !== 'undefined' && defaultValue !== '' && defaultValue !== 'off' && defaultValue !== 'false' && defaultValue !== 'false') || defaultValue === 'on' || defaultValue === 'true' || defaultValue === 'true'); case 'string': - return "" + defaultValue; + return `${defaultValue}`; case "object": return JSON.parse(atob(defaultValue)); } @@ -541,9 +542,8 @@ function transform(value) { default: - throw new Error("unknown command " + this.command) + throw new Error(`unknown command ${this.command}`) } - return value; } diff --git a/application/source/dom/attributes.mjs b/application/source/dom/attributes.mjs index caf541560d0c9429a06c00fbf995ce986c9c4409..ac553ac17680ef518b319a2d7b9ad35e075a6200 100644 --- a/application/source/dom/attributes.mjs +++ b/application/source/dom/attributes.mjs @@ -145,7 +145,7 @@ function getLinkedObjects(element, symbol) { validateSymbol(symbol) if (element?.[symbol] === undefined) { - throw new Error('there is no object link for ' + symbol.toString()); + throw new Error(`there is no object link for ${symbol.toString()}`); } return element?.[symbol][Symbol.iterator](); @@ -360,8 +360,8 @@ function findClosestByAttribute(element, key, value) { } let selector = validateString(key); - if (value !== undefined) selector += "=" + validateString(value); - let result = element.closest('[' + selector + ']'); + if (value !== undefined) selector += `=${validateString(value)}`; + let result = element.closest(`[${selector}]`); if (result instanceof HTMLElement) { return result; } @@ -406,7 +406,7 @@ function findClosestByClass(element, className) { return element; } - let result = element.closest('.' + className); + let result = element.closest(`.${className}`); if (result instanceof HTMLElement) { return result; } diff --git a/application/source/dom/constants.mjs b/application/source/dom/constants.mjs index e5827c54358eb5efef282e9e402e72232aec3b9e..ff5557be7d7535bef53bca23a5d72bddfff0278c 100644 --- a/application/source/dom/constants.mjs +++ b/application/source/dom/constants.mjs @@ -86,7 +86,7 @@ const ATTRIBUTE_PREFIX = 'data-monster-'; * @since 1.8.0 * @type {string} */ -const ATTRIBUTE_OPTIONS = ATTRIBUTE_PREFIX + 'options'; +const ATTRIBUTE_OPTIONS = `${ATTRIBUTE_PREFIX}options`; /** * This is the name of the attribute to pass options to a control @@ -96,7 +96,7 @@ const ATTRIBUTE_OPTIONS = ATTRIBUTE_PREFIX + 'options'; * @since 1.30.0 * @type {string} */ -const ATTRIBUTE_OPTIONS_SELECTOR = ATTRIBUTE_PREFIX + 'options-selector'; +const ATTRIBUTE_OPTIONS_SELECTOR = `${ATTRIBUTE_PREFIX}options-selector`; /** * @memberOf Monster.DOM @@ -104,13 +104,13 @@ const ATTRIBUTE_OPTIONS_SELECTOR = ATTRIBUTE_PREFIX + 'options-selector'; * @license AGPLv3 * @since 1.8.0 */ -const ATTRIBUTE_THEME_PREFIX = ATTRIBUTE_PREFIX + 'theme-'; +const ATTRIBUTE_THEME_PREFIX = `${ATTRIBUTE_PREFIX}theme-`; /** * @memberOf Monster.DOM * @type {string} */ -const ATTRIBUTE_THEME_NAME = ATTRIBUTE_THEME_PREFIX + 'name'; +const ATTRIBUTE_THEME_NAME = `${ATTRIBUTE_THEME_PREFIX}name`; /** * @memberOf Monster.DOM @@ -118,7 +118,7 @@ const ATTRIBUTE_THEME_NAME = ATTRIBUTE_THEME_PREFIX + 'name'; * @license AGPLv3 * @since 1.8.0 */ -const ATTRIBUTE_UPDATER_ATTRIBUTES = ATTRIBUTE_PREFIX + 'attributes'; +const ATTRIBUTE_UPDATER_ATTRIBUTES = `${ATTRIBUTE_PREFIX}attributes`; /** * @memberOf Monster.DOM @@ -126,7 +126,7 @@ const ATTRIBUTE_UPDATER_ATTRIBUTES = ATTRIBUTE_PREFIX + 'attributes'; * @license AGPLv3 * @since 1.27.1 */ -const ATTRIBUTE_UPDATER_SELECT_THIS = ATTRIBUTE_PREFIX + 'select-this'; +const ATTRIBUTE_UPDATER_SELECT_THIS = `${ATTRIBUTE_PREFIX}select-this`; /** * @memberOf Monster.DOM @@ -134,7 +134,7 @@ const ATTRIBUTE_UPDATER_SELECT_THIS = ATTRIBUTE_PREFIX + 'select-this'; * @license AGPLv3 * @since 1.8.0 */ -const ATTRIBUTE_UPDATER_REPLACE = ATTRIBUTE_PREFIX + 'replace'; +const ATTRIBUTE_UPDATER_REPLACE = `${ATTRIBUTE_PREFIX}replace`; /** * @memberOf Monster.DOM @@ -142,7 +142,7 @@ const ATTRIBUTE_UPDATER_REPLACE = ATTRIBUTE_PREFIX + 'replace'; * @license AGPLv3 * @since 1.8.0 */ -const ATTRIBUTE_UPDATER_INSERT = ATTRIBUTE_PREFIX + 'insert'; +const ATTRIBUTE_UPDATER_INSERT = `${ATTRIBUTE_PREFIX}insert`; /** * @memberOf Monster.DOM @@ -150,7 +150,7 @@ const ATTRIBUTE_UPDATER_INSERT = ATTRIBUTE_PREFIX + 'insert'; * @license AGPLv3 * @since 1.8.0 */ -const ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_PREFIX + 'insert-reference'; +const ATTRIBUTE_UPDATER_INSERT_REFERENCE = `${ATTRIBUTE_PREFIX}insert-reference`; /** * @memberOf Monster.DOM @@ -158,7 +158,7 @@ const ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_PREFIX + 'insert-reference' * @license AGPLv3 * @since 1.8.0 */ -const ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove'; +const ATTRIBUTE_UPDATER_REMOVE = `${ATTRIBUTE_PREFIX}remove`; /** * @memberOf Monster.DOM @@ -166,7 +166,7 @@ const ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove'; * @license AGPLv3 * @since 1.9.0 */ -const ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_PREFIX + 'bind'; +const ATTRIBUTE_UPDATER_BIND = `${ATTRIBUTE_PREFIX}bind`; /** * @memberOf Monster.DOM @@ -174,7 +174,7 @@ const ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_PREFIX + 'bind'; * @license AGPLv3 * @since 1.27.0 */ -const ATTRIBUTE_TEMPLATE_PREFIX = ATTRIBUTE_PREFIX + 'template-prefix'; +const ATTRIBUTE_TEMPLATE_PREFIX = `${ATTRIBUTE_PREFIX}template-prefix`; /** * @memberOf Monster.DOM @@ -182,7 +182,7 @@ const ATTRIBUTE_TEMPLATE_PREFIX = ATTRIBUTE_PREFIX + 'template-prefix'; * @license AGPLv3 * @since 1.14.0 */ -const ATTRIBUTE_ROLE = ATTRIBUTE_PREFIX + 'role'; +const ATTRIBUTE_ROLE = `${ATTRIBUTE_PREFIX}role`; /** * @memberOf Monster.DOM @@ -206,7 +206,7 @@ const ATTRIBUTE_VALUE = 'value'; * @license AGPLv3 * @since 1.9.0 */ -const ATTRIBUTE_OBJECTLINK = ATTRIBUTE_PREFIX + 'objectlink'; +const ATTRIBUTE_OBJECTLINK = `${ATTRIBUTE_PREFIX}objectlink`; /** * @memberOf Monster.DOM @@ -214,7 +214,7 @@ const ATTRIBUTE_OBJECTLINK = ATTRIBUTE_PREFIX + 'objectlink'; * @license AGPLv3 * @since 1.24.0 */ -const ATTRIBUTE_ERRORMESSAGE = ATTRIBUTE_PREFIX + 'error'; +const ATTRIBUTE_ERRORMESSAGE = `${ATTRIBUTE_PREFIX}error`; /** * @memberOf Monster.DOM diff --git a/application/source/dom/customelement.mjs b/application/source/dom/customelement.mjs index 54cbd001d079b13668b5a268827f9c1af302b6fa..ffdffdfe0d7ecb4932fcfe4223f96191404838bb 100644 --- a/application/source/dom/customelement.mjs +++ b/application/source/dom/customelement.mjs @@ -422,7 +422,8 @@ class CustomElement extends HTMLElement { [assembleMethodSymbol]() { const self = this; - let elements, nodeList; + let elements; + let nodeList; const AttributeOptions = getOptionsFromAttributes.call(self); if (isObject(AttributeOptions) && Object.keys(AttributeOptions).length > 0) { @@ -574,7 +575,7 @@ function getSlottedElements(query, name) { if (name === null) { selector += ':not([name])'; } else { - selector += '[name=' + validateString(name) + ']'; + selector += `[name=${validateString(name)}]`; } } @@ -737,7 +738,7 @@ function getOptionsFromScriptTag() { const node = document.querySelector(self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR)); if (!(node instanceof HTMLScriptElement)) { - addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'the selector ' + ATTRIBUTE_OPTIONS_SELECTOR + ' for options was specified (' + self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR) + ') but not found.'); + addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, `the selector ${ATTRIBUTE_OPTIONS_SELECTOR} for options was specified (${self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR)}) but not found.`); return {}; } @@ -746,7 +747,7 @@ function getOptionsFromScriptTag() { try { obj = parseOptionsJSON.call(this, node.textContent.trim()) } catch (e) { - addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'when analyzing the configuration from the script tag there was an error. ' + e); + addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, `when analyzing the configuration from the script tag there was an error. ${e}`); } return obj; @@ -764,7 +765,7 @@ function getOptionsFromAttributes() { try { return parseOptionsJSON.call(self, this.getAttribute(ATTRIBUTE_OPTIONS)) } catch (e) { - addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'the options attribute ' + ATTRIBUTE_OPTIONS + ' does not contain a valid json definition (actual: ' + this.getAttribute(ATTRIBUTE_OPTIONS) + ').' + e); + addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, `the options attribute ${ATTRIBUTE_OPTIONS} does not contain a valid json definition (actual: ${this.getAttribute(ATTRIBUTE_OPTIONS)}).${e}`); } } @@ -777,8 +778,8 @@ function getOptionsFromAttributes() { * @return {Object} */ function parseOptionsJSON(data) { - - const self = this, obj = {}; + + let obj = {}; if (!isString(data)) { return obj; @@ -793,14 +794,13 @@ function parseOptionsJSON(data) { } try { - let obj = JSON.parse(data); - return validateObject(obj); + obj = JSON.parse(data); } catch (e) { throw e; } - return obj; + return validateObject(obj); } /** @@ -899,7 +899,8 @@ function initCSSStylesheet() { */ function initShadowRoot() { - let template, html; + let template; + let html; try { template = findDocumentTemplate(this.constructor.getTag()); diff --git a/application/source/dom/resource.mjs b/application/source/dom/resource.mjs index 5e7827ad2bac023d8010da856911e2773a164126..de77c83182652d1aa12107b909288c448ee168ac 100644 --- a/application/source/dom/resource.mjs +++ b/application/source/dom/resource.mjs @@ -235,7 +235,7 @@ function addEvents() { self[internalStateSymbol].setSubject({ loaded: true, - error: self[referenceSymbol][self.constructor.getURLAttribute()] + ' is not available', + error: `${self[referenceSymbol][self.constructor.getURLAttribute()]} is not available`, }) return; diff --git a/application/source/dom/resourcemanager.mjs b/application/source/dom/resourcemanager.mjs index c588d4aca9a2d0b99bf20e5ddb4843ca2e9a45f8..cb05a63c5a3e38bdfc9616a7766244a4a469f220 100644 --- a/application/source/dom/resourcemanager.mjs +++ b/application/source/dom/resourcemanager.mjs @@ -141,7 +141,7 @@ function runResourceMethod(method) { const result = []; for (const type of ['scripts', 'stylesheets', 'data']) { - const resources = self.getOption('resources.' + type); + const resources = self.getOption(`resources.${type}`); if (!isArray(resources)) { continue; } @@ -188,7 +188,7 @@ function addResource(type, url, options) { resource = new Data(extend({}, options, {[ATTRIBUTE_SRC]: url})) break; default: - throw new Error('unsupported type ' + type) + throw new Error(`unsupported type ${type}`) } (self.getOption('resources')?.[type]).push(resource); diff --git a/application/source/dom/template.mjs b/application/source/dom/template.mjs index 31365101d440937f2f189653c9224f5e3326c748..a5c482755864fa51de457d7363d65027a7e6cfe9 100644 --- a/application/source/dom/template.mjs +++ b/application/source/dom/template.mjs @@ -165,7 +165,7 @@ export function findDocumentTemplate(id, currentNode) { let theme = getDocumentTheme() if (prefixID) { - let themedPrefixID = prefixID + '-' + id + '-' + theme.getName(); + let themedPrefixID = `${prefixID}-${id}-${theme.getName()}`; // current + themedPrefixID template = currentNode.getElementById(themedPrefixID); @@ -180,7 +180,7 @@ export function findDocumentTemplate(id, currentNode) { } } - let themedID = id + '-' + theme.getName(); + let themedID = `${id}-${theme.getName()}`; // current + themedID template = currentNode.getElementById(themedID); @@ -206,6 +206,6 @@ export function findDocumentTemplate(id, currentNode) { return new Template(template); } - throw new Error("template " + id + " not found.") + throw new Error(`template ${id} not found.`) } diff --git a/application/source/dom/updater.mjs b/application/source/dom/updater.mjs index 6e068ae99d0802aa0baf3929ddbde1366da5011a..364c8eea5aff913728227b95d46e2873db66cabf 100644 --- a/application/source/dom/updater.mjs +++ b/application/source/dom/updater.mjs @@ -237,7 +237,7 @@ function getCheckStateCallback() { // this is a reference to the current object (therefore no array function here) if (this instanceof HTMLInputElement) { if (['radio', 'checkbox'].indexOf(this.type) !== -1) { - return (this.value + "" === current + "") ? 'true' : undefined + return (`${this.value}` === `${current}`) ? 'true' : undefined } } else if (this instanceof HTMLOptionElement) { @@ -372,11 +372,11 @@ function retrieveAndSetValue(element) { function retrieveFromBindings() { const self = this; - if (self[internalSymbol].element.matches('[' + ATTRIBUTE_UPDATER_BIND + ']')) { + if (self[internalSymbol].element.matches(`[${ATTRIBUTE_UPDATER_BIND}]`)) { retrieveAndSetValue.call(self, self[internalSymbol].element) } - for (const [, element] of self[internalSymbol].element.querySelectorAll('[' + ATTRIBUTE_UPDATER_BIND + ']').entries()) { + for (const [, element] of self[internalSymbol].element.querySelectorAll(`[${ATTRIBUTE_UPDATER_BIND}]`).entries()) { retrieveAndSetValue.call(self, element) } @@ -392,7 +392,7 @@ function retrieveFromBindings() { function removeElement(change) { const self = this; - for (const [, element] of self[internalSymbol].element.querySelectorAll(':scope [' + ATTRIBUTE_UPDATER_REMOVE + ']').entries()) { + for (const [, element] of self[internalSymbol].element.querySelectorAll(`:scope [${ATTRIBUTE_UPDATER_REMOVE}]`).entries()) { element.parentNode.removeChild(element); } } @@ -430,7 +430,7 @@ function insertElement(change) { const current = p.join('.'); let iterator = new Set; - const query = '[' + ATTRIBUTE_UPDATER_INSERT + '*="path:' + current + '"]'; + const query = `[${ATTRIBUTE_UPDATER_INSERT}*="path:${current}"]`; const e = container.querySelectorAll(query); @@ -455,7 +455,7 @@ function insertElement(change) { let def = trimSpaces(attributes); let i = def.indexOf(' '); let key = trimSpaces(def.substr(0, i)); - let refPrefix = key + '-'; + let refPrefix = `${key}-`; let cmd = trimSpaces(def.substr(i)); // this case is actually excluded by the query but is nevertheless checked again here @@ -491,10 +491,10 @@ function insertElement(change) { for (const [i, obj] of Object.entries(value)) { let ref = refPrefix + i; - let currentPath = dataPath + "." + i; + let currentPath = `${dataPath}.${i}`; available.add(ref); - let refElement = containerElement.querySelector('[' + ATTRIBUTE_UPDATER_INSERT_REFERENCE + '="' + ref + '"]'); + let refElement = containerElement.querySelector(`[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}="${ref}"]`); if (refElement instanceof HTMLElement) { insertPoint = refElement; @@ -504,13 +504,13 @@ function insertElement(change) { appendNewDocumentFragment(containerElement, key, ref, currentPath); } - let nodes = containerElement.querySelectorAll('[' + ATTRIBUTE_UPDATER_INSERT_REFERENCE + '*="' + refPrefix + '"]'); + let nodes = containerElement.querySelectorAll(`[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}*="${refPrefix}"]`); for (const [, node] of Object.entries(nodes)) { if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) { try { containerElement.removeChild(node); } catch (e) { - containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE, (containerElement.getAttribute(ATTRIBUTE_ERRORMESSAGE) + ", " + e.message).trim()); + containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE, (`${containerElement.getAttribute(ATTRIBUTE_ERRORMESSAGE)}, ${e.message}`).trim()); } } @@ -570,12 +570,12 @@ function applyRecursive(node, key, path) { if (node.hasAttribute(ATTRIBUTE_UPDATER_REPLACE)) { let value = node.getAttribute(ATTRIBUTE_UPDATER_REPLACE); - node.setAttribute(ATTRIBUTE_UPDATER_REPLACE, value.replaceAll("path:" + key, "path:" + path)); + node.setAttribute(ATTRIBUTE_UPDATER_REPLACE, value.replaceAll(`path:${key}`, `path:${path}`)); } if (node.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)) { let value = node.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES); - node.setAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES, value.replaceAll("path:" + key, "path:" + path)); + node.setAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES, value.replaceAll(`path:${key}`, `path:${path}`)); } for (const [, child] of Object.entries(node.childNodes)) { @@ -630,8 +630,8 @@ function runUpdateContent(container, parts, subject) { parts.pop(); // Unfortunately, static data is always changed as well, since it is not possible to react to changes here. - const query = '[' + ATTRIBUTE_UPDATER_REPLACE + '^="path:' + current + '"], [' + ATTRIBUTE_UPDATER_REPLACE + '^="static:"]'; - const e = container.querySelectorAll('' + query); + const query = `[${ATTRIBUTE_UPDATER_REPLACE}^="path:${current}"], [${ATTRIBUTE_UPDATER_REPLACE}^="static:"]`; + const e = container.querySelectorAll(`${query}`); const iterator = new Set([ ...e @@ -673,7 +673,7 @@ function runUpdateContent(container, parts, subject) { try { element.appendChild(value); } catch (e) { - element.setAttribute(ATTRIBUTE_ERRORMESSAGE, (element.getAttribute(ATTRIBUTE_ERRORMESSAGE) + ", " + e.message).trim()); + element.setAttribute(ATTRIBUTE_ERRORMESSAGE, (`${element.getAttribute(ATTRIBUTE_ERRORMESSAGE)}, ${e.message}`).trim()); } } else { @@ -724,7 +724,7 @@ function runUpdateAttributes(container, parts, subject) { let iterator = new Set; - const query = '[' + ATTRIBUTE_UPDATER_SELECT_THIS + '], [' + ATTRIBUTE_UPDATER_ATTRIBUTES + '*="path:' + current + '"], [' + ATTRIBUTE_UPDATER_ATTRIBUTES + '^="static:"]'; + const query = `[${ATTRIBUTE_UPDATER_SELECT_THIS}], [${ATTRIBUTE_UPDATER_ATTRIBUTES}*="path:${current}"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="static:"]`; const e = container.querySelectorAll(query); @@ -903,7 +903,7 @@ function addObjectWithUpdaterToElement (elements,symbol, object) { ]) } else if (elements instanceof Set) { } else { - throw new TypeError('elements is not a valid type. (actual: ' + typeof elements + ')'); + throw new TypeError(`elements is not a valid type. (actual: ${typeof elements})`); } let result = []; diff --git a/application/source/i18n/formatter.mjs b/application/source/i18n/formatter.mjs index 22f1c4f587accfce1f15452024698fcdda7efffc..281a4080634b51746f570f8ca5951ed6214a1f73 100644 --- a/application/source/i18n/formatter.mjs +++ b/application/source/i18n/formatter.mjs @@ -97,9 +97,9 @@ class Formatter extends TextFormatter { const parameter = parts.join('::').trim(); - let assembledText = openMarker + 'static:' + translationKey + ' | call:i18n'; + let assembledText = `${openMarker}static:${translationKey} | call:i18n`; if (parameter.length > 0) { - assembledText += '::' + parameter; + assembledText += `::${parameter}`; } assembledText += closeMarker; return super.format(assembledText); diff --git a/application/source/i18n/locale.mjs b/application/source/i18n/locale.mjs index 7079981e1552e6e69bc551ba78e8fbb0dfe38c79..f9300946538428c8d889621555b099d56baded26 100644 --- a/application/source/i18n/locale.mjs +++ b/application/source/i18n/locale.mjs @@ -156,7 +156,7 @@ class Locale extends Base { * @return {string} */ toString() { - return "" + this.localeString; + return `${this.localeString}`; } /** @@ -266,21 +266,27 @@ function parseLocale(locale) { locale = validateString(locale).replace(/_/g, "-"); - let language, region, variants, parts, script, extlang, - regexRegular = "(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)", - regexIrregular = "(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)", - regexGrandfathered = "(" + regexIrregular + "|" + regexRegular + ")", - regexPrivateUse = "(x(-[A-Za-z0-9]{1,8})+)", - regexSingleton = "[0-9A-WY-Za-wy-z]", - regexExtension = "(" + regexSingleton + "(-[A-Za-z0-9]{2,8})+)", - regexVariant = "([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3})", - regexRegion = "([A-Za-z]{2}|[0-9]{3})", - regexScript = "([A-Za-z]{4})", - regexExtlang = "([A-Za-z]{3}(-[A-Za-z]{3}){0,2})", - regexLanguage = "(([A-Za-z]{2,3}(-" + regexExtlang + ")?)|[A-Za-z]{4}|[A-Za-z]{5,8})", - regexLangtag = "(" + regexLanguage + "(-" + regexScript + ")?" + "(-" + regexRegion + ")?" + "(-" + regexVariant + ")*" + "(-" + regexExtension + ")*" + "(-" + regexPrivateUse + ")?" + ")", - regexLanguageTag = "^(" + regexGrandfathered + "|" + regexLangtag + "|" + regexPrivateUse + ")$", - regex = new RegExp(regexLanguageTag), match; + let language; + let region; + let variants; + let parts; + let script; + let extlang; + let regexRegular = "(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)"; + let regexIrregular = "(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)"; + let regexGrandfathered = `(${regexIrregular}|${regexRegular})`; + let regexPrivateUse = "(x(-[A-Za-z0-9]{1,8})+)"; + let regexSingleton = "[0-9A-WY-Za-wy-z]"; + let regexExtension = `(${regexSingleton}(-[A-Za-z0-9]{2,8})+)`; + let regexVariant = "([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3})"; + let regexRegion = "([A-Za-z]{2}|[0-9]{3})"; + let regexScript = "([A-Za-z]{4})"; + let regexExtlang = "([A-Za-z]{3}(-[A-Za-z]{3}){0,2})"; + let regexLanguage = `(([A-Za-z]{2,3}(-${regexExtlang})?)|[A-Za-z]{4}|[A-Za-z]{5,8})`; + let regexLangtag = `(${regexLanguage}(-${regexScript})?(-${regexRegion})?(-${regexVariant})*(-${regexExtension})*(-${regexPrivateUse})?)`; + let regexLanguageTag = `^(${regexGrandfathered}|${regexLangtag}|${regexPrivateUse})$`; + let regex = new RegExp(regexLanguageTag); + let match; if ((match = regex.exec(locale)) !== null) { diff --git a/application/source/i18n/translations.mjs b/application/source/i18n/translations.mjs index 6f8c15b3327836fa6cc8dbbaadeef3f78068547b..be020dd564f742dc01b19ba7ba6bd2e1986c8655 100644 --- a/application/source/i18n/translations.mjs +++ b/application/source/i18n/translations.mjs @@ -53,7 +53,7 @@ class Translations extends Base { getText(key, defaultText) { if (!this.storage.has(key)) { if (defaultText === undefined) { - throw new Error('key ' + key + ' not found'); + throw new Error(`key ${key} not found`); } return validateString(defaultText); diff --git a/application/source/logging/logger.mjs b/application/source/logging/logger.mjs index d45b108f7346a6500126883a19c06e80d2224f70..c4e3a6af083335279479499e33bfe2d786520916 100644 --- a/application/source/logging/logger.mjs +++ b/application/source/logging/logger.mjs @@ -121,8 +121,13 @@ class Logger extends Base { * @returns {Logger} * @since 1.5.0 */ - logTrace() { - triggerLog.apply(this, [TRACE, ...arguments]); + logTrace(...args) { + + if (typeof args !== 'object' || args[0] === null) { + throw new Error('the first argument must be an object') + } + + triggerLog.apply(this, [TRACE, ...args]); return this; }; @@ -135,8 +140,13 @@ class Logger extends Base { * @returns {Logger} * @since 1.5.0 */ - logDebug() { - triggerLog.apply(this, [DEBUG, ...arguments]); + logDebug(...args) { + + if (typeof args !== 'object' || args[0] === null) { + throw new Error('the first argument must be an object') + } + + triggerLog.apply(this, [DEBUG, ...args]); return this; }; @@ -150,8 +160,13 @@ class Logger extends Base { * @returns {Logger} * @since 1.5.0 */ - logInfo() { - triggerLog.apply(this, [INFO, ...arguments]); + logInfo(...args) { + + if (typeof args !== 'object' || args[0] === null) { + throw new Error('the first argument must be an object') + } + + triggerLog.apply(this, [INFO, ...args]); return this; }; @@ -164,8 +179,13 @@ class Logger extends Base { * @returns {Logger} * @since 1.5.0 */ - logWarn() { - triggerLog.apply(this, [WARN, ...arguments]); + logWarn(...args) { + + if (typeof args !== 'object' || args[0] === null) { + throw new Error('the first argument must be an object') + } + + triggerLog.apply(this, [WARN, ...args]); return this; }; @@ -178,8 +198,13 @@ class Logger extends Base { * @returns {Logger} * @since 1.5.0 */ - logError() { - triggerLog.apply(this, [ERROR, ...arguments]); + logError(...args) { + + if (typeof args !== 'object' || args[0] === null) { + throw new Error('the first argument must be an object') + } + + triggerLog.apply(this, [ERROR, ...args]); return this; }; @@ -192,8 +217,13 @@ class Logger extends Base { * @returns {Logger} * @since 1.5.0 */ - logFatal() { - triggerLog.apply(this, [FATAL, ...arguments]); + logFatal(...args) { + + if (typeof args !== 'object' || args[0] === null) { + throw new Error('the first argument must be an object') + } + + triggerLog.apply(this, [FATAL, ...args]); return this; }; diff --git a/application/source/text/formatter.mjs b/application/source/text/formatter.mjs index 119987d40f32dcdf11e8c25a0535294097bb5d4c..72ca51782f9e382339fccc856323bfd7455d9a68 100644 --- a/application/source/text/formatter.mjs +++ b/application/source/text/formatter.mjs @@ -304,7 +304,6 @@ function tokenize(text, openMarker, closeMarker) { if (endIndex === -1) { throw new Error("syntax error in formatter template") - return; } let key = text.substring(openMarker.length, endIndex); diff --git a/application/source/types/dataurl.mjs b/application/source/types/dataurl.mjs index 89d1e33f14d32129ebbff2998cb648f973952a5f..b67536a0d98135193aa7f5539a09e5045971e418 100644 --- a/application/source/types/dataurl.mjs +++ b/application/source/types/dataurl.mjs @@ -81,12 +81,12 @@ class DataUrl extends Base { let content = this[internal].content; if (this[internal].base64 === true) { - content = ';base64,' + content; + content = `;base64,${content}`; } else { - content = ',' + encodeURIComponent(content); + content = `,${encodeURIComponent(content)}`; } - return 'data:' + this[internal].mediatype.toString() + content; + return `data:${this[internal].mediatype.toString()}${content}`; } } diff --git a/application/source/types/global.mjs b/application/source/types/global.mjs index f15db1abb2004f7eb94a38938c7bbbd34ebd341a..3ebddaa35473bacd986167f77cfc957560c27ae1 100644 --- a/application/source/types/global.mjs +++ b/application/source/types/global.mjs @@ -112,7 +112,7 @@ function getGlobal() { function getGlobalObject(name) { validateString(name); let o = globalReference?.[name]; - if (typeof o === 'undefined') throw new Error('the object ' + name + ' is not defined'); + if (typeof o === 'undefined') throw new Error(`the object ${name} is not defined`); validateObject(o); return o; } @@ -150,7 +150,7 @@ function getGlobalObject(name) { function getGlobalFunction(name) { validateString(name); let f = globalReference?.[name]; - if (typeof f === 'undefined') throw new Error('the function ' + name + ' is not defined'); + if (typeof f === 'undefined') throw new Error(`the function ${name} is not defined`); validateFunction(f); return f; } diff --git a/application/source/types/mediatype.mjs b/application/source/types/mediatype.mjs index 5d0c8da525d5127aaf7a6d52867554db860e9dbc..e188eba44e6343a74dfc874b239279d90ea043e8 100644 --- a/application/source/types/mediatype.mjs +++ b/application/source/types/mediatype.mjs @@ -121,10 +121,10 @@ class MediaType extends Base { let parameter = []; for (let a of this[internal].parameter) { - parameter.push(a.key + '=' + a.value); + parameter.push(`${a.key}=${a.value}`); } - return this[internal].type + '/' + this[internal].subtype + (parameter.length > 0 ? ';' + parameter.join(';') : ''); + return `${this[internal].type}/${this[internal].subtype}${(parameter.length > 0 ? `;${parameter.join(';')}` : '')}`; } } diff --git a/application/source/types/node.mjs b/application/source/types/node.mjs index 52a3c75d947ff3254b70ee37c03d819ce16817b2..ac2ab5fd19da38c8f34037d227bff2607dc35c56 100644 --- a/application/source/types/node.mjs +++ b/application/source/types/node.mjs @@ -168,8 +168,8 @@ class Node extends Base { return parts.join("\n"); } - let count = this.childNodes.length, - counter = 0; + let count = this.childNodes.length; + let counter = 0; for (const node of this.childNodes) { counter++; diff --git a/application/source/types/nodelist.mjs b/application/source/types/nodelist.mjs index 24e0aba5512daabe580d7d3291078303e1ac21f5..1c432b4ba28252112aa74a2505dbfd01910afd4b 100644 --- a/application/source/types/nodelist.mjs +++ b/application/source/types/nodelist.mjs @@ -79,7 +79,6 @@ class NodeList extends Set { */ has(node) { return super.has(validateInstance(node, Node)); - return false; } /** diff --git a/application/source/types/observerlist.mjs b/application/source/types/observerlist.mjs index 249baa7a8613d06ba0ee9acab4dc8c11902f4625..10e1797fd926df4078a21147c4b2e31de8498bf6 100644 --- a/application/source/types/observerlist.mjs +++ b/application/source/types/observerlist.mjs @@ -54,7 +54,8 @@ class ObserverList extends Base { detach(observer) { validateInstance(observer, Observer) - var i = 0, l = this.observers.length; + var i = 0; + var l = this.observers.length; for (; i < l; i++) { if (this.observers[i] === observer) { this.observers.splice(i, 1); @@ -72,7 +73,8 @@ class ObserverList extends Base { */ contains(observer) { validateInstance(observer, Observer) - var i = 0, l = this.observers.length; + var i = 0; + var l = this.observers.length; for (; i < l; i++) { if (this.observers[i] === observer) { return true; @@ -90,7 +92,8 @@ class ObserverList extends Base { let pomises = [] - let i = 0, l = this.observers.length; + let i = 0; + let l = this.observers.length; for (; i < l; i++) { pomises.push(this.observers[i].update(subject)); } diff --git a/application/source/types/proxyobserver.mjs b/application/source/types/proxyobserver.mjs index dfb997c123f9442cc54417e0309293fce5efd0bf..9cb5360547883b238ff7d82beaa12c5b276646e6 100644 --- a/application/source/types/proxyobserver.mjs +++ b/application/source/types/proxyobserver.mjs @@ -78,7 +78,8 @@ export {ProxyObserver} */ setSubject(obj) { - let i, k = Object.keys(this.subject); + let i; + let k = Object.keys(this.subject); for (i = 0; i < k.length; i++) { delete this.subject[k[i]]; } diff --git a/application/source/types/uuid.mjs b/application/source/types/uuid.mjs index 52b9ef288a3b409249600afdcc3cc43a8a342a85..96ad59b0491c9bef2aa8b240f1bb8dc7354e865f 100644 --- a/application/source/types/uuid.mjs +++ b/application/source/types/uuid.mjs @@ -64,8 +64,8 @@ export {UUID} */ function createWithRandom() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = random(0, 65000) * 16 | 0, - v = ((c === 'x') ? r : (r & 0x3 | 0x8)); + const r = random(0, 65000) * 16 | 0; + const v = ((c === 'x') ? r : (r & 0x3 | 0x8)); return v.toString(16)[0]; }) } diff --git a/application/source/types/validate.mjs b/application/source/types/validate.mjs index 2803df9a6e986e9602e9e170c56df306e3ef570b..4abf4019290d0a1a7744d6d39fd60cf460765c69 100644 --- a/application/source/types/validate.mjs +++ b/application/source/types/validate.mjs @@ -199,10 +199,10 @@ function validateInstance(value, instance) { } if (n) { - n = " " + n; + n = ` ${n}`; } - throw new TypeError('value is not an instance of' + n) + throw new TypeError(`value is not an instance of${n}`) } return value } diff --git a/application/source/types/version.mjs b/application/source/types/version.mjs index 715905f57de2dff9b21c2e8c59be08e870e02b3a..6c8f68660efacaf2a4fbbdd475eb4bf1d8e37503 100644 --- a/application/source/types/version.mjs +++ b/application/source/types/version.mjs @@ -89,7 +89,7 @@ class Version extends Base { * @returns {string} */ toString() { - return this.major + '.' + this.minor + '.' + this.patch; + return `${this.major}.${this.minor}.${this.patch}`; } /** diff --git a/application/source/util/clone.mjs b/application/source/util/clone.mjs index f8284703b31ad7a7d8d2d17ed7ceedd15829e666..584ec09a66cabeac8056ef4110da533696eb84d7 100644 --- a/application/source/util/clone.mjs +++ b/application/source/util/clone.mjs @@ -105,11 +105,11 @@ function cloneObject(obj) { validateObject(obj); - const constructor = obj?.['constructor']; + const fkt = obj?.['constructor']; /** Object has clone method */ - if(typeOf(constructor)==='function') { - const prototype = constructor?.prototype; + if(typeOf(fkt)==='function') { + const prototype = fkt?.prototype; if(typeof prototype==='object') { if(prototype.hasOwnProperty('getClone')&& typeOf(obj.getClone) === 'function') { return obj.getClone(); diff --git a/application/source/util/processing.mjs b/application/source/util/processing.mjs index 8d33a0fa8f51f875e493fbb281d6c8cefe673b2a..36a1eb27520e17e64309dc661607937e33af52bb 100644 --- a/application/source/util/processing.mjs +++ b/application/source/util/processing.mjs @@ -98,7 +98,7 @@ class Processing extends Base { * @param {function} callback Callback * @throw {TypeError} the arguments must be either integer or functions */ - constructor() { + constructor(...args) { super(); this[internalSymbol] = { @@ -107,7 +107,11 @@ class Processing extends Base { let time = 0 - for (const [, arg] of Object.entries(arguments)) { + if (typeof args !== 'object' || args[0] === null) { + throw new TypeError('the arguments must be either integer or functions') + } + + for (const [, arg] of Object.entries(args)) { if (isInteger(arg) && arg >= 0) { time = arg; } else if (isFunction(arg)) { diff --git a/application/source/util/trimspaces.mjs b/application/source/util/trimspaces.mjs index 8ae7632356d4fab32a8918eb79bb1538fa6a62ca..d10d44acdb355fd4f2225de25a16c09706a0efb0 100644 --- a/application/source/util/trimspaces.mjs +++ b/application/source/util/trimspaces.mjs @@ -60,7 +60,7 @@ export {trimSpaces} let c = g?.['char']; if (p && c) { - let r = '__' + new ID().toString() + '__'; + let r = `__${new ID().toString()}__`; placeholder.set(r, c); value = value.replace(p, r); } @@ -69,7 +69,7 @@ export {trimSpaces} value = value.trim(); placeholder.forEach((v, k) => { - value = value.replace(k, '\\' + v) + value = value.replace(k, `\\${v}`) }) return value; diff --git a/development/package.json b/development/package.json index 044b5256564f2c5cf644c5d86da6286cac1bd02d..0afe0db915fbc961ba101e92d45bcf018f8db6ee 100644 --- a/development/package.json +++ b/development/package.json @@ -39,6 +39,7 @@ "jsdom-global": "^3.0.2", "mocha": "^10.2.0", "node-plantuml": "^0.9.0", + "rome": "^11.0.0", "sinon": "^15.0.1", "url": "^0.11.0", "url-exist": "3.0.1", diff --git a/development/pnpm-lock.yaml b/development/pnpm-lock.yaml index 1be6447f8c2946a2cd25e2581cf0f7d21214f48e..0c600c5c4ac2c5fc1eb6c8f563bd68f2a993676d 100644 --- a/development/pnpm-lock.yaml +++ b/development/pnpm-lock.yaml @@ -20,6 +20,7 @@ specifiers: jsdom-global: ^3.0.2 mocha: ^10.2.0 node-plantuml: ^0.9.0 + rome: ^11.0.0 sinon: ^15.0.1 url: ^0.11.0 url-exist: 3.0.1 @@ -46,6 +47,7 @@ devDependencies: jsdom-global: 3.0.2_jsdom@21.1.0 mocha: 10.2.0 node-plantuml: 0.9.0 + rome: 11.0.0 sinon: 15.0.1 url: 0.11.0 url-exist: 3.0.1 @@ -557,6 +559,54 @@ packages: webcrypto-core: 1.7.5 dev: true + /@rometools/cli-darwin-arm64/11.0.0: + resolution: {integrity: sha512-F3vkdY+s3FLIEnAjSbyHTuIPB88cLpccimW4ecid5I7S6GzGG3iUJI4xT00JhH73K4P/qW20/9r+kH1T9Du8Xg==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rometools/cli-darwin-x64/11.0.0: + resolution: {integrity: sha512-X6jhtS6Iml4GOzgNtnLwIp/KXXhSdqeVyfv69m/AHnIzx3gQAjPZ7BPnJLvTCbhe4SKHL+uTZYFSCJpkUUKE6w==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rometools/cli-linux-arm64/11.0.0: + resolution: {integrity: sha512-dktTJJlTpmycBZ2TwhJBcAO8ztK8DdevdyZnFFxdYRvtmJgTjIsC2UFayf/SbKew8B8q1IhI0it+D6ihAeIpeg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rometools/cli-linux-x64/11.0.0: + resolution: {integrity: sha512-WVcnXPNdWGUWo0p4NU8YzuthjYR7q+b4vRcjdxtP1DlpphZmSsoC/RSE85nEqRAz8hChcKUansVzOPM8BSsuGA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rometools/cli-win32-arm64/11.0.0: + resolution: {integrity: sha512-tPj6RThQzS7Q45jqQll7NlTYvNcsg/BEP3LYiiazqSh9FAFnMkrV6ewUcMPKWyAfiyLs7jlz4rRvdNRUSygzfQ==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rometools/cli-win32-x64/11.0.0: + resolution: {integrity: sha512-bmBai8WHxYjsGk1+je7ZTfCUCWq30WJI3pQM8pzTA674lfGTZ9ymJoZwTaIMSO4rL5V9mlO6uLunsBKso9VqOg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@sinonjs/commons/2.0.0: resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} dependencies: @@ -2379,6 +2429,20 @@ packages: glob: 7.2.3 dev: true + /rome/11.0.0: + resolution: {integrity: sha512-rRo6JOwpMLc3OkeTDRXkrmrDqnxDvZ75GS4f0jLDBNmRgDXWbu0F8eVnJoRn+VbK2AE7vWvhVOMBjnWowcopkQ==} + engines: {node: '>=14.*'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@rometools/cli-darwin-arm64': 11.0.0 + '@rometools/cli-darwin-x64': 11.0.0 + '@rometools/cli-linux-arm64': 11.0.0 + '@rometools/cli-linux-x64': 11.0.0 + '@rometools/cli-win32-arm64': 11.0.0 + '@rometools/cli-win32-x64': 11.0.0 + dev: true + /safe-buffer/5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true diff --git a/development/rome.json b/development/rome.json new file mode 100644 index 0000000000000000000000000000000000000000..5f1dba0252d2668e2699116e174d2ed221e5cd53 --- /dev/null +++ b/development/rome.json @@ -0,0 +1,12 @@ +{ + "$schema": "./node_modules/rome/configuration_schema.json", + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "performance": { + "noDelete": "off" + } + } + } +} \ No newline at end of file