How to use the @signalk/signalk-schema.getUnits 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
) {
          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) {
            res.json(units)
            return
          }
        }

        if ( path[0] === 'vessels' && path[1] === 'self' ) {
          path[1] = app.selfId
        }
             
        function sendResult(last, aPath) {
          if (last) {
            // tslint:disable-next-line: forin
            for (const i in aPath) {
              const p = aPath[i]

@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