New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jerryquickly/api-plugin-shops

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jerryquickly/api-plugin-shops - npm Package Compare versions

Comparing version 0.0.0-development to 0.0.1-development

.history/package_20200602043028.json

2

package.json
{
"name": "@jerryquickly/api-plugin-shops",
"description": "Shops plugin for the Reaction API",
"version": "0.0.0-development",
"version": "0.0.1-development",
"main": "index.js",

@@ -6,0 +6,0 @@ "type": "module",

@@ -7,6 +7,6 @@ import shops from "./shops.js";

shops,
primaryShop: (context) => {
primaryShop: (context) =>
// return context.collections.Shops.findOne({ shopType: "primary" })
return this.shopByUser(context, true);
},
this.shopByUser(context, true),
async primaryShopId(context) {

@@ -17,4 +17,14 @@ const shop = await this.shopByUser(context);

shopByUser: (context, bDefaultPrimary) => {
const userId = context.userId;
joinedShops: async (context) => {
const { userId } = context;
const accounts = userId ? await context.collections.Accounts.find({ userId }) : [];
const shopIds = accounts.map((shop) => shop.shopId);
if (shopIds.length > 0) {
return context.collections.Shops.find({ _id: { $in: shopIds } });
}
return [];
},
shopByUser: async (context, bDefaultPrimary) => {
const { userId } = context;
const account = userId ? await context.collections.Accounts.findOne({ userId }) : undefined;

@@ -26,4 +36,4 @@ if (account && account.shopId) {

}
return undefined;
return null;
}
};
import primaryShopId from "./primaryShopId.js";
import primaryShop from "./primaryShop.js";
import joinedShops from "./joinedShops.js";
import shop from "./shop.js";

@@ -10,2 +11,3 @@ import shopBySlug from "./shopBySlug.js";

primaryShop,
joinedShops,
shop,

@@ -12,0 +14,0 @@ shopBySlug,

Sorry, the diff of this file is not supported yet

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