Skip to content
Snippets Groups Projects
Commit c1ffbb4c authored by chris's avatar chris
Browse files

add file

parent f66fcf8f
No related branches found
No related tags found
1 merge request!5Develop
import { Schema } from "prosemirror-model";
class createSchema {
constructor(schema) {
if (!schema) {
throw new Error("schema is mandatory");
}
const { nodes, marks } = schema;
if (!nodes || !marks) {
throw new Error("no nodes or marks found");
}
this.nodes = nodes;
this.marks = marks;
return this.initSchema();
}
initSchema() {
return new Schema(this.toJSON());
}
toJSON() {
return {
nodes: this.nodes,
marks: this.marks
};
}
setDefaultSchema() {}
}
export default createSchema;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment