Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
restaurant-manager-alesscuderi
Advanced tools
This package contains the functions that manage a restaurant app and its users. It allows add and delete orders, shows orders by their statuses and changes them. In addition, it allows the user to see the restaurant profits and shows orders by user ## ins
This package contains the functions that manage a restaurant app and its users. It allows add and delete orders, shows orders by their statuses and changes them. In addition, it allows the user to see the restaurant profits and shows orders by user
npm install restaurantManager-alesscuderi --save
The filtering process has made much more simple and lightweight, as well as the set status process. The functions now don't involve any extra json.
Places orders in different JSONs according to their status.
`if (s === "ready") { var ready = []; for (var index in orders) { if (orders[index].status == "ready") { ready.push(orders[index]) } } return ready;
} else if (s === "closed") { var closed = []; for (var index in orders) { if (orders[index].status == "closed") { closed.push(orders[index]) } } return closed;
} else if (s === "new") { var news = []; for (var index in orders) { if (orders[index].status == "new") { news.push(orders[index]) } } return news; } }`
Shows all orders
var showOrders = function () { return orders; }
Adds an order
var addOrder = function (newOrder) { orders.push({ id: ordersCounter++, order: newOrder.order, token: newOrder.token, bill: newOrder.bill, status: "new" }); }
deletes an order
var deleteOrder = function (id) { for (var index in orders) { if (orders[index].id == id) { orders.splice(index, 1) } } }
sets an order as ready
var setOrderReady = function (id) { for (var index in orders) { if (orders[index].id == id) { orders[index].status = "ready"; console.log("the order " + id + "is now set as ready:"); return orders[index]; } } return null; }
sets an order as closed
var setOrderClosed = function (id) { for (var index in orders) { if (orders[index].id == id) { orders[index].status = "closed"; console.log("the order " + id + "is now set as closed:"); return orders[index]; } } return null; }
shows the total income
var showProfit = function () { var temp = 0; for (var index in orders) { var profit = orders[index].bill + temp; temp = orders[index].bill } return profit; }
shows the orders of a given user.
var showByUser = function (id) { var clientOrders = [] for (var index in orders) { if (orders[index].token == id) { clientOrders.push( { id: orders[index].id, order: orders[index].order, token: orders[index].token, bill: orders[index].bill, status: orders[index].status } ) } } return clientOrders }
shows the orders at a given id.
var showSingleOrder = function (id) { for (var index in orders) { if (orders[index].id == id) { return orders[index]; } } return null; }
FAQs
This package contains the functions that manage a restaurant app and its users. It allows add and delete orders, shows orders by their statuses and changes them. In addition, it allows the user to see the restaurant profits and shows orders by user ## ins
We found that restaurant-manager-alesscuderi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.