in app/vidispine/item/VidispineItem.ts [90:112]
constructor(sourceObject: any) {
let bareObject = {
id: sourceObject.hasOwnProperty("id") ? sourceObject.id : undefined,
};
ItemIF.check(bareObject);
this.metadata = sourceObject.metadata;
this.shape = sourceObject.hasOwnProperty("shape")
? sourceObject.shape
.map((s: VidispineShapeIF) => {
try {
return new VidispineShape(s, true);
} catch (e) {
const loggedId = s.id ?? "unknown-id";
console.warn(`Shape ${loggedId} did not validate: `, e);
return null;
}
})
.filter((maybeShape: VidispineShapeIF | null) => maybeShape != null)
: undefined;
this.files = sourceObject.files;
this.id = sourceObject.id;
}