0.0.34 • Published 3 months ago

@coli.codes/schema v0.0.34

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

A progomatic Schema designer

This lib enables programmers to develop app that requires data schema declaration from user.

It follows JSON Schema standard & It's pojo typings with extra pre-defined real-world type declarations - for example, text and image

This is a package to extend coli programatically. You might experience some "why does it not work like others?" moments.

Usage

// new schema factory for ease of use

// plain JsonObj as nested type
interface LatLng {
    lat: number
    lng: number
}

// some custom built reusable type definition
const ThisOrThat = new SchemaFactory({} | {});

const myReactPropsSchemaFactory = new SchemaFactory({
    name: string,
    location: LatLng
});

// retrieve extract JSON formatted schema definition
const def = myReactPropsSchemaFactory.definition;

// validating input data
const __someDynamicInputData = { ... }
const isInputDataValid = myReactPropsSchemaFactory.validate(__someDynamicInputData)

Create factory from other sources

// input a example data (json)
SchemaFactory.fromExample();

// input a schema definition string (schema json)
SchemaFactory.fromDefinition();

Used by

References

IDK (Developer's Idea note - something experimental)

0.0.34

3 months ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.14

2 years ago