@schalkneethling/miyagi-core 4.4.2 → 4.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +7 -2
  2. package/api/app.js +16 -16
  3. package/api/index.js +263 -262
  4. package/bin/miyagi.js +1 -1
  5. package/dist/css/iframe.css +6 -30
  6. package/frontend/assets/css/iframe/accordion-tabs.css +39 -39
  7. package/frontend/assets/css/iframe/jsontree.js.css +149 -149
  8. package/frontend/assets/css/iframe/prism.css +45 -45
  9. package/frontend/assets/css/iframe/styleguide/colors.css +27 -27
  10. package/frontend/assets/css/iframe/styleguide/fonts.css +23 -23
  11. package/frontend/assets/css/iframe/styleguide/index.css +58 -58
  12. package/frontend/assets/css/iframe/styleguide/spacings.css +10 -10
  13. package/frontend/assets/css/iframe.css +191 -191
  14. package/frontend/assets/css/main/menu/config-switcher.css +21 -21
  15. package/frontend/assets/css/main/menu/config-switchers.css +34 -34
  16. package/frontend/assets/css/main/menu/goto.css +16 -16
  17. package/frontend/assets/css/main/menu/nav.css +49 -49
  18. package/frontend/assets/css/main/menu/search.css +34 -34
  19. package/frontend/assets/css/main/menu/title.css +18 -18
  20. package/frontend/assets/css/main/menu.css +89 -89
  21. package/frontend/assets/css/main/reset.css +47 -47
  22. package/frontend/assets/css/main.css +41 -41
  23. package/frontend/assets/css/shared.css +16 -16
  24. package/frontend/assets/css/tokens.css +108 -107
  25. package/frontend/assets/js/_accordion-tabs.js +392 -392
  26. package/frontend/assets/js/_goto.js +59 -59
  27. package/frontend/assets/js/_iframe-links.js +14 -14
  28. package/frontend/assets/js/_is-triggered.js +3 -3
  29. package/frontend/assets/js/_main.js +369 -369
  30. package/frontend/assets/js/_mock-data.js +8 -8
  31. package/frontend/assets/js/_prism.js +1082 -1081
  32. package/frontend/assets/js/_search.js +186 -186
  33. package/frontend/assets/js/_socket.js +44 -44
  34. package/frontend/assets/js/config-switcher/development-mode.js +38 -38
  35. package/frontend/assets/js/config-switcher/index.js +55 -55
  36. package/frontend/assets/js/config-switcher/text-direction.js +22 -22
  37. package/frontend/assets/js/config-switcher/theme.js +68 -68
  38. package/frontend/assets/js/iframe.build.js +25 -25
  39. package/frontend/assets/js/iframe.js +38 -38
  40. package/frontend/assets/js/jsontree.js +979 -976
  41. package/frontend/assets/js/main.build.js +29 -29
  42. package/frontend/assets/js/main.js +31 -31
  43. package/frontend/assets/js/styleguide/color-converter.js +652 -652
  44. package/frontend/assets/js/styleguide/index.js +100 -100
  45. package/lib/build/index.js +1014 -1020
  46. package/lib/cli/app.js +16 -16
  47. package/lib/cli/component.js +50 -50
  48. package/lib/cli/doctor.js +130 -121
  49. package/lib/cli/drupal-assets.js +163 -157
  50. package/lib/cli/lint.js +196 -196
  51. package/lib/cli/run.js +150 -146
  52. package/lib/config.js +86 -86
  53. package/lib/constants/lint-log-levels.js +6 -6
  54. package/lib/drupal/load-assets-config.js +59 -60
  55. package/lib/drupal/resolve-library-assets.js +132 -141
  56. package/lib/errors.js +20 -20
  57. package/lib/generator/component.js +124 -124
  58. package/lib/generator/mocks.js +156 -156
  59. package/lib/helpers.js +68 -68
  60. package/lib/i18n/en.js +93 -93
  61. package/lib/i18n/index.js +8 -8
  62. package/lib/index.js +13 -13
  63. package/lib/init/args.js +153 -153
  64. package/lib/init/config.js +452 -438
  65. package/lib/init/engines.js +41 -41
  66. package/lib/init/index.js +83 -83
  67. package/lib/init/rendering.js +3 -3
  68. package/lib/init/static.js +90 -90
  69. package/lib/init/twing/cache.js +27 -27
  70. package/lib/init/twing/functions.js +37 -37
  71. package/lib/init/views.js +5 -5
  72. package/lib/logger.js +72 -72
  73. package/lib/mocks/get.js +88 -88
  74. package/lib/mocks/index.js +2 -2
  75. package/lib/mocks/resolve/ref.js +447 -447
  76. package/lib/mocks/resolve/tpl.js +218 -218
  77. package/lib/mocks/resolve.js +154 -154
  78. package/lib/render/helpers/resolve-assets.js +29 -39
  79. package/lib/render/helpers.js +27 -27
  80. package/lib/render/index.js +18 -18
  81. package/lib/render/views/iframe/component.docs.js +50 -50
  82. package/lib/render/views/iframe/component.js +249 -248
  83. package/lib/render/views/iframe/design-tokens/colors.js +38 -38
  84. package/lib/render/views/iframe/design-tokens/index.js +3 -3
  85. package/lib/render/views/iframe/design-tokens/sizes.js +35 -35
  86. package/lib/render/views/iframe/design-tokens/typography.js +37 -37
  87. package/lib/render/views/iframe/docs.js +42 -42
  88. package/lib/render/views/iframe/index.js +28 -28
  89. package/lib/render/views/iframe/variation.js +89 -89
  90. package/lib/render/views/iframe/variation.standalone.js +69 -68
  91. package/lib/render/views/main/component.docs.js +38 -38
  92. package/lib/render/views/main/component.js +55 -55
  93. package/lib/render/views/main/design-tokens.js +38 -38
  94. package/lib/render/views/main/docs.js +33 -33
  95. package/lib/render/views/main/index.js +33 -33
  96. package/lib/state/components.js +99 -99
  97. package/lib/state/css.js +33 -33
  98. package/lib/state/docs.js +72 -72
  99. package/lib/state/file-contents.js +154 -154
  100. package/lib/state/helpers.js +53 -53
  101. package/lib/state/index.js +39 -39
  102. package/lib/state/menu/index.js +202 -202
  103. package/lib/state/menu/structure.js +84 -84
  104. package/lib/state/partials.js +12 -12
  105. package/lib/state/source-tree.js +51 -51
  106. package/lib/styleguide/color-names.js +148 -148
  107. package/lib/styleguide/colors.js +113 -113
  108. package/lib/styleguide/helpers.js +33 -33
  109. package/lib/styleguide/index.js +4 -4
  110. package/lib/styleguide/media-queries.js +18 -18
  111. package/lib/styleguide/spacings.js +22 -22
  112. package/lib/styleguide/typography.js +46 -46
  113. package/lib/validator/mocks.js +110 -83
  114. package/lib/validator/schemas.js +236 -227
  115. package/package.json +118 -117
@@ -1,7 +1,7 @@
1
1
  import path from "path";
2
2
  import {
3
- createSynchronousEnvironment,
4
- createSynchronousFilesystemLoader,
3
+ createSynchronousEnvironment,
4
+ createSynchronousFilesystemLoader,
5
5
  } from "twing";
6
6
  import fs from "fs";
7
7
  import { t } from "../i18n/index.js";
@@ -15,60 +15,60 @@ import * as twingFunctions from "./twing/functions.js";
15
15
  * @returns {void}
16
16
  */
17
17
  function setMiyagiEngine() {
18
- const loader = createSynchronousFilesystemLoader(fs);
19
- const twing = createSynchronousEnvironment(loader, {
20
- cache: new TwingCache(),
21
- });
18
+ const loader = createSynchronousFilesystemLoader(fs);
19
+ const twing = createSynchronousEnvironment(loader, {
20
+ cache: new TwingCache(),
21
+ });
22
22
 
23
- loader.addPath(
24
- path.join(import.meta.dirname, "../../frontend/views"),
25
- "@miyagi",
26
- );
23
+ loader.addPath(
24
+ path.join(import.meta.dirname, "../../frontend/views"),
25
+ "@miyagi",
26
+ );
27
27
 
28
- Object.values(twingFunctions).forEach((twingFunction) => {
29
- twing.addFunction(twingFunction);
30
- });
28
+ Object.values(twingFunctions).forEach((twingFunction) => {
29
+ twing.addFunction(twingFunction);
30
+ });
31
31
 
32
- global.app.engine("miyagi", async (str, options, cb) =>
33
- cb(await twing.render(str, options)),
34
- );
32
+ global.app.engine("miyagi", async (str, options, cb) =>
33
+ cb(await twing.render(str, options)),
34
+ );
35
35
  }
36
36
 
37
37
  /**
38
38
  * @returns {Promise<void>}
39
39
  */
40
40
  async function setUserEngine() {
41
- const { extension } = global.config.files.templates;
42
- const { engine } = global.config;
41
+ const { extension } = global.config.files.templates;
42
+ const { engine } = global.config;
43
43
 
44
- if (!engine.render) {
45
- const message = "No render function has beend defined.";
46
- log("error", message);
47
- throw new MiyagiError(message, {
48
- code: EXIT_CODES.CONFIG_ERROR,
49
- logged: true,
50
- });
51
- }
44
+ if (!engine.render) {
45
+ const message = "No render function has beend defined.";
46
+ log("error", message);
47
+ throw new MiyagiError(message, {
48
+ code: EXIT_CODES.CONFIG_ERROR,
49
+ logged: true,
50
+ });
51
+ }
52
52
 
53
- try {
54
- global.app.engine(
55
- helpers.getSingleFileExtension(extension),
56
- async (name, context, cb) => await engine.render({ name, context, cb }),
57
- );
58
- } catch (e) {
59
- const message = t("settingEngineFailed");
60
- log("error", message, e);
61
- throw new MiyagiError(message, {
62
- code: EXIT_CODES.CONFIG_ERROR,
63
- logged: true,
64
- });
65
- }
53
+ try {
54
+ global.app.engine(
55
+ helpers.getSingleFileExtension(extension),
56
+ async (name, context, cb) => await engine.render({ name, context, cb }),
57
+ );
58
+ } catch (e) {
59
+ const message = t("settingEngineFailed");
60
+ log("error", message, e);
61
+ throw new MiyagiError(message, {
62
+ code: EXIT_CODES.CONFIG_ERROR,
63
+ logged: true,
64
+ });
65
+ }
66
66
  }
67
67
 
68
68
  /**
69
69
  * @returns {Promise<void>}
70
70
  */
71
71
  export default async function initEngines() {
72
- await setUserEngine();
73
- setMiyagiEngine();
72
+ await setUserEngine();
73
+ setMiyagiEngine();
74
74
  }
package/lib/init/index.js CHANGED
@@ -25,67 +25,67 @@ import setWatcher from "./watcher.js";
25
25
  * @returns {Promise<object>}
26
26
  */
27
27
  export default async function init(mergedConfig) {
28
- // deepcode ignore UseCsurfForExpress: local server only, deepcode ignore DisablePoweredBy: local server only
29
- global.app = express();
30
- global.app.use(cookieParser());
31
- global.config = mergedConfig;
32
- global.app.set("view cache", global.config.isBuild);
33
- global.app.set("cache", global.config.isBuild);
34
-
35
- await setEngines();
36
-
37
- const port = process.env.PORT || appConfig.defaultPort;
38
-
39
- global.app.set("port", port);
40
-
41
- await setState({
42
- sourceTree: true,
43
- menu: true,
44
- partials: true,
45
- fileContents: true,
46
- css: true,
47
- });
48
-
49
- setStatic();
50
- setRouter();
51
- setViews();
52
-
53
- if (global.config.isBuild) {
54
- try {
55
- const message = await build();
56
- log("success", message);
57
- return {
58
- success: true,
59
- code: EXIT_CODES.SUCCESS,
60
- shouldExit: true,
61
- message,
62
- };
63
- } catch (error) {
64
- log("error", error);
65
- return {
66
- success: false,
67
- code: EXIT_CODES.GENERAL_ERROR,
68
- shouldExit: true,
69
- message: String(error),
70
- };
71
- }
72
- }
73
-
74
- const { server, port: actualPort } = await startServer(
75
- global.app.get("port"),
76
- );
77
-
78
- setWatcher(server);
79
-
80
- log("success", `${t("serverStarted").replace("{{port}}", actualPort)}\n`);
81
-
82
- return {
83
- success: true,
84
- code: EXIT_CODES.SUCCESS,
85
- shouldExit: false,
86
- server,
87
- port: actualPort,
88
- };
28
+ // deepcode ignore UseCsurfForExpress: local server only, deepcode ignore DisablePoweredBy: local server only
29
+ global.app = express();
30
+ global.app.use(cookieParser());
31
+ global.config = mergedConfig;
32
+ global.app.set("view cache", global.config.isBuild);
33
+ global.app.set("cache", global.config.isBuild);
34
+
35
+ await setEngines();
36
+
37
+ const port = process.env.PORT || appConfig.defaultPort;
38
+
39
+ global.app.set("port", port);
40
+
41
+ await setState({
42
+ sourceTree: true,
43
+ menu: true,
44
+ partials: true,
45
+ fileContents: true,
46
+ css: true,
47
+ });
48
+
49
+ setStatic();
50
+ setRouter();
51
+ setViews();
52
+
53
+ if (global.config.isBuild) {
54
+ try {
55
+ const message = await build();
56
+ log("success", message);
57
+ return {
58
+ success: true,
59
+ code: EXIT_CODES.SUCCESS,
60
+ shouldExit: true,
61
+ message,
62
+ };
63
+ } catch (error) {
64
+ log("error", error);
65
+ return {
66
+ success: false,
67
+ code: EXIT_CODES.GENERAL_ERROR,
68
+ shouldExit: true,
69
+ message: String(error),
70
+ };
71
+ }
72
+ }
73
+
74
+ const { server, port: actualPort } = await startServer(
75
+ global.app.get("port"),
76
+ );
77
+
78
+ setWatcher(server);
79
+
80
+ log("success", `${t("serverStarted").replace("{{port}}", actualPort)}\n`);
81
+
82
+ return {
83
+ success: true,
84
+ code: EXIT_CODES.SUCCESS,
85
+ shouldExit: false,
86
+ server,
87
+ port: actualPort,
88
+ };
89
89
  }
90
90
 
91
91
  /**
@@ -93,26 +93,26 @@ export default async function init(mergedConfig) {
93
93
  * @returns {Promise} gets resolved with the server instance and the actual port
94
94
  */
95
95
  function startServer(port) {
96
- const server = http.createServer(global.app);
97
-
98
- return new Promise((resolve) => {
99
- server
100
- .listen(port, function () {
101
- resolve({ server, port });
102
- })
103
- .on("error", (error) => {
104
- if (error["code"] === "EADDRINUSE") {
105
- log(
106
- "error",
107
- t("portInUse").replace("{{port}}", port),
108
- error.toString(),
109
- );
110
- server.close(async function () {
111
- const response = await startServer(port + 1);
112
-
113
- resolve(response);
114
- });
115
- }
116
- });
117
- });
96
+ const server = http.createServer(global.app);
97
+
98
+ return new Promise((resolve) => {
99
+ server
100
+ .listen(port, function () {
101
+ resolve({ server, port });
102
+ })
103
+ .on("error", (error) => {
104
+ if (error["code"] === "EADDRINUSE") {
105
+ log(
106
+ "error",
107
+ t("portInUse").replace("{{port}}", port),
108
+ error.toString(),
109
+ );
110
+ server.close(async function () {
111
+ const response = await startServer(port + 1);
112
+
113
+ resolve(response);
114
+ });
115
+ }
116
+ });
117
+ });
118
118
  }
@@ -6,7 +6,7 @@ import init from "./index.js";
6
6
  * @returns {Promise<object>}
7
7
  */
8
8
  export default async function initRendering(config) {
9
- if (config) {
10
- return await init(config);
11
- }
9
+ if (config) {
10
+ return await init(config);
11
+ }
12
12
  }
@@ -11,68 +11,68 @@ import config from "../default-config.js";
11
11
  * @returns {void}
12
12
  */
13
13
  function registerUserAssetFolder() {
14
- const { assets } = global.config;
15
-
16
- if (assets && assets.folder) {
17
- for (const folder of assets.folder) {
18
- global.app.use(
19
- path.join("/", folder),
20
- express.static(path.join(assets.root, folder)),
21
- );
22
- }
23
- }
14
+ const { assets } = global.config;
15
+
16
+ if (assets && assets.folder) {
17
+ for (const folder of assets.folder) {
18
+ global.app.use(
19
+ path.join("/", folder),
20
+ express.static(path.join(assets.root, folder)),
21
+ );
22
+ }
23
+ }
24
24
  }
25
25
 
26
26
  /**
27
27
  * @returns {void}
28
28
  */
29
29
  function registerThemeFavicon() {
30
- if (global.config.ui && global.config.ui.theme) {
31
- const file = global.config.ui.theme.favicon;
30
+ if (global.config.ui && global.config.ui.theme) {
31
+ const file = global.config.ui.theme.favicon;
32
32
 
33
- if (file) {
34
- global.app.use(`/favicon.ico`, express.static(path.resolve(file)));
35
- }
36
- }
33
+ if (file) {
34
+ global.app.use(`/favicon.ico`, express.static(path.resolve(file)));
35
+ }
36
+ }
37
37
  }
38
38
 
39
39
  /**
40
40
  * @returns {void}
41
41
  */
42
42
  function registerThemeLogo() {
43
- const files = [
44
- global.config.ui.theme.logo.light,
45
- global.config.ui.theme.logo.dark,
46
- ];
47
-
48
- files.forEach((file) => {
49
- if (file) {
50
- global.app.use(
51
- path.join("/", path.dirname(file)),
52
- express.static(path.resolve(path.dirname(file))),
53
- );
54
- }
55
- });
43
+ const files = [
44
+ global.config.ui.theme.logo.light,
45
+ global.config.ui.theme.logo.dark,
46
+ ];
47
+
48
+ files.forEach((file) => {
49
+ if (file) {
50
+ global.app.use(
51
+ path.join("/", path.dirname(file)),
52
+ express.static(path.resolve(path.dirname(file))),
53
+ );
54
+ }
55
+ });
56
56
  }
57
57
 
58
58
  /**
59
59
  * @param {("css"|"js")} files - the type of user assets that should be registered
60
60
  */
61
61
  function registerUserFiles(files) {
62
- const { assets } = global.config;
62
+ const { assets } = global.config;
63
63
 
64
- if (assets) {
65
- for (const file of assets[files]) {
66
- const asset = files === "js" ? file.src : file;
64
+ if (assets) {
65
+ for (const file of assets[files]) {
66
+ const asset = files === "js" ? file.src : file;
67
67
 
68
- if (asset.startsWith("https://")) continue;
68
+ if (asset.startsWith("https://")) continue;
69
69
 
70
- global.app.use(
71
- path.join("/", path.dirname(asset)),
72
- express.static(path.join(assets.root, path.dirname(asset))),
73
- );
74
- }
75
- }
70
+ global.app.use(
71
+ path.join("/", path.dirname(asset)),
72
+ express.static(path.join(assets.root, path.dirname(asset))),
73
+ );
74
+ }
75
+ }
76
76
  }
77
77
 
78
78
  /**
@@ -80,84 +80,84 @@ function registerUserFiles(files) {
80
80
  * @returns {void}
81
81
  */
82
82
  function registerSharedFiles() {
83
- const { assets } = global.config;
83
+ const { assets } = global.config;
84
84
 
85
- if (!assets?.shared) return;
85
+ if (!assets?.shared) return;
86
86
 
87
- for (const file of assets.shared.css || []) {
88
- if (file.startsWith("https://")) continue;
87
+ for (const file of assets.shared.css || []) {
88
+ if (file.startsWith("https://")) continue;
89
89
 
90
- global.app.use(
91
- path.join("/", path.dirname(file)),
92
- express.static(path.join(assets.root, path.dirname(file))),
93
- );
94
- }
90
+ global.app.use(
91
+ path.join("/", path.dirname(file)),
92
+ express.static(path.join(assets.root, path.dirname(file))),
93
+ );
94
+ }
95
95
 
96
- for (const file of assets.shared.js || []) {
97
- const src = file.src || file;
98
- if (src.startsWith("https://")) continue;
96
+ for (const file of assets.shared.js || []) {
97
+ const src = file.src || file;
98
+ if (src.startsWith("https://")) continue;
99
99
 
100
- global.app.use(
101
- path.join("/", path.dirname(src)),
102
- express.static(path.join(assets.root, path.dirname(src))),
103
- );
104
- }
100
+ global.app.use(
101
+ path.join("/", path.dirname(src)),
102
+ express.static(path.join(assets.root, path.dirname(src))),
103
+ );
104
+ }
105
105
  }
106
106
 
107
107
  /**
108
108
  * @returns {void}
109
109
  */
110
110
  function registerCustomPropertyFiles() {
111
- const { assets } = global.config;
112
-
113
- if (assets?.customProperties?.files) {
114
- for (const file of assets.customProperties.files) {
115
- global.app.use(
116
- path.join("/", path.dirname(file)),
117
- express.static(path.dirname(file)),
118
- );
119
- }
120
- }
111
+ const { assets } = global.config;
112
+
113
+ if (assets?.customProperties?.files) {
114
+ for (const file of assets.customProperties.files) {
115
+ global.app.use(
116
+ path.join("/", path.dirname(file)),
117
+ express.static(path.dirname(file)),
118
+ );
119
+ }
120
+ }
121
121
  }
122
122
 
123
123
  /**
124
124
  * @returns {void}
125
125
  */
126
126
  function registerAssetFolder() {
127
- const assetFolder =
128
- config.folders.assets[
129
- process.env.MIYAGI_DEVELOPMENT ? "development" : "production"
130
- ];
131
-
132
- global.app.use(
133
- `/${config.projectName}`,
134
- express.static(path.join(import.meta.dirname, `../../${assetFolder}`)),
135
- );
127
+ const assetFolder =
128
+ config.folders.assets[
129
+ process.env.MIYAGI_DEVELOPMENT ? "development" : "production"
130
+ ];
131
+
132
+ global.app.use(
133
+ `/${config.projectName}`,
134
+ express.static(path.join(import.meta.dirname, `../../${assetFolder}`)),
135
+ );
136
136
  }
137
137
 
138
138
  /**
139
139
  * @returns {void}
140
140
  */
141
141
  function registerUserComponentAssets() {
142
- if (!global.config.components.folder) return;
142
+ if (!global.config.components.folder) return;
143
143
 
144
- global.app.use(
145
- path.join("/", global.config.components.folder),
146
- express.static(global.config.components.folder),
147
- );
144
+ global.app.use(
145
+ path.join("/", global.config.components.folder),
146
+ express.static(global.config.components.folder),
147
+ );
148
148
  }
149
149
 
150
150
  /**
151
151
  * @returns {void}
152
152
  */
153
153
  export default function initStatic() {
154
- registerThemeFavicon();
155
- registerThemeLogo();
156
- registerUserAssetFolder();
157
- registerUserComponentAssets();
158
- registerUserFiles("css");
159
- registerUserFiles("js");
160
- registerSharedFiles();
161
- registerCustomPropertyFiles();
162
- registerAssetFolder();
154
+ registerThemeFavicon();
155
+ registerThemeLogo();
156
+ registerUserAssetFolder();
157
+ registerUserComponentAssets();
158
+ registerUserFiles("css");
159
+ registerUserFiles("js");
160
+ registerSharedFiles();
161
+ registerCustomPropertyFiles();
162
+ registerAssetFolder();
163
163
  }
@@ -1,34 +1,34 @@
1
1
  export default class TwingCache {
2
- #cache = new Map();
2
+ #cache = new Map();
3
3
 
4
- /**
5
- * @param {string} key
6
- * @returns {object|null}
7
- */
8
- load(key) {
9
- if (this.#cache.get(key)?.content) {
10
- return this.#cache.get(key)?.content;
11
- }
4
+ /**
5
+ * @param {string} key
6
+ * @returns {object|null}
7
+ */
8
+ load(key) {
9
+ if (this.#cache.get(key)?.content) {
10
+ return this.#cache.get(key)?.content;
11
+ }
12
12
 
13
- return null;
14
- }
13
+ return null;
14
+ }
15
15
 
16
- /**
17
- * @param {string} key
18
- * @param {object} content
19
- */
20
- write(key, content) {
21
- const timestamp = new Date().getTime();
22
- const value = { content, timestamp };
16
+ /**
17
+ * @param {string} key
18
+ * @param {object} content
19
+ */
20
+ write(key, content) {
21
+ const timestamp = new Date().getTime();
22
+ const value = { content, timestamp };
23
23
 
24
- this.#cache.set(key, value);
25
- }
24
+ this.#cache.set(key, value);
25
+ }
26
26
 
27
- /**
28
- * @param {string} key
29
- * @returns {number|null}
30
- */
31
- getTimestamp(key) {
32
- return this.#cache.get(key)?.timestamp ?? null;
33
- }
27
+ /**
28
+ * @param {string} key
29
+ * @returns {number|null}
30
+ */
31
+ getTimestamp(key) {
32
+ return this.#cache.get(key)?.timestamp ?? null;
33
+ }
34
34
  }