Nagging Penguin Matriarchs

    @locational/application-registry-validation

    2.4.7 • Public • Published

    Application Registry Validation

    Codeship Status for locational/application-registry-validation npm version

    Validate a douma configuration.

    Get started

    # install 
    npm i @locational/application-registry-validation
    // import
    import {validate, errors} from '@locational/application-registry-validation'

    API

    validate(configuration, ?geodata)

    Arguments

    configuration (Object): Locational configuration to validate

    geodata (Object): Optional, a geodata object

    Returns

    Boolean : Whether or not the configuration is valid

    errors(configuration, ?geodata)

    Arguments

    configuration (Object): Locational configuration to validate

    geodata (Object): Optional, a geodata object

    Returns

    Array : Objects that describe the errors

    Geodata object

    If the geodata object is passed to either functions, extra validations that require geodata will be run. If it is not passed, a warning will be printed.

    {
      "districts": {<geojson feature collection>},
      "villages": {<geojson feature collection>}
    }

    Example

    const {validate, errors} = require('@locational/application-registry-validation')
    
    const configuration = {...}
    
    const configuration_valid  = validate(configuration)
    if (!configuration_valid) {
      // invalid configuration
      const configuration_errors =  errors(configuration)
      console.error(configuration_errors)
    } 
    // no problems

    Keywords

    none

    Install

    npm i @locational/application-registry-validation

    DownloadsWeekly Downloads

    5

    Version

    2.4.7

    License

    MIT

    Unpacked Size

    602 kB

    Total Files

    52

    Last publish

    Collaborators

    • onlyjsmith
    • mosaic141688