Convert to ESM

GitOrigin-RevId: b58b02f9e9c8d47909e95c3ade8e1bf33ed46c80
This commit is contained in:
Andrew Rumble
2025-10-22 13:50:38 +01:00
committed by Copybot
parent 0f4d5a7be6
commit 912324f560
78 changed files with 515 additions and 484 deletions

View File

@@ -1,11 +1,13 @@
const { Project } = require('../../models/Project')
const settings = require('@overleaf/settings')
const { callbackify } = require('util')
const { db, ObjectId } = require('../../infrastructure/mongodb')
const Errors = require('../Errors/Errors')
const { ReturnDocument } = require('mongodb-legacy')
import { Project } from '../../models/Project.js'
import settings from '@overleaf/settings'
import { callbackify } from 'node:util'
import { db, ObjectId } from '../../infrastructure/mongodb.js'
import Errors from '../Errors/Errors.js'
import mongodb from 'mongodb-legacy'
const safeCompilers = ['xelatex', 'pdflatex', 'latex', 'lualatex']
const { ReturnDocument } = mongodb
const ProjectOptionsHandler = {
async setCompiler(projectId, compiler) {
if (!compiler) {
@@ -92,7 +94,7 @@ const ProjectOptionsHandler = {
},
}
module.exports = {
export default {
setCompiler: callbackify(ProjectOptionsHandler.setCompiler),
setImageName: callbackify(ProjectOptionsHandler.setImageName),
setSpellCheckLanguage: callbackify(