Commit 07284b20 authored by nanahira's avatar nanahira

Merge branch 'master' into feat-backref

parents f4e8bd77 93d57740
......@@ -29,7 +29,7 @@
"typescript": "^4.5.2"
},
"peerDependencies": {
"schemastery": "^3.0.0"
"schemastery": "^3.1.0"
}
},
"node_modules/@babel/code-frame": {
......@@ -4545,9 +4545,9 @@
}
},
"node_modules/schemastery": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.0.0.tgz",
"integrity": "sha512-0aWxVyVoa5XMxfsFqHdyj2QZCiUgImzcsCEdseALm57JlmBktu92EvTXm1AebD21q/fcSi+M7BGclDQyfMjQzg==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.0.tgz",
"integrity": "sha512-I1KaYmKfB+buINqBXydV8bC7N+BaC8y/V+609oSJNDO3mP3DY0zoNcDCIaY95KR0a5Cr9+CxgKl5BLEgFoikzw==",
"peer": true
},
"node_modules/semver": {
......@@ -8711,9 +8711,9 @@
}
},
"schemastery": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.0.0.tgz",
"integrity": "sha512-0aWxVyVoa5XMxfsFqHdyj2QZCiUgImzcsCEdseALm57JlmBktu92EvTXm1AebD21q/fcSi+M7BGclDQyfMjQzg==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.0.tgz",
"integrity": "sha512-I1KaYmKfB+buINqBXydV8bC7N+BaC8y/V+609oSJNDO3mP3DY0zoNcDCIaY95KR0a5Cr9+CxgKl5BLEgFoikzw==",
"peer": true
},
"semver": {
......
......@@ -59,6 +59,6 @@
"testEnvironment": "node"
},
"peerDependencies": {
"schemastery": "^3.0.0"
"schemastery": "^3.1.0"
}
}
......@@ -168,11 +168,12 @@ const schemaFields: (keyof Schema)[] = [
'callback',
'value',
'meta',
'uid',
'refs',
];
const schemaFunctions: (keyof Schema)[] = [
'toJSON',
'toBSON',
'required',
'hidden',
'role',
......@@ -183,6 +184,8 @@ const schemaFunctions: (keyof Schema)[] = [
'max',
'min',
'step',
'set',
'push',
];
function applySchemaForClass<T>(
......
......@@ -31,9 +31,7 @@ describe('Schema registration', () => {
it('should be serializable', () => {
const schema = Config as Schema<Config>;
const plainObject: Partial<Schema<Config>> = JSON.parse(
JSON.stringify(schema),
);
const plainObject = new Schema(schema.toJSON());
expect(plainObject.type).toBe('object');
expect(plainObject.dict.foo.type).toBe('string');
});
......
Markdown is supported
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