How to use the @signalk/signalk-schema.getMetadata function in @signalk/signalk-schema

To help you get started, we’ve selected a few @signalk/signalk-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SignalK / signalk-server-node / src / interfaces / rest.js View on Github external
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) {

@signalk/signalk-schema

SignalK specification schema as an npm module with tests

CC-BY-SA-2.0
Latest version published 10 months ago

Package Health Score

65 / 100
Full package analysis