mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Add no-param-reassign from eslint (#3089)
While waiting for the easterbunny I cleaned up some bad coding practice :-) Very open for comments especially regarding the places I commented myself... --------- Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
parent
979f4ec664
commit
7e58b38ddf
@ -24,6 +24,7 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"eqeqeq": "error",
|
"eqeqeq": "error",
|
||||||
"import/order": "error",
|
"import/order": "error",
|
||||||
|
"no-param-reassign": "error",
|
||||||
"no-prototype-builtins": "off",
|
"no-prototype-builtins": "off",
|
||||||
"no-throw-literal": "error",
|
"no-throw-literal": "error",
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
|
@ -13,6 +13,7 @@ _This release is scheduled to be released on 2023-07-01._
|
|||||||
|
|
||||||
- Added tests for serveronly
|
- Added tests for serveronly
|
||||||
- Set Timezone `Europe/Berlin` in unit tests (needed for new formatTime tests)
|
- Set Timezone `Europe/Berlin` in unit tests (needed for new formatTime tests)
|
||||||
|
- Added no-param-reassign eslint rule and fix warnings
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
29
js/app.js
29
js/app.js
@ -205,30 +205,17 @@ function App() {
|
|||||||
/**
|
/**
|
||||||
* Loads all modules.
|
* Loads all modules.
|
||||||
*
|
*
|
||||||
* @param {string[]} modules All modules to be loaded
|
* @param {Module[]} modules All modules to be loaded
|
||||||
|
* @returns {Promise} A promise that is resolved when all modules been loaded
|
||||||
*/
|
*/
|
||||||
async function loadModules(modules) {
|
async function loadModules(modules) {
|
||||||
return new Promise((resolve) => {
|
Log.log("Loading module helpers ...");
|
||||||
Log.log("Loading module helpers ...");
|
|
||||||
|
|
||||||
/**
|
for (let module of modules) {
|
||||||
*
|
await loadModule(module);
|
||||||
*/
|
}
|
||||||
function loadNextModule() {
|
|
||||||
if (modules.length > 0) {
|
|
||||||
const nextModule = modules[0];
|
|
||||||
loadModule(nextModule);
|
|
||||||
modules = modules.slice(1);
|
|
||||||
loadNextModule();
|
|
||||||
} else {
|
|
||||||
// All modules are loaded
|
|
||||||
Log.log("All module helpers loaded.");
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
loadNextModule();
|
Log.log("All module helpers loaded.");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -269,11 +256,13 @@ function App() {
|
|||||||
Log.setLogLevel(config.logLevel);
|
Log.setLogLevel(config.logLevel);
|
||||||
|
|
||||||
let modules = [];
|
let modules = [];
|
||||||
|
|
||||||
for (const module of config.modules) {
|
for (const module of config.modules) {
|
||||||
if (!modules.includes(module.module) && !module.disabled) {
|
if (!modules.includes(module.module) && !module.disabled) {
|
||||||
modules.push(module.module);
|
modules.push(module.module);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await loadModules(modules);
|
await loadModules(modules);
|
||||||
|
|
||||||
httpServer = new Server(config);
|
httpServer = new Server(config);
|
||||||
|
@ -230,9 +230,7 @@ const MM = (function () {
|
|||||||
* @param {Function} callback Called when the animation is done.
|
* @param {Function} callback Called when the animation is done.
|
||||||
* @param {object} [options] Optional settings for the hide method.
|
* @param {object} [options] Optional settings for the hide method.
|
||||||
*/
|
*/
|
||||||
const hideModule = function (module, speed, callback, options) {
|
const hideModule = function (module, speed, callback, options = {}) {
|
||||||
options = options || {};
|
|
||||||
|
|
||||||
// set lockString if set in options.
|
// set lockString if set in options.
|
||||||
if (options.lockString) {
|
if (options.lockString) {
|
||||||
// Log.log("Has lockstring: " + options.lockString);
|
// Log.log("Has lockstring: " + options.lockString);
|
||||||
@ -277,9 +275,7 @@ const MM = (function () {
|
|||||||
* @param {Function} callback Called when the animation is done.
|
* @param {Function} callback Called when the animation is done.
|
||||||
* @param {object} [options] Optional settings for the show method.
|
* @param {object} [options] Optional settings for the show method.
|
||||||
*/
|
*/
|
||||||
const showModule = function (module, speed, callback, options) {
|
const showModule = function (module, speed, callback, options = {}) {
|
||||||
options = options || {};
|
|
||||||
|
|
||||||
// remove lockString if set in options.
|
// remove lockString if set in options.
|
||||||
if (options.lockString) {
|
if (options.lockString) {
|
||||||
const index = module.lockStrings.indexOf(options.lockString);
|
const index = module.lockStrings.indexOf(options.lockString);
|
||||||
|
36
js/module.js
36
js/module.js
@ -378,23 +378,24 @@ const Module = Class.extend({
|
|||||||
* @param {Function} callback Called when the animation is done.
|
* @param {Function} callback Called when the animation is done.
|
||||||
* @param {object} [options] Optional settings for the hide method.
|
* @param {object} [options] Optional settings for the hide method.
|
||||||
*/
|
*/
|
||||||
hide: function (speed, callback, options) {
|
hide: function (speed, callback, options = {}) {
|
||||||
if (typeof callback === "object") {
|
let usedCallback = callback || function () {};
|
||||||
options = callback;
|
let usedOptions = options;
|
||||||
callback = function () {};
|
|
||||||
}
|
|
||||||
|
|
||||||
callback = callback || function () {};
|
if (typeof callback === "object") {
|
||||||
options = options || {};
|
Log.error("Parameter mismatch in module.hide: callback is not an optional parameter!");
|
||||||
|
usedOptions = callback;
|
||||||
|
usedCallback = function () {};
|
||||||
|
}
|
||||||
|
|
||||||
MM.hideModule(
|
MM.hideModule(
|
||||||
this,
|
this,
|
||||||
speed,
|
speed,
|
||||||
() => {
|
() => {
|
||||||
this.suspend();
|
this.suspend();
|
||||||
callback();
|
usedCallback();
|
||||||
},
|
},
|
||||||
options
|
usedOptions
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -406,22 +407,23 @@ const Module = Class.extend({
|
|||||||
* @param {object} [options] Optional settings for the show method.
|
* @param {object} [options] Optional settings for the show method.
|
||||||
*/
|
*/
|
||||||
show: function (speed, callback, options) {
|
show: function (speed, callback, options) {
|
||||||
if (typeof callback === "object") {
|
let usedCallback = callback || function () {};
|
||||||
options = callback;
|
let usedOptions = options;
|
||||||
callback = function () {};
|
|
||||||
}
|
|
||||||
|
|
||||||
callback = callback || function () {};
|
if (typeof callback === "object") {
|
||||||
options = options || {};
|
Log.error("Parameter mismatch in module.show: callback is not an optional parameter!");
|
||||||
|
usedOptions = callback;
|
||||||
|
usedCallback = function () {};
|
||||||
|
}
|
||||||
|
|
||||||
MM.showModule(
|
MM.showModule(
|
||||||
this,
|
this,
|
||||||
speed,
|
speed,
|
||||||
() => {
|
() => {
|
||||||
this.resume();
|
this.resume();
|
||||||
callback();
|
usedCallback();
|
||||||
},
|
},
|
||||||
options
|
usedOptions
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -44,10 +44,7 @@ const MMSocket = function (moduleName) {
|
|||||||
notificationCallback = callback;
|
notificationCallback = callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sendNotification = (notification, payload) => {
|
this.sendNotification = (notification, payload = {}) => {
|
||||||
if (typeof payload === "undefined") {
|
|
||||||
payload = {};
|
|
||||||
}
|
|
||||||
this.socket.emit(notification, payload);
|
this.socket.emit(notification, payload);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@ const Translator = (function () {
|
|||||||
*/
|
*/
|
||||||
async function loadJSON(file) {
|
async function loadJSON(file) {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve) {
|
||||||
xhr.overrideMimeType("application/json");
|
xhr.overrideMimeType("application/json");
|
||||||
xhr.open("GET", file, true);
|
xhr.open("GET", file, true);
|
||||||
xhr.onreadystatechange = function () {
|
xhr.onreadystatechange = function () {
|
||||||
@ -49,9 +49,7 @@ const Translator = (function () {
|
|||||||
* @param {object} variables The variables to use within the translation template (optional)
|
* @param {object} variables The variables to use within the translation template (optional)
|
||||||
* @returns {string} the translated key
|
* @returns {string} the translated key
|
||||||
*/
|
*/
|
||||||
translate: function (module, key, variables) {
|
translate: function (module, key, variables = {}) {
|
||||||
variables = variables || {}; // Empty object by default
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Combines template and variables like:
|
* Combines template and variables like:
|
||||||
* template: "Please wait for {timeToWait} before continuing with {work}."
|
* template: "Please wait for {timeToWait} before continuing with {work}."
|
||||||
@ -66,10 +64,11 @@ const Translator = (function () {
|
|||||||
if (Object.prototype.toString.call(template) !== "[object String]") {
|
if (Object.prototype.toString.call(template) !== "[object String]") {
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
let templateToUse = template;
|
||||||
if (variables.fallback && !template.match(new RegExp("{.+}"))) {
|
if (variables.fallback && !template.match(new RegExp("{.+}"))) {
|
||||||
template = variables.fallback;
|
templateToUse = variables.fallback;
|
||||||
}
|
}
|
||||||
return template.replace(new RegExp("{([^}]+)}", "g"), function (_unused, varName) {
|
return templateToUse.replace(new RegExp("{([^}]+)}", "g"), function (_unused, varName) {
|
||||||
return varName in variables ? variables[varName] : `{${varName}}`;
|
return varName in variables ? variables[varName] : `{${varName}}`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -593,15 +593,13 @@ const CalendarFetcherUtils = {
|
|||||||
*/
|
*/
|
||||||
titleFilterApplies: function (title, filter, useRegex, regexFlags) {
|
titleFilterApplies: function (title, filter, useRegex, regexFlags) {
|
||||||
if (useRegex) {
|
if (useRegex) {
|
||||||
|
let regexFilter = filter;
|
||||||
// Assume if leading slash, there is also trailing slash
|
// Assume if leading slash, there is also trailing slash
|
||||||
if (filter[0] === "/") {
|
if (filter[0] === "/") {
|
||||||
// Strip leading and trailing slashes
|
// Strip leading and trailing slashes
|
||||||
filter = filter.substr(1).slice(0, -1);
|
regexFilter = filter.substr(1).slice(0, -1);
|
||||||
}
|
}
|
||||||
|
return new RegExp(regexFilter, regexFlags).test(title);
|
||||||
filter = new RegExp(filter, regexFlags);
|
|
||||||
|
|
||||||
return filter.test(title);
|
|
||||||
} else {
|
} else {
|
||||||
return title.includes(filter);
|
return title.includes(filter);
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,7 @@ const CalendarUtils = {
|
|||||||
* @returns {string} The transformed title.
|
* @returns {string} The transformed title.
|
||||||
*/
|
*/
|
||||||
titleTransform: function (title, titleReplace) {
|
titleTransform: function (title, titleReplace) {
|
||||||
|
let transformedTitle = title;
|
||||||
for (let needle in titleReplace) {
|
for (let needle in titleReplace) {
|
||||||
const replacement = titleReplace[needle];
|
const replacement = titleReplace[needle];
|
||||||
|
|
||||||
@ -109,9 +110,9 @@ const CalendarUtils = {
|
|||||||
needle = new RegExp(regParts[1], regParts[2]);
|
needle = new RegExp(regParts[1], regParts[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
title = title.replace(needle, replacement);
|
transformedTitle = transformedTitle.replace(needle, replacement);
|
||||||
}
|
}
|
||||||
return title;
|
return transformedTitle;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,12 +25,13 @@ const NodeHelper = require("node_helper");
|
|||||||
const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings, useCorsProxy) {
|
const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings, useCorsProxy) {
|
||||||
let reloadTimer = null;
|
let reloadTimer = null;
|
||||||
let items = [];
|
let items = [];
|
||||||
|
let reloadIntervalMS = reloadInterval;
|
||||||
|
|
||||||
let fetchFailedCallback = function () {};
|
let fetchFailedCallback = function () {};
|
||||||
let itemsReceivedCallback = function () {};
|
let itemsReceivedCallback = function () {};
|
||||||
|
|
||||||
if (reloadInterval < 1000) {
|
if (reloadIntervalMS < 1000) {
|
||||||
reloadInterval = 1000;
|
reloadIntervalMS = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* private methods */
|
/* private methods */
|
||||||
@ -89,9 +90,9 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings
|
|||||||
try {
|
try {
|
||||||
// 86400000 = 24 hours is mentioned in the docs as maximum value:
|
// 86400000 = 24 hours is mentioned in the docs as maximum value:
|
||||||
const ttlms = Math.min(minutes * 60 * 1000, 86400000);
|
const ttlms = Math.min(minutes * 60 * 1000, 86400000);
|
||||||
if (ttlms > reloadInterval) {
|
if (ttlms > reloadIntervalMS) {
|
||||||
reloadInterval = ttlms;
|
reloadIntervalMS = ttlms;
|
||||||
Log.info(`Newsfeed-Fetcher: reloadInterval set to ttl=${reloadInterval} for url ${url}`);
|
Log.info(`Newsfeed-Fetcher: reloadInterval set to ttl=${reloadIntervalMS} for url ${url}`);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Log.warn(`Newsfeed-Fetcher: feed ttl is no valid integer=${minutes} for url ${url}`);
|
Log.warn(`Newsfeed-Fetcher: feed ttl is no valid integer=${minutes} for url ${url}`);
|
||||||
@ -129,7 +130,7 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings
|
|||||||
clearTimeout(reloadTimer);
|
clearTimeout(reloadTimer);
|
||||||
reloadTimer = setTimeout(function () {
|
reloadTimer = setTimeout(function () {
|
||||||
fetchNews();
|
fetchNews();
|
||||||
}, reloadInterval);
|
}, reloadIntervalMS);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* public methods */
|
/* public methods */
|
||||||
@ -140,8 +141,8 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings
|
|||||||
* @param {number} interval Interval for the update in milliseconds.
|
* @param {number} interval Interval for the update in milliseconds.
|
||||||
*/
|
*/
|
||||||
this.setReloadInterval = function (interval) {
|
this.setReloadInterval = function (interval) {
|
||||||
if (interval > 1000 && interval < reloadInterval) {
|
if (interval > 1000 && interval < reloadIntervalMS) {
|
||||||
reloadInterval = interval;
|
reloadIntervalMS = interval;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,12 +10,14 @@
|
|||||||
*/
|
*/
|
||||||
async function performWebRequest(url, type = "json", useCorsProxy = false, requestHeaders = undefined, expectedResponseHeaders = undefined) {
|
async function performWebRequest(url, type = "json", useCorsProxy = false, requestHeaders = undefined, expectedResponseHeaders = undefined) {
|
||||||
const request = {};
|
const request = {};
|
||||||
|
let requestUrl;
|
||||||
if (useCorsProxy) {
|
if (useCorsProxy) {
|
||||||
url = getCorsUrl(url, requestHeaders, expectedResponseHeaders);
|
requestUrl = getCorsUrl(url, requestHeaders, expectedResponseHeaders);
|
||||||
} else {
|
} else {
|
||||||
|
requestUrl = url;
|
||||||
request.headers = getHeadersToSend(requestHeaders);
|
request.headers = getHeadersToSend(requestHeaders);
|
||||||
}
|
}
|
||||||
const response = await fetch(url, request);
|
const response = await fetch(requestUrl, request);
|
||||||
const data = await response.text();
|
const data = await response.text();
|
||||||
|
|
||||||
if (type === "xml") {
|
if (type === "xml") {
|
||||||
|
@ -110,13 +110,15 @@ WeatherProvider.register("yr", {
|
|||||||
this.getWeatherDataFromYr(weatherData?.downloadedAt)
|
this.getWeatherDataFromYr(weatherData?.downloadedAt)
|
||||||
.then((weatherData) => {
|
.then((weatherData) => {
|
||||||
Log.debug("Got weather data from yr.");
|
Log.debug("Got weather data from yr.");
|
||||||
|
let data;
|
||||||
if (weatherData) {
|
if (weatherData) {
|
||||||
this.cacheWeatherData(weatherData);
|
this.cacheWeatherData(weatherData);
|
||||||
|
data = weatherData;
|
||||||
} else {
|
} else {
|
||||||
//Undefined if unchanged
|
//Undefined if unchanged
|
||||||
weatherData = this.getWeatherDataFromCache();
|
data = this.getWeatherDataFromCache();
|
||||||
}
|
}
|
||||||
resolve(weatherData);
|
resolve(data);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
Log.error(err);
|
Log.error(err);
|
||||||
@ -266,14 +268,14 @@ WeatherProvider.register("yr", {
|
|||||||
this.getStellarDataFromYr(today, 2)
|
this.getStellarDataFromYr(today, 2)
|
||||||
.then((stellarData) => {
|
.then((stellarData) => {
|
||||||
if (stellarData) {
|
if (stellarData) {
|
||||||
stellarData = {
|
const data = {
|
||||||
today: stellarData
|
today: stellarData
|
||||||
};
|
};
|
||||||
stellarData.tomorrow = Object.assign({}, stellarData.today);
|
data.tomorrow = Object.assign({}, data.today);
|
||||||
stellarData.today.date = today;
|
data.today.date = today;
|
||||||
stellarData.tomorrow.date = tomorrow;
|
data.tomorrow.date = tomorrow;
|
||||||
this.cacheStellarData(stellarData);
|
this.cacheStellarData(data);
|
||||||
resolve(stellarData);
|
resolve(data);
|
||||||
} else {
|
} else {
|
||||||
Log.error(`Something went wrong when fetching stellar data. Responses: ${stellarData}`);
|
Log.error(`Something went wrong when fetching stellar data. Responses: ${stellarData}`);
|
||||||
reject(stellarData);
|
reject(stellarData);
|
||||||
|
@ -218,29 +218,30 @@ Module.register("weather", {
|
|||||||
this.nunjucksEnvironment().addFilter(
|
this.nunjucksEnvironment().addFilter(
|
||||||
"unit",
|
"unit",
|
||||||
function (value, type, valueUnit) {
|
function (value, type, valueUnit) {
|
||||||
|
let formattedValue;
|
||||||
if (type === "temperature") {
|
if (type === "temperature") {
|
||||||
value = `${this.roundValue(WeatherUtils.convertTemp(value, this.config.tempUnits))}°`;
|
formattedValue = `${this.roundValue(WeatherUtils.convertTemp(value, this.config.tempUnits))}°`;
|
||||||
if (this.config.degreeLabel) {
|
if (this.config.degreeLabel) {
|
||||||
if (this.config.tempUnits === "metric") {
|
if (this.config.tempUnits === "metric") {
|
||||||
value += "C";
|
formattedValue += "C";
|
||||||
} else if (this.config.tempUnits === "imperial") {
|
} else if (this.config.tempUnits === "imperial") {
|
||||||
value += "F";
|
formattedValue += "F";
|
||||||
} else {
|
} else {
|
||||||
value += "K";
|
formattedValue += "K";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (type === "precip") {
|
} else if (type === "precip") {
|
||||||
if (value === null || isNaN(value) || value === 0 || value.toFixed(2) === "0.00") {
|
if (value === null || isNaN(value) || value === 0 || value.toFixed(2) === "0.00") {
|
||||||
value = "";
|
formattedValue = "";
|
||||||
} else {
|
} else {
|
||||||
value = WeatherUtils.convertPrecipitationUnit(value, valueUnit, this.config.units);
|
formattedValue = WeatherUtils.convertPrecipitationUnit(value, valueUnit, this.config.units);
|
||||||
}
|
}
|
||||||
} else if (type === "humidity") {
|
} else if (type === "humidity") {
|
||||||
value += "%";
|
formattedValue = `${value}%`;
|
||||||
} else if (type === "wind") {
|
} else if (type === "wind") {
|
||||||
value = WeatherUtils.convertWind(value, this.config.windUnits);
|
formattedValue = WeatherUtils.convertWind(value, this.config.windUnits);
|
||||||
}
|
}
|
||||||
return value;
|
return formattedValue;
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -154,17 +154,17 @@ WeatherProvider.register = function (providerIdentifier, providerDetails) {
|
|||||||
* @returns {object} The new weather provider
|
* @returns {object} The new weather provider
|
||||||
*/
|
*/
|
||||||
WeatherProvider.initialize = function (providerIdentifier, delegate) {
|
WeatherProvider.initialize = function (providerIdentifier, delegate) {
|
||||||
providerIdentifier = providerIdentifier.toLowerCase();
|
const pi = providerIdentifier.toLowerCase();
|
||||||
|
|
||||||
const provider = new WeatherProvider.providers[providerIdentifier]();
|
const provider = new WeatherProvider.providers[pi]();
|
||||||
const config = Object.assign({}, provider.defaults, delegate.config);
|
const config = Object.assign({}, provider.defaults, delegate.config);
|
||||||
|
|
||||||
provider.delegate = delegate;
|
provider.delegate = delegate;
|
||||||
provider.setConfig(config);
|
provider.setConfig(config);
|
||||||
|
|
||||||
provider.providerIdentifier = providerIdentifier;
|
provider.providerIdentifier = pi;
|
||||||
if (!provider.providerName) {
|
if (!provider.providerName) {
|
||||||
provider.providerName = providerIdentifier;
|
provider.providerName = pi;
|
||||||
}
|
}
|
||||||
|
|
||||||
return provider;
|
return provider;
|
||||||
|
@ -32,17 +32,19 @@ const WeatherUtils = {
|
|||||||
* @returns {string} - A string with tha value and a unit postfix.
|
* @returns {string} - A string with tha value and a unit postfix.
|
||||||
*/
|
*/
|
||||||
convertPrecipitationUnit(value, valueUnit, outputUnit) {
|
convertPrecipitationUnit(value, valueUnit, outputUnit) {
|
||||||
|
let convertedValue = value;
|
||||||
|
let conversionUnit = valueUnit;
|
||||||
if (outputUnit === "imperial") {
|
if (outputUnit === "imperial") {
|
||||||
if (valueUnit && valueUnit.toLowerCase() === "cm") value = value * 0.3937007874;
|
if (valueUnit && valueUnit.toLowerCase() === "cm") convertedValue = convertedValue * 0.3937007874;
|
||||||
else value = value * 0.03937007874;
|
else convertedValue = convertedValue * 0.03937007874;
|
||||||
valueUnit = "in";
|
conversionUnit = "in";
|
||||||
} else {
|
} else {
|
||||||
valueUnit = valueUnit ? valueUnit : "mm";
|
conversionUnit = valueUnit ? valueUnit : "mm";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (valueUnit === "%") return `${value.toFixed(0)} ${valueUnit}`;
|
if (valueUnit === "%") return `${convertedValue.toFixed(0)} ${conversionUnit}`;
|
||||||
|
|
||||||
return `${value.toFixed(2)} ${valueUnit}`;
|
return `${convertedValue.toFixed(2)} ${conversionUnit}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
243
package-lock.json
generated
243
package-lock.json
generated
@ -12,13 +12,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"console-stamp": "^3.1.1",
|
"console-stamp": "^3.1.1",
|
||||||
"digest-fetch": "^2.0.1",
|
"digest-fetch": "^2.0.3",
|
||||||
"envsub": "^4.1.0",
|
"envsub": "^4.1.0",
|
||||||
"eslint": "^8.37.0",
|
"eslint": "^8.38.0",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-ipfilter": "^1.3.1",
|
"express-ipfilter": "^1.3.1",
|
||||||
"feedme": "^2.0.2",
|
"feedme": "^2.0.2",
|
||||||
"helmet": "^6.0.1",
|
"helmet": "^6.1.5",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"luxon": "^1.28.1",
|
"luxon": "^1.28.1",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
@ -31,19 +31,19 @@
|
|||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-plugin-import": "^2.27.5",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-jest": "^27.2.1",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-jsdoc": "^40.1.1",
|
"eslint-plugin-jsdoc": "^41.1.1",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"express-basic-auth": "^1.2.1",
|
"express-basic-auth": "^1.2.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"jsdom": "^21.1.1",
|
"jsdom": "^21.1.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"playwright": "^1.32.2",
|
"playwright": "^1.32.3",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"pretty-quick": "^3.1.3",
|
"pretty-quick": "^3.1.3",
|
||||||
"sinon": "^15.0.3",
|
"sinon": "^15.0.3",
|
||||||
"stylelint": "^15.4.0",
|
"stylelint": "^15.5.0",
|
||||||
"stylelint-config-standard": "^32.0.0",
|
"stylelint-config-standard": "^33.0.0",
|
||||||
"stylelint-prettier": "^3.0.0",
|
"stylelint-prettier": "^3.0.0",
|
||||||
"suncalc": "^1.9.0"
|
"suncalc": "^1.9.0"
|
||||||
},
|
},
|
||||||
@ -51,7 +51,7 @@
|
|||||||
"node": ">=16"
|
"node": ">=16"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"electron": "^24.0.0"
|
"electron": "^24.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
@ -650,9 +650,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@csstools/css-parser-algorithms": {
|
"node_modules/@csstools/css-parser-algorithms": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.1.1.tgz",
|
||||||
"integrity": "sha512-KP8TicdXpUyeB1NMlbHud/1l39xvLGvqNFWMpG4qC6H1zs9SadGUHe5SO92n/659sDW9aGDvm9AMru0DZkN1Bw==",
|
"integrity": "sha512-viRnRh02AgO4mwIQb2xQNJju0i+Fh9roNgmbR5xEuG7J3TGgxjnE95HnBLgsFJOJOksvcfxOUCgODcft6Y07cA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14 || ^16 || >=18"
|
"node": "^14 || ^16 || >=18"
|
||||||
@ -662,13 +662,13 @@
|
|||||||
"url": "https://opencollective.com/csstools"
|
"url": "https://opencollective.com/csstools"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@csstools/css-tokenizer": "^2.0.0"
|
"@csstools/css-tokenizer": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@csstools/css-tokenizer": {
|
"node_modules/@csstools/css-tokenizer": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz",
|
||||||
"integrity": "sha512-dtqFyoJBHUxGi9zPZdpCKP1xk8tq6KPHJ/NY4qWXiYo6IcSGwzk3L8x2XzZbbyOyBs9xQARoGveU2AsgLj6D2A==",
|
"integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14 || ^16 || >=18"
|
"node": "^14 || ^16 || >=18"
|
||||||
@ -679,9 +679,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@csstools/media-query-list-parser": {
|
"node_modules/@csstools/media-query-list-parser": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.0.4.tgz",
|
||||||
"integrity": "sha512-X2/OuzEbjaxhzm97UJ+95GrMeT29d1Ib+Pu+paGLuRWZnWRK9sI9r3ikmKXPWGA1C4y4JEdBEFpp9jEqCvLeRA==",
|
"integrity": "sha512-GyYot6jHgcSDZZ+tLSnrzkR7aJhF2ZW6d+CXH66mjy5WpAQhZD4HDke2OQ36SivGRWlZJpAz7TzbW6OKlEpxAA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14 || ^16 || >=18"
|
"node": "^14 || ^16 || >=18"
|
||||||
@ -691,8 +691,8 @@
|
|||||||
"url": "https://opencollective.com/csstools"
|
"url": "https://opencollective.com/csstools"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@csstools/css-parser-algorithms": "^2.0.0",
|
"@csstools/css-parser-algorithms": "^2.1.1",
|
||||||
"@csstools/css-tokenizer": "^2.0.0"
|
"@csstools/css-tokenizer": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@csstools/selector-specificity": {
|
"node_modules/@csstools/selector-specificity": {
|
||||||
@ -791,9 +791,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/js": {
|
"node_modules/@eslint/js": {
|
||||||
"version": "8.37.0",
|
"version": "8.38.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz",
|
||||||
"integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A==",
|
"integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
}
|
}
|
||||||
@ -1911,6 +1911,15 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/are-docs-informative": {
|
||||||
|
"version": "0.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz",
|
||||||
|
"integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/argparse": {
|
"node_modules/argparse": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||||
@ -2936,9 +2945,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/digest-fetch": {
|
"node_modules/digest-fetch": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-2.0.3.tgz",
|
||||||
"integrity": "sha512-OgzIWveqj8BlQ8hfJv97a9iOzWOgvI5Z3rGAnjkeNpHepHZpD/DHBDJ9mtfDclH5vkbUSGRqNEosYCH1FSO6Pg==",
|
"integrity": "sha512-HuTjHQE+wplAR+H8/YGwQjIGR1RQUCEsQcRyp3dZfuuxpSQH4OTm4BkHxyXuzxwmxUrNVzIPf9XkXi8QMJDNwQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"base-64": "^0.1.0",
|
"base-64": "^0.1.0",
|
||||||
"js-sha256": "^0.9.0",
|
"js-sha256": "^0.9.0",
|
||||||
@ -2987,9 +2996,9 @@
|
|||||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||||
},
|
},
|
||||||
"node_modules/electron": {
|
"node_modules/electron": {
|
||||||
"version": "24.0.0",
|
"version": "24.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-24.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-24.1.2.tgz",
|
||||||
"integrity": "sha512-QmL8L53fQ+xOAp8m2mSGNewhDvJqQttCxrcesf0cqndKQDsIq4QvR35wGJqHg7MyPQKcBErLhZj9QvRheO5qnA==",
|
"integrity": "sha512-V0isWbyLYiXrSCcB4lrSVhS/U56NFGfuqHyc+yEPkyhhvY+h4F85cYGdEiZlXp6XjHT+/CLHmw0ltK54g9lvDw==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -3352,14 +3361,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "8.37.0",
|
"version": "8.38.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.38.0.tgz",
|
||||||
"integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==",
|
"integrity": "sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.4.0",
|
"@eslint-community/regexpp": "^4.4.0",
|
||||||
"@eslint/eslintrc": "^2.0.2",
|
"@eslint/eslintrc": "^2.0.2",
|
||||||
"@eslint/js": "8.37.0",
|
"@eslint/js": "8.38.0",
|
||||||
"@humanwhocodes/config-array": "^0.11.8",
|
"@humanwhocodes/config-array": "^0.11.8",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
@ -3540,12 +3549,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-jsdoc": {
|
"node_modules/eslint-plugin-jsdoc": {
|
||||||
"version": "40.1.1",
|
"version": "41.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-40.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-41.1.1.tgz",
|
||||||
"integrity": "sha512-KxrQCq9pPt7LNeDBlLlnuJMpDFZnEQTs4e25NrT4u5cWmPw2P7F03F2qwPz0GMdlRZTyMOofuPAdiWytvPubvA==",
|
"integrity": "sha512-dfH97DKLGtQ5dgEMzd+GSUuY+xX/yyAfjML3O0pEWmMMpylsG6Ro65s4ziYXKmixiENYK9CTQxCVRGqZUFN2Mw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@es-joy/jsdoccomment": "~0.37.0",
|
"@es-joy/jsdoccomment": "~0.37.0",
|
||||||
|
"are-docs-informative": "^0.0.2",
|
||||||
"comment-parser": "1.3.1",
|
"comment-parser": "1.3.1",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
@ -4562,9 +4572,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/helmet": {
|
"node_modules/helmet": {
|
||||||
"version": "6.0.1",
|
"version": "6.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/helmet/-/helmet-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/helmet/-/helmet-6.1.5.tgz",
|
||||||
"integrity": "sha512-8wo+VdQhTMVBMCITYZaGTbE4lvlthelPYSvoyNvk4RECTmrVjMerp9RfUOQXZWLvCcAn1pKj7ZRxK4lI9Alrcw==",
|
"integrity": "sha512-UgAvdoG0BhF9vcCh/j0bWtElo2ZHHk6OzC98NLCM6zK03DEVSM0vUAtT7iR+oTo2Mi6sGelAH3tL6B/uUWxV4g==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
@ -4618,9 +4628,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/html-tags": {
|
"node_modules/html-tags": {
|
||||||
"version": "3.2.0",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz",
|
||||||
"integrity": "sha512-vy7ClnArOZwCnqZgvv+ddgHgJiAFXe3Ge9ML5/mBctVJoUoYPCdxVucOywjDARn6CVoh3dRSFdPHy2sX80L0Wg==",
|
"integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@ -6938,13 +6948,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/playwright": {
|
"node_modules/playwright": {
|
||||||
"version": "1.32.2",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.32.2.tgz",
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.32.3.tgz",
|
||||||
"integrity": "sha512-jHVnXJke0PXpuPszKtk9y1zZSlzO5+2a+aockT/AND0oeXx46FiJEFrafthurglLygVZA+1gEbtUM1C7qtTV+Q==",
|
"integrity": "sha512-h/ylpgoj6l/EjkfUDyx8cdOlfzC96itPpPe8BXacFkqpw/YsuxkpPyVbzEq4jw+bAJh5FLgh31Ljg2cR6HV3uw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"playwright-core": "1.32.2"
|
"playwright-core": "1.32.3"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
@ -6954,9 +6964,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/playwright-core": {
|
"node_modules/playwright-core": {
|
||||||
"version": "1.32.2",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.2.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz",
|
||||||
"integrity": "sha512-zD7aonO+07kOTthsrCR3YCVnDcqSHIJpdFUtZEMOb6//1Rc7/6mZDRdw+nlzcQiQltOOsiqI3rrSyn/SlyjnJQ==",
|
"integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
@ -8298,14 +8308,14 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/stylelint": {
|
"node_modules/stylelint": {
|
||||||
"version": "15.4.0",
|
"version": "15.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.5.0.tgz",
|
||||||
"integrity": "sha512-TlOvpG3MbcFwHmK0q2ykhmpKo7Dq892beJit0NPdpyY9b1tFah/hGhqnAz/bRm2PDhDbJLKvjzkEYYBEz7Dxcg==",
|
"integrity": "sha512-jyMO3R1QtE5mUS4v40+Gg+sIQBqe7CF1xPslxycDzNVkIBCUD4O+5F1vLPq16VmunUTv4qG9o2rUKLnU5KkVeQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@csstools/css-parser-algorithms": "^2.1.0",
|
"@csstools/css-parser-algorithms": "^2.1.0",
|
||||||
"@csstools/css-tokenizer": "^2.1.0",
|
"@csstools/css-tokenizer": "^2.1.0",
|
||||||
"@csstools/media-query-list-parser": "^2.0.1",
|
"@csstools/media-query-list-parser": "^2.0.2",
|
||||||
"@csstools/selector-specificity": "^2.2.0",
|
"@csstools/selector-specificity": "^2.2.0",
|
||||||
"balanced-match": "^2.0.0",
|
"balanced-match": "^2.0.0",
|
||||||
"colord": "^2.9.3",
|
"colord": "^2.9.3",
|
||||||
@ -8319,7 +8329,7 @@
|
|||||||
"global-modules": "^2.0.0",
|
"global-modules": "^2.0.0",
|
||||||
"globby": "^11.1.0",
|
"globby": "^11.1.0",
|
||||||
"globjoin": "^0.1.4",
|
"globjoin": "^0.1.4",
|
||||||
"html-tags": "^3.2.0",
|
"html-tags": "^3.3.1",
|
||||||
"ignore": "^5.2.4",
|
"ignore": "^5.2.4",
|
||||||
"import-lazy": "^4.0.0",
|
"import-lazy": "^4.0.0",
|
||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
@ -8358,24 +8368,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/stylelint-config-recommended": {
|
"node_modules/stylelint-config-recommended": {
|
||||||
"version": "11.0.0",
|
"version": "12.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-11.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz",
|
||||||
"integrity": "sha512-SoGIHNI748OCZn6BxFYT83ytWoYETCINVHV3LKScVAWQQauWdvmdDqJC5YXWjpBbxg2E761Tg5aUGKLFOVhEkA==",
|
"integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"stylelint": "^15.3.0"
|
"stylelint": "^15.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/stylelint-config-standard": {
|
"node_modules/stylelint-config-standard": {
|
||||||
"version": "32.0.0",
|
"version": "33.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-32.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz",
|
||||||
"integrity": "sha512-UnGJxYDyYFrIE9CjDMZRkrNh2o4lOtO+MVZ9qG5b8yARfsWho0GMx4YvhHfsv8zKKgHeWX2wfeyxmuoqcaYZ4w==",
|
"integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"stylelint-config-recommended": "^11.0.0"
|
"stylelint-config-recommended": "^12.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"stylelint": "^15.4.0"
|
"stylelint": "^15.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/stylelint-prettier": {
|
"node_modules/stylelint-prettier": {
|
||||||
@ -9624,22 +9634,22 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@csstools/css-parser-algorithms": {
|
"@csstools/css-parser-algorithms": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.1.1.tgz",
|
||||||
"integrity": "sha512-KP8TicdXpUyeB1NMlbHud/1l39xvLGvqNFWMpG4qC6H1zs9SadGUHe5SO92n/659sDW9aGDvm9AMru0DZkN1Bw==",
|
"integrity": "sha512-viRnRh02AgO4mwIQb2xQNJju0i+Fh9roNgmbR5xEuG7J3TGgxjnE95HnBLgsFJOJOksvcfxOUCgODcft6Y07cA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"@csstools/css-tokenizer": {
|
"@csstools/css-tokenizer": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz",
|
||||||
"integrity": "sha512-dtqFyoJBHUxGi9zPZdpCKP1xk8tq6KPHJ/NY4qWXiYo6IcSGwzk3L8x2XzZbbyOyBs9xQARoGveU2AsgLj6D2A==",
|
"integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@csstools/media-query-list-parser": {
|
"@csstools/media-query-list-parser": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.0.4.tgz",
|
||||||
"integrity": "sha512-X2/OuzEbjaxhzm97UJ+95GrMeT29d1Ib+Pu+paGLuRWZnWRK9sI9r3ikmKXPWGA1C4y4JEdBEFpp9jEqCvLeRA==",
|
"integrity": "sha512-GyYot6jHgcSDZZ+tLSnrzkR7aJhF2ZW6d+CXH66mjy5WpAQhZD4HDke2OQ36SivGRWlZJpAz7TzbW6OKlEpxAA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
@ -9707,9 +9717,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@eslint/js": {
|
"@eslint/js": {
|
||||||
"version": "8.37.0",
|
"version": "8.38.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz",
|
||||||
"integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A=="
|
"integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g=="
|
||||||
},
|
},
|
||||||
"@humanwhocodes/config-array": {
|
"@humanwhocodes/config-array": {
|
||||||
"version": "0.11.8",
|
"version": "0.11.8",
|
||||||
@ -10595,6 +10605,12 @@
|
|||||||
"picomatch": "^2.0.4"
|
"picomatch": "^2.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"are-docs-informative": {
|
||||||
|
"version": "0.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz",
|
||||||
|
"integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"argparse": {
|
"argparse": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||||
@ -11336,9 +11352,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"digest-fetch": {
|
"digest-fetch": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-2.0.3.tgz",
|
||||||
"integrity": "sha512-OgzIWveqj8BlQ8hfJv97a9iOzWOgvI5Z3rGAnjkeNpHepHZpD/DHBDJ9mtfDclH5vkbUSGRqNEosYCH1FSO6Pg==",
|
"integrity": "sha512-HuTjHQE+wplAR+H8/YGwQjIGR1RQUCEsQcRyp3dZfuuxpSQH4OTm4BkHxyXuzxwmxUrNVzIPf9XkXi8QMJDNwQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"base-64": "^0.1.0",
|
"base-64": "^0.1.0",
|
||||||
"js-sha256": "^0.9.0",
|
"js-sha256": "^0.9.0",
|
||||||
@ -11378,9 +11394,9 @@
|
|||||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
||||||
},
|
},
|
||||||
"electron": {
|
"electron": {
|
||||||
"version": "24.0.0",
|
"version": "24.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-24.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-24.1.2.tgz",
|
||||||
"integrity": "sha512-QmL8L53fQ+xOAp8m2mSGNewhDvJqQttCxrcesf0cqndKQDsIq4QvR35wGJqHg7MyPQKcBErLhZj9QvRheO5qnA==",
|
"integrity": "sha512-V0isWbyLYiXrSCcB4lrSVhS/U56NFGfuqHyc+yEPkyhhvY+h4F85cYGdEiZlXp6XjHT+/CLHmw0ltK54g9lvDw==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@electron/get": "^2.0.0",
|
"@electron/get": "^2.0.0",
|
||||||
@ -11649,14 +11665,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint": {
|
"eslint": {
|
||||||
"version": "8.37.0",
|
"version": "8.38.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.38.0.tgz",
|
||||||
"integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==",
|
"integrity": "sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.4.0",
|
"@eslint-community/regexpp": "^4.4.0",
|
||||||
"@eslint/eslintrc": "^2.0.2",
|
"@eslint/eslintrc": "^2.0.2",
|
||||||
"@eslint/js": "8.37.0",
|
"@eslint/js": "8.38.0",
|
||||||
"@humanwhocodes/config-array": "^0.11.8",
|
"@humanwhocodes/config-array": "^0.11.8",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
@ -11797,12 +11813,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-plugin-jsdoc": {
|
"eslint-plugin-jsdoc": {
|
||||||
"version": "40.1.1",
|
"version": "41.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-40.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-41.1.1.tgz",
|
||||||
"integrity": "sha512-KxrQCq9pPt7LNeDBlLlnuJMpDFZnEQTs4e25NrT4u5cWmPw2P7F03F2qwPz0GMdlRZTyMOofuPAdiWytvPubvA==",
|
"integrity": "sha512-dfH97DKLGtQ5dgEMzd+GSUuY+xX/yyAfjML3O0pEWmMMpylsG6Ro65s4ziYXKmixiENYK9CTQxCVRGqZUFN2Mw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@es-joy/jsdoccomment": "~0.37.0",
|
"@es-joy/jsdoccomment": "~0.37.0",
|
||||||
|
"are-docs-informative": "^0.0.2",
|
||||||
"comment-parser": "1.3.1",
|
"comment-parser": "1.3.1",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
@ -12543,9 +12560,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"helmet": {
|
"helmet": {
|
||||||
"version": "6.0.1",
|
"version": "6.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/helmet/-/helmet-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/helmet/-/helmet-6.1.5.tgz",
|
||||||
"integrity": "sha512-8wo+VdQhTMVBMCITYZaGTbE4lvlthelPYSvoyNvk4RECTmrVjMerp9RfUOQXZWLvCcAn1pKj7ZRxK4lI9Alrcw=="
|
"integrity": "sha512-UgAvdoG0BhF9vcCh/j0bWtElo2ZHHk6OzC98NLCM6zK03DEVSM0vUAtT7iR+oTo2Mi6sGelAH3tL6B/uUWxV4g=="
|
||||||
},
|
},
|
||||||
"hosted-git-info": {
|
"hosted-git-info": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
@ -12589,9 +12606,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"html-tags": {
|
"html-tags": {
|
||||||
"version": "3.2.0",
|
"version": "3.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz",
|
||||||
"integrity": "sha512-vy7ClnArOZwCnqZgvv+ddgHgJiAFXe3Ge9ML5/mBctVJoUoYPCdxVucOywjDARn6CVoh3dRSFdPHy2sX80L0Wg==",
|
"integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"http-cache-semantics": {
|
"http-cache-semantics": {
|
||||||
@ -14308,18 +14325,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"version": "1.32.2",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.32.2.tgz",
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.32.3.tgz",
|
||||||
"integrity": "sha512-jHVnXJke0PXpuPszKtk9y1zZSlzO5+2a+aockT/AND0oeXx46FiJEFrafthurglLygVZA+1gEbtUM1C7qtTV+Q==",
|
"integrity": "sha512-h/ylpgoj6l/EjkfUDyx8cdOlfzC96itPpPe8BXacFkqpw/YsuxkpPyVbzEq4jw+bAJh5FLgh31Ljg2cR6HV3uw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"playwright-core": "1.32.2"
|
"playwright-core": "1.32.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"playwright-core": {
|
"playwright-core": {
|
||||||
"version": "1.32.2",
|
"version": "1.32.3",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.2.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.3.tgz",
|
||||||
"integrity": "sha512-zD7aonO+07kOTthsrCR3YCVnDcqSHIJpdFUtZEMOb6//1Rc7/6mZDRdw+nlzcQiQltOOsiqI3rrSyn/SlyjnJQ==",
|
"integrity": "sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"postcss": {
|
"postcss": {
|
||||||
@ -15293,14 +15310,14 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"stylelint": {
|
"stylelint": {
|
||||||
"version": "15.4.0",
|
"version": "15.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.5.0.tgz",
|
||||||
"integrity": "sha512-TlOvpG3MbcFwHmK0q2ykhmpKo7Dq892beJit0NPdpyY9b1tFah/hGhqnAz/bRm2PDhDbJLKvjzkEYYBEz7Dxcg==",
|
"integrity": "sha512-jyMO3R1QtE5mUS4v40+Gg+sIQBqe7CF1xPslxycDzNVkIBCUD4O+5F1vLPq16VmunUTv4qG9o2rUKLnU5KkVeQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@csstools/css-parser-algorithms": "^2.1.0",
|
"@csstools/css-parser-algorithms": "^2.1.0",
|
||||||
"@csstools/css-tokenizer": "^2.1.0",
|
"@csstools/css-tokenizer": "^2.1.0",
|
||||||
"@csstools/media-query-list-parser": "^2.0.1",
|
"@csstools/media-query-list-parser": "^2.0.2",
|
||||||
"@csstools/selector-specificity": "^2.2.0",
|
"@csstools/selector-specificity": "^2.2.0",
|
||||||
"balanced-match": "^2.0.0",
|
"balanced-match": "^2.0.0",
|
||||||
"colord": "^2.9.3",
|
"colord": "^2.9.3",
|
||||||
@ -15314,7 +15331,7 @@
|
|||||||
"global-modules": "^2.0.0",
|
"global-modules": "^2.0.0",
|
||||||
"globby": "^11.1.0",
|
"globby": "^11.1.0",
|
||||||
"globjoin": "^0.1.4",
|
"globjoin": "^0.1.4",
|
||||||
"html-tags": "^3.2.0",
|
"html-tags": "^3.3.1",
|
||||||
"ignore": "^5.2.4",
|
"ignore": "^5.2.4",
|
||||||
"import-lazy": "^4.0.0",
|
"import-lazy": "^4.0.0",
|
||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
@ -15367,19 +15384,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stylelint-config-recommended": {
|
"stylelint-config-recommended": {
|
||||||
"version": "11.0.0",
|
"version": "12.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-11.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz",
|
||||||
"integrity": "sha512-SoGIHNI748OCZn6BxFYT83ytWoYETCINVHV3LKScVAWQQauWdvmdDqJC5YXWjpBbxg2E761Tg5aUGKLFOVhEkA==",
|
"integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"stylelint-config-standard": {
|
"stylelint-config-standard": {
|
||||||
"version": "32.0.0",
|
"version": "33.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-32.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz",
|
||||||
"integrity": "sha512-UnGJxYDyYFrIE9CjDMZRkrNh2o4lOtO+MVZ9qG5b8yARfsWho0GMx4YvhHfsv8zKKgHeWX2wfeyxmuoqcaYZ4w==",
|
"integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"stylelint-config-recommended": "^11.0.0"
|
"stylelint-config-recommended": "^12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stylelint-prettier": {
|
"stylelint-prettier": {
|
||||||
|
16
package.json
16
package.json
@ -52,35 +52,35 @@
|
|||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-plugin-import": "^2.27.5",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-jest": "^27.2.1",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-jsdoc": "^40.1.1",
|
"eslint-plugin-jsdoc": "^41.1.1",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"express-basic-auth": "^1.2.1",
|
"express-basic-auth": "^1.2.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"jsdom": "^21.1.1",
|
"jsdom": "^21.1.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"playwright": "^1.32.2",
|
"playwright": "^1.32.3",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"pretty-quick": "^3.1.3",
|
"pretty-quick": "^3.1.3",
|
||||||
"sinon": "^15.0.3",
|
"sinon": "^15.0.3",
|
||||||
"stylelint": "^15.4.0",
|
"stylelint": "^15.5.0",
|
||||||
"stylelint-config-standard": "^32.0.0",
|
"stylelint-config-standard": "^33.0.0",
|
||||||
"stylelint-prettier": "^3.0.0",
|
"stylelint-prettier": "^3.0.0",
|
||||||
"suncalc": "^1.9.0"
|
"suncalc": "^1.9.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"electron": "^24.0.0"
|
"electron": "^24.1.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"console-stamp": "^3.1.1",
|
"console-stamp": "^3.1.1",
|
||||||
"digest-fetch": "^2.0.1",
|
"digest-fetch": "^2.0.3",
|
||||||
"envsub": "^4.1.0",
|
"envsub": "^4.1.0",
|
||||||
"eslint": "^8.37.0",
|
"eslint": "^8.38.0",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-ipfilter": "^1.3.1",
|
"express-ipfilter": "^1.3.1",
|
||||||
"feedme": "^2.0.2",
|
"feedme": "^2.0.2",
|
||||||
"helmet": "^6.0.1",
|
"helmet": "^6.1.5",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"luxon": "^1.28.1",
|
"luxon": "^1.28.1",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
|
@ -4,21 +4,19 @@ const { performWebRequest, formatTime } = require("../../../../modules/default/u
|
|||||||
const nodeVersion = process.version.match(/^v(\d+)\.*/)[1];
|
const nodeVersion = process.version.match(/^v(\d+)\.*/)[1];
|
||||||
|
|
||||||
describe("Default modules utils tests", () => {
|
describe("Default modules utils tests", () => {
|
||||||
describe("The performWebRequest-method", () => {
|
describe("performWebRequest", () => {
|
||||||
if (nodeVersion > 18) {
|
if (nodeVersion > 18) {
|
||||||
const locationHost = "localhost:8080";
|
const locationHost = "localhost:8080";
|
||||||
const locationProtocol = "http";
|
const locationProtocol = "http";
|
||||||
|
|
||||||
let fetchResponse;
|
let fetchResponse;
|
||||||
let fetchMock;
|
let fetchMock;
|
||||||
let url;
|
let urlToCall;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fetchResponse = new Response();
|
fetchResponse = new Response();
|
||||||
global.fetch = jest.fn(() => Promise.resolve(fetchResponse));
|
global.fetch = jest.fn(() => Promise.resolve(fetchResponse));
|
||||||
fetchMock = global.fetch;
|
fetchMock = global.fetch;
|
||||||
|
|
||||||
url = "www.test.com";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("When using cors proxy", () => {
|
describe("When using cors proxy", () => {
|
||||||
@ -30,24 +28,23 @@ describe("Default modules utils tests", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Calls correct URL once", async () => {
|
test("Calls correct URL once", async () => {
|
||||||
const urlToCall = "http://www.test.com/path?param1=value1";
|
urlToCall = "http://www.test.com/path?param1=value1";
|
||||||
url = urlToCall;
|
|
||||||
|
|
||||||
await performWebRequest(url, "json", true);
|
await performWebRequest(urlToCall, "json", true);
|
||||||
|
|
||||||
expect(fetchMock.mock.calls.length).toBe(1);
|
expect(fetchMock.mock.calls.length).toBe(1);
|
||||||
expect(fetchMock.mock.calls[0][0]).toBe(`${locationProtocol}//${locationHost}/cors?url=${urlToCall}`);
|
expect(fetchMock.mock.calls[0][0]).toBe(`${locationProtocol}//${locationHost}/cors?url=${urlToCall}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Sends correct headers", async () => {
|
test("Sends correct headers", async () => {
|
||||||
const urlToCall = "http://www.test.com/path?param1=value1";
|
urlToCall = "http://www.test.com/path?param1=value1";
|
||||||
url = urlToCall;
|
|
||||||
const headers = [
|
const headers = [
|
||||||
{ name: "header1", value: "value1" },
|
{ name: "header1", value: "value1" },
|
||||||
{ name: "header2", value: "value2" }
|
{ name: "header2", value: "value2" }
|
||||||
];
|
];
|
||||||
|
|
||||||
await performWebRequest(url, "json", true, headers);
|
await performWebRequest(urlToCall, "json", true, headers);
|
||||||
|
|
||||||
expect(fetchMock.mock.calls.length).toBe(1);
|
expect(fetchMock.mock.calls.length).toBe(1);
|
||||||
expect(fetchMock.mock.calls[0][0]).toBe(`${locationProtocol}//${locationHost}/cors?sendheaders=header1:value1,header2:value2&url=${urlToCall}`);
|
expect(fetchMock.mock.calls[0][0]).toBe(`${locationProtocol}//${locationHost}/cors?sendheaders=header1:value1,header2:value2&url=${urlToCall}`);
|
||||||
@ -56,24 +53,22 @@ describe("Default modules utils tests", () => {
|
|||||||
|
|
||||||
describe("When not using cors proxy", () => {
|
describe("When not using cors proxy", () => {
|
||||||
test("Calls correct URL once", async () => {
|
test("Calls correct URL once", async () => {
|
||||||
const urlToCall = "http://www.test.com/path?param1=value1";
|
urlToCall = "http://www.test.com/path?param1=value1";
|
||||||
url = urlToCall;
|
|
||||||
|
|
||||||
await performWebRequest(url);
|
await performWebRequest(urlToCall);
|
||||||
|
|
||||||
expect(fetchMock.mock.calls.length).toBe(1);
|
expect(fetchMock.mock.calls.length).toBe(1);
|
||||||
expect(fetchMock.mock.calls[0][0]).toBe(urlToCall);
|
expect(fetchMock.mock.calls[0][0]).toBe(urlToCall);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Sends correct headers", async () => {
|
test("Sends correct headers", async () => {
|
||||||
const urlToCall = "http://www.test.com/path?param1=value1";
|
urlToCall = "http://www.test.com/path?param1=value1";
|
||||||
url = urlToCall;
|
|
||||||
const headers = [
|
const headers = [
|
||||||
{ name: "header1", value: "value1" },
|
{ name: "header1", value: "value1" },
|
||||||
{ name: "header2", value: "value2" }
|
{ name: "header2", value: "value2" }
|
||||||
];
|
];
|
||||||
|
|
||||||
await performWebRequest(url, "json", false, headers);
|
await performWebRequest(urlToCall, "json", false, headers);
|
||||||
|
|
||||||
const expectedHeaders = { headers: { header1: "value1", header2: "value2" } };
|
const expectedHeaders = { headers: { header1: "value1", header2: "value2" } };
|
||||||
expect(fetchMock.mock.calls.length).toBe(1);
|
expect(fetchMock.mock.calls.length).toBe(1);
|
||||||
@ -83,23 +78,27 @@ describe("Default modules utils tests", () => {
|
|||||||
|
|
||||||
describe("When receiving json format", () => {
|
describe("When receiving json format", () => {
|
||||||
test("Returns undefined when no data is received", async () => {
|
test("Returns undefined when no data is received", async () => {
|
||||||
const response = await performWebRequest(url);
|
urlToCall = "www.test.com";
|
||||||
|
|
||||||
|
const response = await performWebRequest(urlToCall);
|
||||||
|
|
||||||
expect(response).toBe(undefined);
|
expect(response).toBe(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Returns object when data is received", async () => {
|
test("Returns object when data is received", async () => {
|
||||||
|
urlToCall = "www.test.com";
|
||||||
fetchResponse = new Response('{"body": "some content"}');
|
fetchResponse = new Response('{"body": "some content"}');
|
||||||
|
|
||||||
const response = await performWebRequest(url);
|
const response = await performWebRequest(urlToCall);
|
||||||
|
|
||||||
expect(response.body).toBe("some content");
|
expect(response.body).toBe("some content");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Returns expected headers when data is received", async () => {
|
test("Returns expected headers when data is received", async () => {
|
||||||
|
urlToCall = "www.test.com";
|
||||||
fetchResponse = new Response('{"body": "some content"}', { headers: { header1: "value1", header2: "value2" } });
|
fetchResponse = new Response('{"body": "some content"}', { headers: { header1: "value1", header2: "value2" } });
|
||||||
|
|
||||||
const response = await performWebRequest(url, "json", false, undefined, ["header1"]);
|
const response = await performWebRequest(urlToCall, "json", false, undefined, ["header1"]);
|
||||||
|
|
||||||
expect(response.headers.length).toBe(1);
|
expect(response.headers.length).toBe(1);
|
||||||
expect(response.headers[0].name).toBe("header1");
|
expect(response.headers[0].name).toBe("header1");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user