Skip to content

digidem/comapeo-schema

Repository files navigation

@comapeo/schema

JSON Schema and TypeScript types for CoMapeo.

Original draft: https://hackmd.io/wlMcMM65TmuPXGYOEbOR2g#

Table of Contents

Install

npm install --save @comapeo/schema

Usage

JS validation functions

import { validate } from '@comapeo/schema'

const testObservation = {
  /* ... */
}

const isValid = validate('observation', testObservation)
// returns true if validates against schema, false otherwise.

TypeScript types

import type { Observation } from '@comapeo/schema'

const myObs: Observation = {
  /* ... */
}

API

Maintainers

@digidem

License

MIT © 2024 Awana Digital