mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-04-25 15:22:06 +00:00
Fixes #4105 ```bash In JavaScript, standard JSON does not support functions. If you use JSON.stringify() on an object containing functions, those functions will be omitted (if they are object properties) or changed to null (if they are in an array). ``` --------- Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
36 lines
826 B
JavaScript
36 lines
826 B
JavaScript
/*eslint object-shorthand: ["error", "always", { "methodsIgnorePattern": "^roundToInt2$" }]*/
|
|
|
|
let config = require(`${process.cwd()}/tests/configs/default.js`).configFactory({
|
|
modules: [
|
|
{
|
|
module: "clock",
|
|
position: "middle_center",
|
|
config: {
|
|
moduleFunctions: {
|
|
roundToInt1: (value) => {
|
|
try {
|
|
return Math.round(parseFloat(value));
|
|
} catch {
|
|
return value;
|
|
}
|
|
},
|
|
roundToInt2: function (value) {
|
|
try {
|
|
return Math.round(parseFloat(value));
|
|
} catch {
|
|
return value;
|
|
}
|
|
}
|
|
},
|
|
stringWithArrow: "a => b is not a function",
|
|
stringWithFunction: "this function keyword is just text"
|
|
}
|
|
}
|
|
]
|
|
});
|
|
|
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
|
if (typeof module !== "undefined") {
|
|
module.exports = config;
|
|
}
|