Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cardsjd/marketplace

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cardsjd/marketplace - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

0

lib/definitions.js

@@ -0,0 +0,0 @@ export {};

@@ -0,0 +0,0 @@ const Games = [

import MarketPlace from './marketplace';
export { MarketPlace };

44

lib/marketplace.js
/** @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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc