make genres private

This commit is contained in:
Andrzej Stepien 2023-09-27 11:44:44 +02:00
parent f5f7f21ae6
commit 26d8dd1ec3
2 changed files with 6 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import Entity from "./Entity.mjs";
import dataValidation from "./dataValidation.mjs";
//THIS CLASS WILL HANDLE JUNCTION TABLE STUFF
export default class Title extends Entity{
#genres
set _title(prop){
if(prop){
if(!dataValidation.isString(prop)){throw new TypeError("title must be a string")}
@ -10,8 +11,8 @@ export default class Title extends Entity{
}
set _genres(prop){
if(prop){
//if(!dataValidation.isObject(prop)){throw new TypeError("genres must be an object")}
this.genres=prop
if(!dataValidation.isObject(prop)){throw new TypeError(`genres must be an object; this is a ${typeof prop}`)}
this.#genres=prop
}
}
set _deleted(prop){
@ -21,6 +22,9 @@ export default class Title extends Entity{
}
}
}
get genres(){
return this.#genres
}
constructor(data){
super(data)

Binary file not shown.