gateschema-transformer
v0.1.2
Published
transformer for GateSchema
Downloads
65
Readme
gateschema-transformer
A transformer for GateSchema using in gateschema-form-vue and gateschema-form-react
It transforms a gateschema to tree-like json object.
Interface
interface Node {
value: any;
error?: string;
path: string;
schema: GateSchema;
rootData: any;
children: Node[];
constraints: {
required?: boolean;
type?:
| 'boolean'
| 'binary'
| 'number'
| 'string'
| 'list'
| 'map'
| 'enum'
| 'enumList';
length?: number;
maxLength?: number;
minLength?: number;
format?: string;
oneOf?: {
[key: number]: any;
};
option?: {
[key: string]: number;
};
other?: {
form?: {
[key: string]: any;
};
[key: string]: any;
};
};
[key: string]: any;
}
Install
npm install gateschema-transformer --save
API
transform(schema: GateSchema, options: TransformOptions, cb: TransformCallback)
see interface.ts for more details
extend(options: { transformers?: KeywordTransformer[] })
see interface.ts for more details
License
MIT