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

products-administrator

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

products-administrator - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

20

index.js

@@ -46,8 +46,12 @@ var products = [

this.getIndexById = function (id){
for (var index in products){
var product = products[index];
if(product.id == id){
return index;
if (isNaN(id)){
return "error";
} else {
for (var index in products){
var product = products[index];
if(product.id == id){
return index;
}
}
}
}
return null;

@@ -65,3 +69,3 @@ }

exports.selectProduct = function (id){
if (this.getIndexById(id) != null){
if (this.getIndexById(id) != null && this.getIndexById(id) != "error"){
var product = products[this.getIndexById(id)];

@@ -71,3 +75,5 @@ if(product.id == id){

}
} else {
} else if (this.getIndexById(id) == "error"){
return "error";
} else {
return null;

@@ -74,0 +80,0 @@ }

{
"name": "products-administrator",
"version": "1.0.5",
"version": "1.0.6",
"description": "\"a fake products administrator for e-commerce\"",

@@ -5,0 +5,0 @@ "main": "index.js",

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