Commit 93d57740 authored by nanahira's avatar nanahira

catchup

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