JSPM

deep-check

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q28417F

    check for the existence of deeply nested objects

    Package Exports

    • deep-check

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (deep-check) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    deep-check

    Check that properties of a deeply-nested object exist.

    install

    $ npm install deep-check

    usage

    var deepCheck = require('deep-check')
    var data = {
      fruit:{
        citrus:{
          lemons:10,
          oranges:12
        }
      },
      orders:{
        settings:{
          id:12
        }
      }
    }
    
    var schema = {
      fruit:{
        citrus:{
          lemons:true,
          weight:true
        }
      },
      orders:{
        settings:true,
        history:true
      }
    }
    
    var missing = deepCheck(data, schema)
    
    console.log(missing)
    
    // ['fruit.citrus.weight', 'orders.history']

    license

    MIT