summaryrefslogtreecommitdiff
path: root/dev/manifest-util.js
diff options
context:
space:
mode:
Diffstat (limited to 'dev/manifest-util.js')
-rw-r--r--dev/manifest-util.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/dev/manifest-util.js b/dev/manifest-util.js
index 638706d8..ac9b58db 100644
--- a/dev/manifest-util.js
+++ b/dev/manifest-util.js
@@ -20,6 +20,7 @@ import childProcess from 'child_process';
import fs from 'fs';
import {fileURLToPath} from 'node:url';
import path from 'path';
+import {parseJson} from './json.js';
const dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -29,14 +30,14 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
* @returns {T}
*/
function clone(value) {
- return JSON.parse(JSON.stringify(value));
+ return parseJson(JSON.stringify(value));
}
export class ManifestUtil {
constructor() {
const fileName = path.join(dirname, 'data', 'manifest-variants.json');
- const {manifest, variants, defaultVariant} = /** @type {import('dev/manifest').ManifestConfig} */ (JSON.parse(fs.readFileSync(fileName, {encoding: 'utf8'})));
+ const {manifest, variants, defaultVariant} = /** @type {import('dev/manifest').ManifestConfig} */ (parseJson(fs.readFileSync(fileName, {encoding: 'utf8'})));
/** @type {import('dev/manifest').Manifest} */
this._manifest = manifest;
/** @type {import('dev/manifest').ManifestVariant[]} */