Mẫu cấu hình đối tượng danh mục trò chơi phục vụ rà soát dữ liệu nội bộ.
JavaScript
// Cấu hình tham chiếu danh mục trò chơi cục bộ g88
const localGameCatalog = {
platform: "g88",
country: "vn",
games: [
{ id: "118", name: "Lucky Piggy", category: "Slot game" },
{ id: "060", name: "Mahjong Ways2", category: "Slot game" },
{ id: "154", name: "Mystic Potions", category: "Slot game" },
{ id: "134", name: "Myst Spirits", category: "Slot game" },
{ id: "050", name: "Mahjong Ways", category: "Slot game" }
]
};
function validateGameList(catalog) {
if (!catalog || !Array.isArray(catalog.games)) {
return { status: "error", count: 0 };
}
return {
status: "success",
count: catalog.games.length,
platform: catalog.platform
};
}
const validationResult = validateGameList(localGameCatalog);
// Kết quả kiểm tra dữ liệu nội bộ
JSON
{
"platform": "g88",
"country": "vn",
"target_audience": "18+",
"supported_games": [
{"id": "118", "name": "Lucky Piggy", "category": "Slot game"},
{"id": "060", "name": "Mahjong Ways2", "category": "Slot game"},
{"id": "154", "name": "Mystic Potions", "category": "Slot game"},
{"id": "134", "name": "Myst Spirits", "category": "Slot game"},
{"id": "050", "name": "Mahjong Ways", "category": "Slot game"}
]
}