2.4.7 • Published 6 years ago

@locational/application-registry-validation v2.4.7

Weekly downloads
14
License
MIT
Repository
github
Last release
6 years ago

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
2.4.7

6 years ago

2.4.6

6 years ago

2.4.5

6 years ago

2.4.3

6 years ago

2.4.2

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago