Struktur konfigurasi mock lokal inventaris permainan svip8.
{ } catalog-config.js{ } catalog-config.json
Salin kode
JavaScript
// Konfigurasi objek lokal katalog svip8
const svip8LocalCatalog = {
platform: "svip8" ,
domain: "svip8games.com" ,
catalog: [
{ id: "010" , name: "Medusa" , category: "Permainan Slot" , active: true },
{ id: "053" , name: "Fortune Mouse" , category: "Permainan Slot" , active: true },
{ id: "172" , name: "Doomsday Rampg" , category: "Permainan Aksi" , active: true }
],
checkGameStatus: function (gameId) {
const game = this.catalog.find(item => item.id === gameId);
return game ? game.active : false ;
}
};
console.log(svip8LocalCatalog.checkGameStatus("010" )); JSON
{
"platform" : "svip8" ,
"domain" : "svip8games.com" ,
"catalog" : [
{
"id" : "010" ,
"name" : "Medusa" ,
"category" : "Permainan Slot" ,
"active" : true
},
{
"id" : "053" ,
"name" : "Fortune Mouse" ,
"category" : "Permainan Slot" ,
"active" : true
},
{
"id" : "172" ,
"name" : "Doomsday Rampg" ,
"category" : "Permainan Aksi" ,
"active" : true
}
]
}