@extendscript/aes.patch.json.validate

1.0.1 • Public • Published

json.validate

version

Extension

Adds validate() to JSON. Validate a JSON objects to Schema.

Source: iclanzan/jassi

Install

npm install @extendscript/aes.patch.json.validate

Include

#include 'node_modules/@extendscript/aes.patch.json.validate/validate.js'

Use

errors = JSON.validate('apple', {type: 'string', maxLength: 5});

if (0 === errors.length) {
    // validation passed, do something here
}
else {
    // validation failed, print the errors
    errors.forEach(function(error) {
        console.log(error.property + ': ' + error.message);
    });
}

Test

You can test the code against a range of targets:

npm run test target-1 target-2

We keep a log of test results

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i @extendscript/aes.patch.json.validate

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    16.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • extendscripter
    • fabian.moron.zirfas
    • fabianmoronzirfas
    • vogelino