Improved handling of poorly migrated archive creatures
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties.js';
|
||||
import cleanAt1 from '/imports/migrations/server/dbv1/cleanAt1.js';
|
||||
|
||||
/* eslint no-fallthrough: "off" -- Using switch fallthrough to run all
|
||||
migration steps after the current version of the file. */
|
||||
@@ -17,17 +17,3 @@ function migrateLegacyArchive(archive){
|
||||
// TODO:
|
||||
throw 'Not implemented';
|
||||
}
|
||||
|
||||
function cleanAt1(archive){
|
||||
archive.properties.map(prop => {
|
||||
const schema = CreatureProperties.simpleSchema(prop);
|
||||
const cleanProp = schema.clean(prop);
|
||||
try {
|
||||
schema.validate(cleanProp);
|
||||
} catch (e){
|
||||
console.warn('Prop did not pass schema validation');
|
||||
console.warn(e);
|
||||
}
|
||||
return cleanProp;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user