mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
f9871103bf
Reenable eslint `prefer-const` rule GitOrigin-RevId: 4f3825be8b8dff381095209085a36eaab76260d5
25 lines
549 B
JavaScript
25 lines
549 B
JavaScript
const Settings = require('settings-sharelatex')
|
|
const logger = require('logger-sharelatex')
|
|
|
|
function ensurePlansAreSetupCorrectly() {
|
|
Settings.plans.forEach(plan => {
|
|
if (typeof plan.price !== 'number') {
|
|
logger.fatal({ plan }, 'missing price on plan')
|
|
process.exit(1)
|
|
}
|
|
})
|
|
}
|
|
|
|
function findLocalPlanInSettings(planCode) {
|
|
for (const plan of Settings.plans) {
|
|
if (plan.planCode === planCode) {
|
|
return plan
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
|
|
module.exports = {
|
|
ensurePlansAreSetupCorrectly,
|
|
findLocalPlanInSettings,
|
|
}
|