Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (path === 'self') {
return res.json(`vessels.${app.selfId}`)
}
path =
path.length > 0
? path
.replace(/\/$/, '')
.split('/')
: []
if (
path.length > 4 &&
path[path.length - 1] === 'meta'
) {
let meta = getMetadata(path.slice(0, path.length - 1).join('.'))
let fromDefaults = _.get(app.deltaCache.defaults, path.join('.'))
if (meta || fromDefaults) {
res.json({...meta, ...fromDefaults})
return
}
}
if (
path.length > 5 &&
path[path.length - 1] === 'units' &&
path[path.length - 2] === 'meta'
) {
let units = _.get(app.deltaCache.defaults, path.join('.'))
if (!units) {
units = getUnits(path.slice(0, path.length - 2).join('.'))
}
if (units) {