Pretty-print zoteroTypeSchemaData.js

We should get rid of this, but in the meantime, pretty-print it (though
it will need to be generated in a new data directory to be consistent).
This commit is contained in:
Dan Stillman 2025-02-05 03:27:33 -05:00
parent d358915707
commit 083b4f69c9

View file

@ -80,7 +80,7 @@ var { FilePicker } = ChromeUtils.importESModule('chrome://zotero/content/modules
schemaFile.append("zoteroTypeSchemaData.js");
await Zotero.File.putContentsAsync(
schemaFile,
`var ZOTERO_TYPE_SCHEMA = ${JSON.stringify(schema)};\n\n`
`var ZOTERO_TYPE_SCHEMA = ${JSON.stringify(schema, null, '\t')};\n\n`
+ "if (typeof module !== 'undefined') {\n\tmodule.exports = ZOTERO_TYPE_SCHEMA;\n}\n"
);
resultElem.innerHTML = `<p>Wrote ${schemaFile.path} successfully.</p>`;