forked from cadence/out-of-your-element
lazy load reg file
This commit is contained in:
parent
fd1bf3801b
commit
16abc6e6dd
1 changed files with 13 additions and 2 deletions
|
@ -76,11 +76,22 @@ function readRegistration() {
|
|||
}
|
||||
|
||||
/** @type {import("../types").AppServiceRegistrationConfig} */ // @ts-ignore
|
||||
let reg = readRegistration()
|
||||
let _reg = null
|
||||
let _regLoaded = false
|
||||
|
||||
function getReg() {
|
||||
if (!_regLoaded) {
|
||||
_reg = readRegistration()
|
||||
_regLoaded = true
|
||||
}
|
||||
return _reg
|
||||
}
|
||||
|
||||
module.exports.registrationFilePath = registrationFilePath
|
||||
module.exports.readRegistration = readRegistration
|
||||
module.exports.getTemplateRegistration = getTemplateRegistration
|
||||
module.exports.writeRegistration = writeRegistration
|
||||
module.exports.checkRegistration = checkRegistration
|
||||
module.exports.reg = reg
|
||||
Object.defineProperty(module.exports, 'reg', {
|
||||
get: getReg
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue