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

prisma-query-log

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-query-log - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

29

index.js

@@ -27,8 +27,9 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __assign = Object.assign;

}
const {unescape, colorQuery, format} = options;
const {unescape, format} = options;
const formatterOptions = __assign(__assign({}, options.formatterOptions), customFormatterOptions);
const colorQuery = format ? false : options.colorQuery;
const colorParameter = (_c = options.colorParameter) != null ? _c : colorQuery;
return function prismaQueryLog(event) {
const eventParams = event.params.replace(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ UTC/g, (date) => `"${date}"`);
let params = JSON.parse(eventParams);
const params = JSON.parse(eventParams);
let query = event.query;

@@ -38,2 +39,9 @@ if (unescape) {

}
query = query.replace(/\?/g, () => {
let parameter = JSON.stringify(params.shift());
if (colorQuery && colorParameter) {
parameter = colorParameter + parameter + "" + colorQuery;
}
return parameter;
});
if (format) {

@@ -43,16 +51,7 @@ if (!formatter) {

}
params = params.map((p) => JSON.stringify(p));
query = "\n" + formatter.format(query, __assign(__assign({}, formatterOptions), {params})).trim();
} else {
query = query.replace(/\?/g, () => {
let parameter = JSON.stringify(params.shift());
if (colorQuery && colorParameter) {
parameter = colorParameter + parameter + "" + colorQuery;
}
return parameter;
});
if (colorQuery && colorParameter) {
query = colorQuery + query + "";
}
query = "\n" + formatter.format(query, formatterOptions).trim();
}
if (colorQuery && colorParameter) {
query = colorQuery + query + "";
}
logger(query);

@@ -59,0 +58,0 @@ };

{
"name": "prisma-query-log",
"version": "2.0.1",
"version": "2.0.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Log prisma query event",

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