This library allows to define sets using JSON. JSONSetValidator parsed an array of objects and validates it using the JSON definition.
npm install --save @octra/json-sets
You have two options to install this package und use it as UMD:
a) Install via NPM and reference local files (no internet connection needed om production).
<script type="application/javascript" src="node_modules/@octra/json-sets/index.umd.js"></script>
b) Reference remote file (internet connection needed on production).
<script type="application/javascript" src="https://unpkg.com/@octra/json-sets/index.umd.js"></script>
Import the classes and functions from @octra/json-sets
. For example
import {JsonSetValidator} from "@octra/json-sets";
All functions and classes are available via global scope OctraJSONSets
. For example:
/*
make sure that you have injected the umd bundle as described before.
*/
const validator = new OctraJSONSets.JSONSetValidator();
You can find more information about classes and functions of @octra/json-sets
here.