overleaf/services/web/app/src/infrastructure/LoggerSerializers.js
Alf Eaton 1be43911b4 Merge pull request #3942 from overleaf/prettier-trailing-comma
Set Prettier's "trailingComma" setting to "es5"

GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
2021-04-28 02:10:01 +00:00

57 lines
1.2 KiB
JavaScript

// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
module.exports = {
user(user) {
if (user == null) {
return null
}
if (user._id == null) {
user = { _id: user }
}
return {
id: user._id,
email: user.email,
first_name: user.name,
last_name: user.name,
}
},
project(project) {
if (project == null) {
return null
}
if (project._id == null) {
project = { _id: project }
}
return {
id: project._id,
name: project.name,
}
},
docs(docs) {
if ((docs != null ? docs.map : undefined) == null) {
return
}
return docs.map(doc => ({
path: doc.path,
id: doc.doc,
}))
},
files(files) {
if ((files != null ? files.map : undefined) == null) {
return
}
return files.map(file => ({
path: file.path,
id: file.file,
}))
},
}