diff --git a/Taskfile.yml b/Taskfile.yml index 97395f8f1b15121b95d659d04c52ca301cfed92f..1451d5746bdb18a8b0868e2c126f364dea7bd77b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -37,9 +37,17 @@ tasks: silent: true desc: Run the tests aliases: - - rt + - rwt + cmds: + - run-web-tests + + format-and-lint-code: + silent: true + desc: Format and lint the code + aliases: + - flc cmds: - - run-web-tests + - format-and-lint-code build-and-publish: silent: true diff --git a/devenv.nix b/devenv.nix index d4dd371f0ca6110f5790c93753e76c3ab356fafc..1c37efb0619558b87ff5c7d53f5be4edf7d4470e 100644 --- a/devenv.nix +++ b/devenv.nix @@ -72,6 +72,12 @@ fi ${pkgs.nodejs_20}/bin/node ${config.devenv.root}/node_modules/jsdoc-plantuml/fixBrokenNodeJS.js +''; + + scripts.format-and-lint-code.exec = '' +${pkgs.nodejs_20}/bin/npx biome format --write ${config.devenv.root}/source/ +${pkgs.nodejs_20}/bin/npx biome lint --apply ${config.devenv.root}/source/ + ''; scripts.build-changelog.exec = '' diff --git a/opt/scripts/build-exports.cjs b/opt/scripts/build-exports.cjs index 6ce8a1aff74981690ce415d9686b5943392f4e1f..c53476d77ef6076cf48febd8cff03a73d721b58c 100755 --- a/opt/scripts/build-exports.cjs +++ b/opt/scripts/build-exports.cjs @@ -33,7 +33,7 @@ function scanSymbols(root) { if (!exp) { continue; } - exportLines.push("__PLACEHOLDER__" + " from \"./" + path.relative(basename, fn) + "\""); + exportLines.push("__PLACEHOLDER__" + " from \"./" + path.relative(basename, fn) + "\";"); } } } diff --git a/source/constraints/abstract.mjs b/source/constraints/abstract.mjs index 01cf37e7d2684afb0b146bee65274393941e8685..ff820d13c00118c72721843bb0dfb3b3f02e10dd 100644 --- a/source/constraints/abstract.mjs +++ b/source/constraints/abstract.mjs @@ -26,13 +26,6 @@ export { AbstractConstraint }; * @summary The abstract constraint */ class AbstractConstraint extends Base { - /** - * - */ - constructor() { - super(); - } - /** * this method must return a promise containing the result of the check. * diff --git a/source/data/buildmap.mjs b/source/data/buildmap.mjs index f55dc95d33e1c62f1031b74f9a5e97f4c6be6603..d8a9291cef5fbba26793aa193ebbb71ed2559c79 100644 --- a/source/data/buildmap.mjs +++ b/source/data/buildmap.mjs @@ -148,7 +148,7 @@ function assembleParts(subject, selector, filter, callback) { * @param parentMap * @return {*} */ -function buildFlatMap(subject, selector, key, parentMap) {; +function buildFlatMap(subject, selector, key, parentMap) { const currentMap = new Map(); const resultLength = this.size; diff --git a/source/data/datasource.mjs b/source/data/datasource.mjs index f6f8cf182099aef48be0e9c6c7dfae919960da36..5382c5c5b8fa6fc580eed4386827db08a24df6b7 100644 --- a/source/data/datasource.mjs +++ b/source/data/datasource.mjs @@ -131,7 +131,7 @@ class Datasource extends Base { setOptions(options) { if (isString(options)) { options = parseOptionsJSON(options); - }; + } extend( this[internalSymbol].getSubject()["options"], this.defaults, @@ -182,7 +182,7 @@ class Datasource extends Base { * * @return {Object|Array} */ - get() {; + get() { return this[internalDataSymbol].getRealSubject(); } @@ -190,7 +190,7 @@ class Datasource extends Base { * @param {Object|Array} data * @return {Datasource} */ - set(data) {; + set(data) { this[internalDataSymbol].setSubject(data); return this; } diff --git a/source/data/datasource/dom.mjs b/source/data/datasource/dom.mjs index 65875377f241df50f31c2ec3c6e0a3f2ca531338..51a425301d7cd4dd292893cc36e7257f7f04e21e 100644 --- a/source/data/datasource/dom.mjs +++ b/source/data/datasource/dom.mjs @@ -61,7 +61,7 @@ class DomStorage extends Datasource { * @throws {Error} The read selector is not defined * @throws {Error} There are no storage element */ - read() {; + read() { const selector = this.getOption("read.selector", undefined); if (!selector) { @@ -89,7 +89,7 @@ class DomStorage extends Datasource { * @throws {Error} The write selector is not defined * @throws {Error} There are no storage element */ - write() {; + write() { const selector = this.getOption("write.selector"); if (!selector) { diff --git a/source/data/datasource/server.mjs b/source/data/datasource/server.mjs index f24395b71c4eba85b7d9b035edf59324abe059c8..c7d525c5dec1f45801cebf069c7258cc710eaa96 100644 --- a/source/data/datasource/server.mjs +++ b/source/data/datasource/server.mjs @@ -39,7 +39,7 @@ class Server extends Datasource { * @param {Object} payload * @returns {Object} */ - transformServerPayload(payload) {; + transformServerPayload(payload) { payload = doTransform.call(this, "read", payload); const dataPath = this.getOption("read.path"); @@ -57,7 +57,7 @@ class Server extends Datasource { * @param {Object} payload * @returns {Object} */ - prepareServerPayload(payload) {; + prepareServerPayload(payload) { payload = doTransform.call(this, "write", payload); @@ -80,7 +80,7 @@ class Server extends Datasource { * @param obj * @returns {*} */ -function doTransform(type, obj) {; +function doTransform(type, obj) { const transformation = this.getOption(`${type}.mapping.transformer`); if (transformation !== undefined) { const pipe = new Pipe(transformation); diff --git a/source/data/datasource/server/restapi.mjs b/source/data/datasource/server/restapi.mjs index a3abdd3e43f377bd50de84214c32d2f9c202e281..072f76152af39ba1dc49dd22a0094eb1cb9c15fd 100644 --- a/source/data/datasource/server/restapi.mjs +++ b/source/data/datasource/server/restapi.mjs @@ -122,7 +122,7 @@ class RestAPI extends Server { * @throws {TypeError} value is not a object * @throws {Error} the data cannot be read */ - read() {; + read() { let init = this.getOption("read.init"); if (!isObject(init)) init = {}; @@ -141,7 +141,7 @@ class RestAPI extends Server { * @return {Promise} * @throws {WriteError} the data cannot be written */ - write() {; + write() { let init = this.getOption("write.init"); if (!isObject(init)) init = {}; @@ -162,7 +162,7 @@ class RestAPI extends Server { /** * @return {RestAPI} */ - getClone() {; + getClone() { return new RestAPI( this[internalSymbol].getRealSubject()["options"].read, this[internalSymbol].getRealSubject()["options"].write, @@ -177,7 +177,7 @@ class RestAPI extends Server { * @param callback * @returns {Promise<string>} */ -function fetchData(init, key, callback) {; +function fetchData(init, key, callback) { let response; return fetch(this.getOption(`${key}.url`), init) diff --git a/source/data/datasource/server/webconnect.mjs b/source/data/datasource/server/webconnect.mjs index 72836447a7c0396d0ce9422119858063788b12f9..e80c758399751b74e4529516a93ad082c8412a24 100644 --- a/source/data/datasource/server/webconnect.mjs +++ b/source/data/datasource/server/webconnect.mjs @@ -37,7 +37,7 @@ class WebConnect extends Server { * @param {Object} [options] options contains definitions for the datasource. */ constructor(options) { - super();; + super(); if (isString(options)) { options = { url: options }; @@ -144,7 +144,7 @@ class WebConnect extends Server { /** * @return {Promise} */ - read() {; + read() { return new Promise((resolve, reject) => { while (this[webConnectSymbol].dataReceived() === true) { @@ -171,7 +171,7 @@ class WebConnect extends Server { /** * @return {Promise} */ - write() {; + write() { const obj = this.prepareServerPayload(this.get()); return this[webConnectSymbol].send(obj); } @@ -179,7 +179,7 @@ class WebConnect extends Server { /** * @return {RestAPI} */ - getClone() {; + getClone() { return new WebConnect(this[internalSymbol].getRealSubject()["options"]); } } diff --git a/source/data/datasource/storage.mjs b/source/data/datasource/storage.mjs index 836a1dbbd4e44b14655cde323d5ab187b82e3bf3..fdb3264c899a38efcaeb14c85ea7ce4982ed89ac 100644 --- a/source/data/datasource/storage.mjs +++ b/source/data/datasource/storage.mjs @@ -108,7 +108,7 @@ class Storage extends Datasource { /** * @return {Storage} */ - getClone() {; + getClone() { return new Storage(this[internalSymbol].getRealSubject()["options"].key); } } diff --git a/source/data/datasource/storage/localstorage.mjs b/source/data/datasource/storage/localstorage.mjs index de02752e95a8316932b2bbec5f7b72830ea16094..b8ee420734256373a60d27d8419cde2536255061 100644 --- a/source/data/datasource/storage/localstorage.mjs +++ b/source/data/datasource/storage/localstorage.mjs @@ -44,7 +44,7 @@ class LocalStorage extends Storage { * Create clone * @return {LocalStorage} */ - getClone() {; + getClone() { return new LocalStorage( this[internalSymbol].getRealSubject()["options"].key, ); diff --git a/source/data/datasource/storage/sessionstorage.mjs b/source/data/datasource/storage/sessionstorage.mjs index bee8cc50e05167a08a33bc25322534cf5889602d..57b199000163a6291c05ebe653a8078240c92973 100644 --- a/source/data/datasource/storage/sessionstorage.mjs +++ b/source/data/datasource/storage/sessionstorage.mjs @@ -47,7 +47,7 @@ class SessionStorage extends Storage { * * @return {SessionStorage} */ - getClone() {; + getClone() { return new SessionStorage( this[internalSymbol].getRealSubject()["options"].key, ); diff --git a/source/dom/customcontrol.mjs b/source/dom/customcontrol.mjs index 54ac5c1b0762347ea1d46a7b772e15d385101e97..8aeb547a96d72e53e2c97662ab0a952850c1e16d 100644 --- a/source/dom/customcontrol.mjs +++ b/source/dom/customcontrol.mjs @@ -346,7 +346,7 @@ class CustomControl extends CustomElement { * @throws {Error} the ElementInternals is not supported and a polyfill is necessary * @this CustomControl */ -function getInternal() {; +function getInternal() { if (!(attachedInternalSymbol in this)) { throw new Error( @@ -362,7 +362,7 @@ function getInternal() {; * @return {object} * @this CustomControl */ -function initObserver() {; +function initObserver() { // value this[attributeObserverSymbol]["value"] = () => { diff --git a/source/dom/customelement.mjs b/source/dom/customelement.mjs index 4c708f01635268be966afd71c300d2cbcbec42fb..096c65efc7e29af346bc3d13a7eaa0b5f053b19b 100644 --- a/source/dom/customelement.mjs +++ b/source/dom/customelement.mjs @@ -502,7 +502,7 @@ class CustomElement extends HTMLElement { setOptions(options) { if (isString(options)) { options = parseOptionsJSON.call(this, options); - }; + } extend( this[internalSymbol].getSubject()["options"], this.defaults, @@ -533,7 +533,7 @@ class CustomElement extends HTMLElement { * @return {CustomElement} - The updated custom element. * @since 1.8.0 */ - [assembleMethodSymbol]() {; + [assembleMethodSymbol]() { let elements; let nodeList; @@ -602,7 +602,7 @@ class CustomElement extends HTMLElement { * @since 1.7.0 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/connectedCallback */ - connectedCallback() {; + connectedCallback() { // Check if the object has already been initialized if (!hasObjectLink(this, customElementUpdaterLinkSymbol)) { @@ -638,7 +638,7 @@ class CustomElement extends HTMLElement { * @return {void} * @since 1.15.0 */ - attributeChangedCallback(attrName, oldVal, newVal) {; + attributeChangedCallback(attrName, oldVal, newVal) { if (attrName.startsWith("data-monster-option-")) { setOptionFromAttribute( @@ -665,7 +665,7 @@ class CustomElement extends HTMLElement { * @throws {TypeError} value is not an instance of * @since 1.19.0 */ - hasNode(node) {; + hasNode(node) { if (containChildNode.call(this, validateInstance(node, Node))) { return true; @@ -685,7 +685,7 @@ class CustomElement extends HTMLElement { * @param {*} args * @returns {*} */ - callCallback(name, args) {; + callCallback(name, args) { return callControlCallback.call(this, name, ...args); } } @@ -695,7 +695,7 @@ class CustomElement extends HTMLElement { * @param {*} args * @return {any} */ -function callControlCallback(callBackFunctionName, ...args) {; +function callControlCallback(callBackFunctionName, ...args) { if (!isString(callBackFunctionName) || callBackFunctionName === "") { return; @@ -756,7 +756,7 @@ function callControlCallback(callBackFunctionName, ...args) {; * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#providing_a_construction_callback * @since 1.8.0 */ -function initFromCallbackHost() {; +function initFromCallbackHost() { // Set the default callback function name let callBackFunctionName = initControlCallbackName; @@ -814,7 +814,7 @@ function attachAttributeChangeMutationObserver() { * @param {Node} node * @return {boolean} */ -function containChildNode(node) {; +function containChildNode(node) { if (this.contains(node)) { return true; @@ -928,7 +928,7 @@ function initOptionObserver() { * @return {object} * @throws {TypeError} value is not a object */ -function getOptionsFromScriptTag() {; +function getOptionsFromScriptTag() { if (!this.hasAttribute(ATTRIBUTE_OPTIONS_SELECTOR)) { return {}; @@ -967,7 +967,7 @@ function getOptionsFromScriptTag() {; * @private * @return {object} */ -function getOptionsFromAttributes() {; +function getOptionsFromAttributes() { if (this.hasAttribute(ATTRIBUTE_OPTIONS)) { try { @@ -1044,7 +1044,7 @@ function initHtmlContent() { * @since 1.16.0 * @throws {TypeError} value is not an instance of */ -function initCSSStylesheet() {; +function initCSSStylesheet() { if (!(this.shadowRoot instanceof ShadowRoot)) { return this; diff --git a/source/dom/resource.mjs b/source/dom/resource.mjs index bd9c33b5e71452959081e65c587aadd52d1e5205..80f3bab13c9fb6098a5ac61cc7d7fa55c4a3cc6b 100644 --- a/source/dom/resource.mjs +++ b/source/dom/resource.mjs @@ -200,7 +200,7 @@ class Resource extends BaseWithOptions { * @return {Promise} * throws {Error} target not found */ -function appendToDocument() {; +function appendToDocument() { const targetNode = document.querySelector(this.getOption(KEY_QUERY, "head")); if (!(targetNode instanceof HTMLElement)) { @@ -217,7 +217,7 @@ function appendToDocument() {; * @private * @return {addEvents} */ -function addEvents() {; +function addEvents() { const onError = () => { this[referenceSymbol].removeEventListener("error", onError); diff --git a/source/dom/resource/data.mjs b/source/dom/resource/data.mjs index 7d4810264e49408b0bdb643f88d6522bc47d0c46..ce937396e155aecba910ead52e82505795bb4623 100644 --- a/source/dom/resource/data.mjs +++ b/source/dom/resource/data.mjs @@ -94,7 +94,7 @@ class Data extends Resource { * @private * @return {Monster.DOM.Resource.Data} */ -function createElement() {; +function createElement() { const document = this.getOption(KEY_DOCUMENT); this[referenceSymbol] = document.createElement(TAG_SCRIPT); @@ -118,7 +118,7 @@ function createElement() {; * @return {Promise} * throws {Error} target not found */ -function appendToDocument() {; +function appendToDocument() { const targetNode = document.querySelector(this.getOption(KEY_QUERY, "head")); if (!(targetNode instanceof HTMLElement)) { diff --git a/source/dom/resource/link.mjs b/source/dom/resource/link.mjs index c90b7e37bedd91bb376bd244bd1f43a80a29ce7b..54083873eb044a75a43eb22e1471585001f0d93e 100644 --- a/source/dom/resource/link.mjs +++ b/source/dom/resource/link.mjs @@ -98,7 +98,7 @@ class Link extends Resource { * @private * @return {Monster.DOM.Resource.Link} */ -function createElement() {; +function createElement() { const document = this.getOption(KEY_DOCUMENT); this[referenceSymbol] = document.createElement(TAG_LINK); diff --git a/source/dom/resource/script.mjs b/source/dom/resource/script.mjs index a17939452baed5afc71e8dbc30f8eea7faa38577..dda92bdee8eb885317700a6e7dfa8ddf14d00d7e 100644 --- a/source/dom/resource/script.mjs +++ b/source/dom/resource/script.mjs @@ -82,7 +82,7 @@ class Script extends Resource { * @private * @return {Monster.DOM.Resource.Script} */ -function createElement() {; +function createElement() { const document = this.getOption(KEY_DOCUMENT); this[referenceSymbol] = document.createElement(TAG_SCRIPT); diff --git a/source/dom/resourcemanager.mjs b/source/dom/resourcemanager.mjs index 3fad953e81eac66ccbffc6d6c077338008fbf5ec..449002dc30fab6167257daf5a8d64bbf9697b0ee 100644 --- a/source/dom/resourcemanager.mjs +++ b/source/dom/resourcemanager.mjs @@ -150,7 +150,7 @@ class ResourceManager extends Base { * @param {string} method * @return {Array} */ -function runResourceMethod(method) {; +function runResourceMethod(method) { const result = []; @@ -180,7 +180,7 @@ function runResourceMethod(method) {; * @return {Monster.DOM.ResourceManager} * @private */ -function addResource(type, url, options) {; +function addResource(type, url, options) { if (url instanceof URL) { url = url.toString(); diff --git a/source/dom/slotted.mjs b/source/dom/slotted.mjs index 7258e95e65f4dc56183c3d7226b71125d645c66a..502cf4cbe091d75b1147bfc8bae6a2795a1caa6a 100644 --- a/source/dom/slotted.mjs +++ b/source/dom/slotted.mjs @@ -13,7 +13,7 @@ export { getSlottedElements, getSlottedNodes }; * @since 3.33.0 * @throws {Error} query must be a string */ -function getSlottedNodes(query, name) {; +function getSlottedNodes(query, name) { const result = new Set(); if (!this.shadowRoot) { @@ -66,7 +66,7 @@ function getSlottedNodes(query, name) {; * @since 1.23.0 * @throws {Error} query must be a string */ -function getSlottedElements(query, name) {; +function getSlottedElements(query, name) { const result = new Set(); if (!(this.shadowRoot instanceof ShadowRoot)) { diff --git a/source/dom/updater.mjs b/source/dom/updater.mjs index be3be66d23caca0f3b899cd2bffa791eb66646b7..ca685c60cff5e354f038df213af133d1a1ba4236 100644 --- a/source/dom/updater.mjs +++ b/source/dom/updater.mjs @@ -233,7 +233,7 @@ class Updater extends Base { * @return {function * @this Updater */ -function getCheckStateCallback() {; +function getCheckStateCallback() { return function (current) { // this is a reference to the current object (therefore no array function here) @@ -262,7 +262,7 @@ const symbol = Symbol("@schukai/monster/updater@@EventHandler"); * @this Updater * @throws {Error} the bind argument must start as a value with a path */ -function getControlEventHandler() {; +function getControlEventHandler() { if (this[symbol]) { return this[symbol]; @@ -293,7 +293,7 @@ function getControlEventHandler() {; * @memberOf Monster.DOM * @private */ -function retrieveAndSetValue(element) {; +function retrieveAndSetValue(element) { const pathfinder = new Pathfinder(this[internalSymbol].subject.getSubject()); @@ -367,7 +367,7 @@ function retrieveAndSetValue(element) {; * @return void * @private */ -function retrieveFromBindings() {; +function retrieveFromBindings() { if (this[internalSymbol].element.matches(`[${ATTRIBUTE_UPDATER_BIND}]`)) { retrieveAndSetValue.call(this, this[internalSymbol].element); @@ -387,7 +387,7 @@ function retrieveFromBindings() {; * @param {object} change * @return {void} */ -function removeElement(change) {; +function removeElement(change) { for (const [, element] of this[internalSymbol].element .querySelectorAll(`:scope [${ATTRIBUTE_UPDATER_REMOVE}]`) @@ -408,7 +408,7 @@ function removeElement(change) {; * @throws {Error} the maximum depth for the recursion is reached. * @this Updater */ -function insertElement(change) {; +function insertElement(change) { const subject = this[internalSymbol].subject.getRealSubject(); const mem = new WeakSet(); @@ -604,7 +604,7 @@ function applyRecursive(node, key, path) { * @return {void} * @this Updater */ -function updateContent(change) {; +function updateContent(change) { const subject = this[internalSymbol].subject.getRealSubject(); const p = clone(change?.["path"]); @@ -717,7 +717,7 @@ function updateAttributes(change) { * @return {void} * @this Updater */ -function runUpdateAttributes(container, parts, subject) {; +function runUpdateAttributes(container, parts, subject) { if (!isArray(parts)) return; parts = clone(parts); @@ -794,7 +794,7 @@ function runUpdateAttributes(container, parts, subject) {; * @this Updater */ -function handleInputControlAttributeUpdate(element, name, value) {; +function handleInputControlAttributeUpdate(element, name, value) { if (element instanceof HTMLSelectElement) { switch (element.type) { @@ -870,7 +870,7 @@ function handleInputControlAttributeUpdate(element, name, value) {; * @throws {TypeError} the context of the function is not an instance of HTMLElement * @throws {TypeError} symbol must be an instance of Symbol */ -function addObjectWithUpdaterToElement(elements, symbol, object) {; +function addObjectWithUpdaterToElement(elements, symbol, object) { if (!(this instanceof HTMLElement)) { throw new TypeError( "the context of this function must be an instance of HTMLElement", diff --git a/source/i18n/formatter.mjs b/source/i18n/formatter.mjs index c82d2c036ceb724358dfe9798c1222c9c24d9efa..5226c62d7de3d265bb021fe57e4e913074124717 100644 --- a/source/i18n/formatter.mjs +++ b/source/i18n/formatter.mjs @@ -63,7 +63,7 @@ class Formatter extends TextFormatter { * @property {object} callbacks * @property {function} callbacks.i18n=()=>{} */ - get defaults() {; + get defaults() { return extend({}, super.defaults, { callbacks: { i18n: (value) => { diff --git a/source/logging/logger.mjs b/source/logging/logger.mjs index 5cabbc2c625128ecf2d4ea8191be3506aaa91eef..f4688af3d3921ffd348d91584a8340c26b333410 100644 --- a/source/logging/logger.mjs +++ b/source/logging/logger.mjs @@ -275,7 +275,7 @@ class Logger extends Base { * @returns {Logger} * @private */ -function triggerLog(loglevel, ...args) {; +function triggerLog(loglevel, ...args) { for (const handler of this.handler) { handler.log(new LogEntry(loglevel, args)); diff --git a/source/monster.mjs b/source/monster.mjs index f150069521f0ce4f56a60509ddbfedaa27f06cde..24cde159fc65d3a498b36999c9652ad2edde26a5 100644 --- a/source/monster.mjs +++ b/source/monster.mjs @@ -1,4 +1,3 @@ - /** * Copyright schukai GmbH and contributors 2023. All Rights Reserved. * Node module: @schukai/monster @@ -16,107 +15,107 @@ * @author schukai GmbH */ -export * from "./text/formatter.mjs" -export * from "./text/generate-range-comparison-expression.mjs" -export * from "./text/util.mjs" -export * from "./text/bracketed-key-value-hash.mjs" -export * from "./math/random.mjs" -export * from "./util/trimspaces.mjs" -export * from "./util/processing.mjs" -export * from "./util/runtime.mjs" -export * from "./util/deadmansswitch.mjs" -export * from "./util/comparator.mjs" -export * from "./util/freeze.mjs" -export * from "./util/clone.mjs" -export * from "./logging/handler/console.mjs" -export * from "./logging/logger.mjs" -export * from "./logging/handler.mjs" -export * from "./logging/logentry.mjs" -export * from "./net/webconnect.mjs" -export * from "./net/webconnect/message.mjs" -export * from "./constraints/invalid.mjs" -export * from "./constraints/abstractoperator.mjs" -export * from "./constraints/oroperator.mjs" -export * from "./constraints/isobject.mjs" -export * from "./constraints/andoperator.mjs" -export * from "./constraints/isarray.mjs" -export * from "./constraints/abstract.mjs" -export * from "./constraints/valid.mjs" -export * from "./dom/dimension.mjs" -export * from "./dom/resource/link/stylesheet.mjs" -export * from "./dom/resource/link.mjs" -export * from "./dom/resource/script.mjs" -export * from "./dom/resource/data.mjs" -export * from "./dom/util/init-options-from-attributes.mjs" -export * from "./dom/util/set-option-from-attribute.mjs" -export * from "./dom/util/extract-keys.mjs" -export * from "./dom/worker/factory.mjs" -export * from "./dom/updater.mjs" -export * from "./dom/locale.mjs" -export * from "./dom/theme.mjs" -export * from "./dom/customelement.mjs" -export * from "./dom/slotted.mjs" -export * from "./dom/focusmanager.mjs" -export * from "./dom/ready.mjs" -export * from "./dom/util.mjs" -export * from "./dom/attributes.mjs" -export * from "./dom/resource.mjs" -export * from "./dom/resourcemanager.mjs" -export * from "./dom/assembler.mjs" -export * from "./dom/customcontrol.mjs" -export * from "./dom/template.mjs" -export * from "./dom/constants.mjs" -export * from "./dom/events.mjs" -export * from "./data/datasource/dom.mjs" -export * from "./data/datasource/storage/localstorage.mjs" -export * from "./data/datasource/storage/sessionstorage.mjs" -export * from "./data/datasource/storage.mjs" -export * from "./data/datasource/server.mjs" -export * from "./data/datasource/server/restapi/data-fetch-error.mjs" -export * from "./data/datasource/server/restapi/writeerror.mjs" -export * from "./data/datasource/server/webconnect.mjs" -export * from "./data/datasource/server/restapi.mjs" -export * from "./data/datasource.mjs" -export * from "./data/buildmap.mjs" -export * from "./data/transformer.mjs" -export * from "./data/diff.mjs" -export * from "./data/buildtree.mjs" -export * from "./data/pathfinder.mjs" -export * from "./data/pipe.mjs" -export * from "./data/extend.mjs" -export * from "./types/nodelist.mjs" -export * from "./types/base.mjs" -export * from "./types/mediatype.mjs" -export * from "./types/tokenlist.mjs" -export * from "./types/proxyobserver.mjs" -export * from "./types/version.mjs" -export * from "./types/global.mjs" -export * from "./types/observerlist.mjs" -export * from "./types/internal.mjs" -export * from "./types/observablequeue.mjs" -export * from "./types/dataurl.mjs" -export * from "./types/binary.mjs" -export * from "./types/observer.mjs" -export * from "./types/regex.mjs" -export * from "./types/randomid.mjs" -export * from "./types/id.mjs" -export * from "./types/uuid.mjs" -export * from "./types/is.mjs" -export * from "./types/validate.mjs" -export * from "./types/typeof.mjs" -export * from "./types/uniquequeue.mjs" -export * from "./types/stack.mjs" -export * from "./types/basewithoptions.mjs" -export * from "./types/node.mjs" -export * from "./types/queue.mjs" -export * from "./types/noderecursiveiterator.mjs" -export * from "./i18n/formatter.mjs" -export * from "./i18n/locale.mjs" -export * from "./i18n/provider.mjs" -export * from "./i18n/providers/fetch.mjs" -export * from "./i18n/providers/embed.mjs" -export * from "./i18n/translations.mjs" -export * from "./constants.mjs" +export * from "./text/formatter.mjs"; +export * from "./text/generate-range-comparison-expression.mjs"; +export * from "./text/util.mjs"; +export * from "./text/bracketed-key-value-hash.mjs"; +export * from "./math/random.mjs"; +export * from "./util/trimspaces.mjs"; +export * from "./util/processing.mjs"; +export * from "./util/runtime.mjs"; +export * from "./util/deadmansswitch.mjs"; +export * from "./util/comparator.mjs"; +export * from "./util/freeze.mjs"; +export * from "./util/clone.mjs"; +export * from "./logging/handler/console.mjs"; +export * from "./logging/logger.mjs"; +export * from "./logging/handler.mjs"; +export * from "./logging/logentry.mjs"; +export * from "./net/webconnect.mjs"; +export * from "./net/webconnect/message.mjs"; +export * from "./constraints/invalid.mjs"; +export * from "./constraints/abstractoperator.mjs"; +export * from "./constraints/oroperator.mjs"; +export * from "./constraints/isobject.mjs"; +export * from "./constraints/andoperator.mjs"; +export * from "./constraints/isarray.mjs"; +export * from "./constraints/abstract.mjs"; +export * from "./constraints/valid.mjs"; +export * from "./dom/dimension.mjs"; +export * from "./dom/resource/link/stylesheet.mjs"; +export * from "./dom/resource/link.mjs"; +export * from "./dom/resource/script.mjs"; +export * from "./dom/resource/data.mjs"; +export * from "./dom/util/init-options-from-attributes.mjs"; +export * from "./dom/util/set-option-from-attribute.mjs"; +export * from "./dom/util/extract-keys.mjs"; +export * from "./dom/worker/factory.mjs"; +export * from "./dom/updater.mjs"; +export * from "./dom/locale.mjs"; +export * from "./dom/theme.mjs"; +export * from "./dom/customelement.mjs"; +export * from "./dom/slotted.mjs"; +export * from "./dom/focusmanager.mjs"; +export * from "./dom/ready.mjs"; +export * from "./dom/util.mjs"; +export * from "./dom/attributes.mjs"; +export * from "./dom/resource.mjs"; +export * from "./dom/resourcemanager.mjs"; +export * from "./dom/assembler.mjs"; +export * from "./dom/customcontrol.mjs"; +export * from "./dom/template.mjs"; +export * from "./dom/constants.mjs"; +export * from "./dom/events.mjs"; +export * from "./data/datasource/dom.mjs"; +export * from "./data/datasource/storage/localstorage.mjs"; +export * from "./data/datasource/storage/sessionstorage.mjs"; +export * from "./data/datasource/storage.mjs"; +export * from "./data/datasource/server.mjs"; +export * from "./data/datasource/server/restapi/data-fetch-error.mjs"; +export * from "./data/datasource/server/restapi/writeerror.mjs"; +export * from "./data/datasource/server/webconnect.mjs"; +export * from "./data/datasource/server/restapi.mjs"; +export * from "./data/datasource.mjs"; +export * from "./data/buildmap.mjs"; +export * from "./data/transformer.mjs"; +export * from "./data/diff.mjs"; +export * from "./data/buildtree.mjs"; +export * from "./data/pathfinder.mjs"; +export * from "./data/pipe.mjs"; +export * from "./data/extend.mjs"; +export * from "./types/nodelist.mjs"; +export * from "./types/base.mjs"; +export * from "./types/mediatype.mjs"; +export * from "./types/tokenlist.mjs"; +export * from "./types/proxyobserver.mjs"; +export * from "./types/version.mjs"; +export * from "./types/global.mjs"; +export * from "./types/observerlist.mjs"; +export * from "./types/internal.mjs"; +export * from "./types/observablequeue.mjs"; +export * from "./types/dataurl.mjs"; +export * from "./types/binary.mjs"; +export * from "./types/observer.mjs"; +export * from "./types/regex.mjs"; +export * from "./types/randomid.mjs"; +export * from "./types/id.mjs"; +export * from "./types/uuid.mjs"; +export * from "./types/is.mjs"; +export * from "./types/validate.mjs"; +export * from "./types/typeof.mjs"; +export * from "./types/uniquequeue.mjs"; +export * from "./types/stack.mjs"; +export * from "./types/basewithoptions.mjs"; +export * from "./types/node.mjs"; +export * from "./types/queue.mjs"; +export * from "./types/noderecursiveiterator.mjs"; +export * from "./i18n/formatter.mjs"; +export * from "./i18n/locale.mjs"; +export * from "./i18n/provider.mjs"; +export * from "./i18n/providers/fetch.mjs"; +export * from "./i18n/providers/embed.mjs"; +export * from "./i18n/translations.mjs"; +export * from "./constants.mjs"; export { Monster }; diff --git a/source/net/webconnect.mjs b/source/net/webconnect.mjs index bf820028e20dccdb2a7433dfb28624ab1b8c5bc4..c0068c5cc071f347518c25d9083427f3434ac743 100644 --- a/source/net/webconnect.mjs +++ b/source/net/webconnect.mjs @@ -196,7 +196,7 @@ class WebConnect extends BaseWithOptions { * * @returns {Promise} */ - connect() {; + connect() { return new Promise((resolve, reject) => { connectServer.call(this, resolve, reject); @@ -330,7 +330,7 @@ class WebConnect extends BaseWithOptions { * @param {Message|Object} message * @return {Promise} */ - send(message) {; + send(message) { return new Promise((resolve, reject) => { if (this[connectionSymbol].socket.readyState !== 1) { diff --git a/source/text/formatter.mjs b/source/text/formatter.mjs index 2b820f1cbc8618babd45e668c8290e2abba5ea9a..32eb1cce03865aa83fb2705fb2cdee4099659614 100644 --- a/source/text/formatter.mjs +++ b/source/text/formatter.mjs @@ -226,7 +226,7 @@ class Formatter extends BaseWithOptions { * @private * @return {string} */ -function format(text) {; +function format(text) { this[watchdogSymbol]++; if (this[watchdogSymbol] > 20) { @@ -274,7 +274,7 @@ function format(text) {; * @param text * @return {string} */ -function tokenize(text, openMarker, closeMarker) {; +function tokenize(text, openMarker, closeMarker) { const formatted = []; diff --git a/source/types/internal.mjs b/source/types/internal.mjs index 96fb21dad735d1c7a0f2a170be39605a9c1c6c69..b180d2f3d80b4abe9c57dcc18b8473d655a1f720 100644 --- a/source/types/internal.mjs +++ b/source/types/internal.mjs @@ -37,7 +37,7 @@ const propertyName = "internalDefaults"; * @copyright schukai GmbH * @memberOf Monster.Types */ -function equipWithInternal() {; +function equipWithInternal() { validateObject(this); if (!hasGetter(this, propertyName)) { diff --git a/source/types/nodelist.mjs b/source/types/nodelist.mjs index e024260c605a8fa6fcf3297bae31aa6ae7526a70..4d7463b70d2da5e054ed1a056708c82d68c4670e 100644 --- a/source/types/nodelist.mjs +++ b/source/types/nodelist.mjs @@ -26,7 +26,7 @@ class NodeList extends Set { * @param {NodeList|Node|Array<Node>}values */ constructor(values) { - super();; + super(); if (values === undefined) return; diff --git a/source/util/deadmansswitch.mjs b/source/util/deadmansswitch.mjs index 92af05b81fd584c3bb0a97b5e6e2382a8853301b..f32f949f7038b3687200bc8e6c49650b3d2ba47c 100644 --- a/source/util/deadmansswitch.mjs +++ b/source/util/deadmansswitch.mjs @@ -64,7 +64,7 @@ class DeadMansSwitch extends Base { /** * @private */ -function initCallback() {; +function initCallback() { this[internalSymbol]["timer"] = setTimeout(() => { this[internalSymbol]["isAlreadyRun"] = true; @@ -77,7 +77,7 @@ function initCallback() {; * @param {integer} delay * @param {function} callback */ -function init(delay, callback) {; +function init(delay, callback) { this[internalSymbol] = { callback, diff --git a/source/util/processing.mjs b/source/util/processing.mjs index 3dddb6f310469233bf93740542dff0aa5c92643b..240008295292cac157384351a47c061cc70946f2 100644 --- a/source/util/processing.mjs +++ b/source/util/processing.mjs @@ -38,7 +38,7 @@ class Callback { * @param {*} data * @return {Promise} */ - run(data) {; + run(data) { return new Promise((resolve, reject) => { getGlobalFunction("setTimeout")(() => { try { @@ -134,7 +134,7 @@ class Processing extends Base { * @param {*} data * @return {Promise} */ - run(data) {; + run(data) { if (this[internalSymbol].queue.isEmpty()) { return Promise.resolve(data); }