0.0.34 • Published 1 year ago

@coli.codes/schema v0.0.34

Weekly downloads
-
License
-
Repository
-
Last release
1 year 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

1 year ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.29

3 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.14

3 years ago