@cardsjd/marketplace
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -0,0 +0,0 @@ export {}; |
@@ -0,0 +0,0 @@ const Games = [ |
import MarketPlace from './marketplace'; | ||
export { MarketPlace }; |
/** @typedef {import('./definitions').GameConfig} GameConfig */ | ||
import { getOS } from '@cardsjd/utilities'; | ||
import { Device } from '@cardsjd/device'; | ||
@@ -22,5 +22,5 @@ import Games from './gameConfig'; | ||
/** | ||
* @param {string} newGamesUrl | ||
* @returns {Promise<void>} | ||
*/ | ||
* @param {string} newGamesUrl | ||
* @returns {Promise<void>} | ||
*/ | ||
async fetchUpdatedList(newGamesUrl) { | ||
@@ -41,5 +41,5 @@ try { | ||
/** | ||
* @param {string} osOverride | ||
* @returns {boolean} | ||
*/ | ||
* @param {string} osOverride | ||
* @returns {boolean} | ||
*/ | ||
hasGames(osOverride) { | ||
@@ -50,7 +50,8 @@ return this.getGames(osOverride).length > 0; | ||
/** | ||
* @param {string} [osOverride] | ||
* @returns {GameConfig[]} | ||
*/ | ||
* @param {string} [osOverride] | ||
* @returns {GameConfig[]} | ||
*/ | ||
getGames(osOverride) { | ||
const os = osOverride || getOS(); | ||
const os = osOverride || this.getPlatform(); | ||
if (os === 'windowsPWA') { os = 'windows'; } | ||
const games = this.games.filter(game => { | ||
@@ -63,5 +64,5 @@ return game[os] && game.name !== this.appName; | ||
/** | ||
* @param {string} id | ||
* @returns {Promise<boolean | void>} | ||
*/ | ||
* @param {string} id | ||
* @returns {Promise<boolean | void>} | ||
*/ | ||
async switchGameAsync(id) { | ||
@@ -76,8 +77,9 @@ if (typeof globalThis.FBInstant === 'undefined') { | ||
/** | ||
* @param {string} appName | ||
* @param {string} [osOverride] | ||
* @returns {void} | ||
*/ | ||
* @param {string} appName | ||
* @param {string} [osOverride] | ||
* @returns {void} | ||
*/ | ||
show(appName, osOverride) { | ||
const os = osOverride || getOS(); | ||
const os = osOverride || this.getPlatform(); | ||
if (os === 'windowsPWA') { os = 'windows'; } | ||
const game = this.games.find((game) => { | ||
@@ -98,2 +100,6 @@ return game[os] && game.name === appName; | ||
} | ||
getPlatform() { | ||
const device = new Device(); | ||
return device.getPlatform(); | ||
} | ||
} | ||
@@ -100,0 +106,0 @@ |
{ | ||
"name": "@cardsjd/marketplace", | ||
"private": false, | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"type": "module", | ||
@@ -17,4 +17,4 @@ "main": "lib/index.js", | ||
"peerDependencies": { | ||
"@cardsjd/utilities": "^0.0.0" | ||
"@cardsjd/device": "^0.1.3" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7136
181
2