summaryrefslogtreecommitdiff
path: root/dev/dictionary-validate.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-30 20:00:46 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-30 20:00:46 -0500
commit338d210b66006189a0b775e8bd524c1cc11c2d9a (patch)
tree12fbd7eb03dcbb7ffcf270a1e7f9a8ee0cf53996 /dev/dictionary-validate.js
parent43bc4e3015a7b6c4f4941c4b6327a7445b356f1c (diff)
Update paths
Diffstat (limited to 'dev/dictionary-validate.js')
-rw-r--r--dev/dictionary-validate.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/dev/dictionary-validate.js b/dev/dictionary-validate.js
index b3654e75..a6948bfe 100644
--- a/dev/dictionary-validate.js
+++ b/dev/dictionary-validate.js
@@ -20,14 +20,17 @@ import fs from 'fs';
import JSZip from 'jszip';
import path from 'path';
import {performance} from 'perf_hooks';
+import {fileURLToPath} from 'url';
import {createJsonSchema} from './schema-validate.js';
+const dirname = path.dirname(fileURLToPath(import.meta.url));
+
/**
* @param {string} relativeFileName
* @returns {import('dev/dictionary-validate').Schema}
*/
function readSchema(relativeFileName) {
- const fileName = path.join(__dirname, relativeFileName);
+ const fileName = path.join(dirname, relativeFileName);
const source = fs.readFileSync(fileName, {encoding: 'utf8'});
return JSON.parse(source);
}