Bye bye spot.js
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export default class Projects {
|
||||
|
||||
constructor(asProjects = {}) {
|
||||
Object.assign(this, asProjects);
|
||||
}
|
||||
|
||||
getDefaultCodeName() {
|
||||
for(const [sCodeName, asProject] of Object.entries(this)) {
|
||||
if(asProject.default) return sCodeName;
|
||||
}
|
||||
}
|
||||
|
||||
getDefaultProject() {
|
||||
const sCodeName = this.getDefaultCodeName();
|
||||
return this[this.getDefaultCodeName()];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user