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

memserver

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memserver - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

26

dist/pretender-hacks.js

@@ -50,23 +50,19 @@ "use strict";

function tryConvertingJSONStringToObject(string) {
let object;
try {
object = JSON.parse(string);
let object = JSON.parse(string);
if (typeof object === "object" && object !== null) {
return object;
}
}
catch (e) {
return false;
catch (error) {
}
if (typeof object === "object" && object !== null) {
return object;
}
return false;
}
function tryConvertingQueryStringToObject(queryString) {
let result = {};
let entries = new URLSearchParams(queryString);
for (const [key, value] of entries) { // each 'entry' is a [queryParamKey, queryParamValue] tupple
result[key] = value;
let entries = Array.from(new URLSearchParams(queryString));
if (entries.length > 0) {
return entries.reduce((result, entry) => {
result[entry[0]] = entry[1];
return result;
}, {});
}
if (Object.keys(result).length > 0) {
return result;
}
}

@@ -73,0 +69,0 @@ function nilifyStrings(value) {

{
"name": "memserver",
"version": "2.3.0",
"version": "2.3.1",
"description": "in-memory database/ORM and http mock server you can run in-browser and node environments. Built for large frontend teams, fast tests and rapid prototyping",

@@ -5,0 +5,0 @@ "author": "Izel Nakri",

@@ -52,25 +52,21 @@ import chalk from "ansi-colors";

function tryConvertingJSONStringToObject(string) {
let object;
try {
object = JSON.parse(string);
} catch (e) {
return false;
}
let object = JSON.parse(string);
if (typeof object === "object" && object !== null) {
return object;
if (typeof object === "object" && object !== null) {
return object;
}
} catch(error) {
}
return false;
}
function tryConvertingQueryStringToObject(queryString) {
let result = {};
let entries = new URLSearchParams(queryString);
for (const [key, value] of entries) { // each 'entry' is a [queryParamKey, queryParamValue] tupple
result[key] = value;
}
let entries = Array.from(new URLSearchParams(queryString));
if (Object.keys(result).length > 0) {
return result;
if (entries.length > 0) {
return entries.reduce((result, entry) => {
result[entry[0]] = entry[1];
return result;
}, {});
}

@@ -77,0 +73,0 @@ }

Sorry, the diff of this file is too big to display

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