mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-24 17:51:51 +02:00
26 lines
547 B
JavaScript
26 lines
547 B
JavaScript
const Settings = require('@overleaf/settings')
|
|
const logger = require('@overleaf/logger')
|
|
|
|
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,
|
|
}
|