property mapping validation #48
This commit is contained in:
parent
3e79f8ad77
commit
68ec5135cc
6 changed files with 146 additions and 23 deletions
|
|
@ -16,15 +16,23 @@ export class PropertyMapper {
|
|||
* @param obj
|
||||
*/
|
||||
convertObject(obj: object): object {
|
||||
console.log('test1');
|
||||
|
||||
if (!obj.hasOwnProperty('type')) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
console.log('test2');
|
||||
// @ts-ignore
|
||||
if (MEDIA_TYPES.contains(obj.type)) {
|
||||
console.log(obj.type);
|
||||
|
||||
// @ts-ignore
|
||||
if (MEDIA_TYPES.filter(x => x.toString() == obj.type).length < 1) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
console.log('test3');
|
||||
|
||||
// @ts-ignore
|
||||
const propertyMappings = this.plugin.settings.propertyMappingModels.find(x => x.type === obj.type).properties;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue