diff --git a/source/app/web/statics/embed/app.placeholder.js b/source/app/web/statics/embed/app.placeholder.js index f735b9a4..f6534eb0 100644 --- a/source/app/web/statics/embed/app.placeholder.js +++ b/source/app/web/statics/embed/app.placeholder.js @@ -1044,7 +1044,7 @@ }) : null), //Chess - ...(set.plugins.enabled.chess + ...(set.plugins.enabled.chess ? ({ chess: { platform: options["chess.platform"] || "(chess platform)", @@ -1056,14 +1056,19 @@ WhiteElo: faker.datatype.number(3000), BlackElo: faker.datatype.number(3000), }, - animation: { size: 40, delay: 3, duration: 0.6 }, - result: { white: faker.datatype.number(3), get black() { return this.white + faker.helpers.arrayElement([-1, +1]) } }, + animation: {size: 40, delay: 3, duration: 0.6}, + result: { + white: faker.datatype.number(3), + get black() { + return this.white + faker.helpers.arrayElement([-1, +1]) + }, + }, moves: [ {color: "w", piece: "p", from: "f2", to: "f4", san: "f4", flags: "b"}, {color: "b", piece: "p", from: "c7", to: "c5", san: "c5", flags: "b"}, {color: "w", piece: "p", from: "e2", to: "e4", san: "e4", flags: "b"}, {color: "b", piece: "p", from: "d7", to: "d6", san: "d6", flags: "n"}, - ] + ], }, }) : null), diff --git a/source/plugins/community/chess/index.mjs b/source/plugins/community/chess/index.mjs index 0c3f6ed6..823ccedf 100644 --- a/source/plugins/community/chess/index.mjs +++ b/source/plugins/community/chess/index.mjs @@ -11,7 +11,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal //Load inputs const {user, platform, animation} = imports.metadata.plugins.chess.inputs({data, account, q}) - for (const [key, defaulted] of Object.entries({size:40, delay:1, duration:4})) { + for (const [key, defaulted] of Object.entries({size: 40, delay: 1, duration: 4})) { if (Number.isNaN(Number(animation[key]))) animation[key] = defaulted if (animation[key] < 0) @@ -45,4 +45,4 @@ export default async function({login, q, imports, data, account}, {enabled = fal catch (error) { throw imports.format.error(error) } -} \ No newline at end of file +} diff --git a/tests/mocks/api/axios/get/lichess.mjs b/tests/mocks/api/axios/get/lichess.mjs index 6abb6887..fcedc02e 100644 --- a/tests/mocks/api/axios/get/lichess.mjs +++ b/tests/mocks/api/axios/get/lichess.mjs @@ -20,11 +20,7 @@ Bxh6 9. Qxh6 Bb7 10. a3 e5 11. O-O-O Qe7 12. Kb1 a6 13. Nc1 O-O-O 14. Nb3 exd4 d4 22. Nd5 Nbxd5 23. exd5 Qd6 24. Rxd4 cxd4 25. Re7+ Kb6 26. Qxd4+ Kxa5 27. b4+ Ka4 28. Qc3 Qxd5 29. Ra7 Bb7 30. Rxb7 Qc4 31. Qxf6 Kxa3 32. Qxa6+ Kxb4 33. c3+ Kxc3 34. Qa1+ Kd2 35. Qb2+ Kd1 36. Bf1 Rd2 37. Rd7 Rxd7 38. Bxc4 bxc4 39. Qxh8 -Rd3 40. Qa8 c3 41. Qa4+ Ke1 42. f4 f5 43. Kc1 Rd2 44. Qa7 1-0`.trim() +Rd3 40. Qa8 c3 41. Qa4+ Ke1 42. f4 f5 43. Kc1 Rd2 44. Qa7 1-0`.trim(), }) } } - - - -