prisma-query-log
Advanced tools
Comparing version 3.0.1 to 3.0.2
34
index.js
@@ -1,7 +0,7 @@ | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value; | ||
var __objSpread = (a, b) => { | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
@@ -17,3 +17,14 @@ if (__hasOwnProp.call(b, prop)) | ||
}; | ||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); | ||
var __export = (target, all) => { | ||
__markAsModule(target); | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
// src/index.ts | ||
__export(exports, { | ||
createPrismaQueryEventHandler: () => createPrismaQueryEventHandler | ||
}); | ||
// src/options.ts | ||
@@ -36,3 +47,3 @@ var defaultOptions = { | ||
var _a; | ||
const options = __objSpread(__objSpread({}, defaultOptions), args); | ||
const options = __spreadValues(__spreadValues({}, defaultOptions), args); | ||
const logger = options.logger === true ? console.log : options.logger; | ||
@@ -42,7 +53,7 @@ if (typeof logger !== "function") { | ||
} | ||
const {unescape, format} = options; | ||
const { unescape, format } = options; | ||
const colorQuery = format ? false : options.colorQuery; | ||
const colorParameter = (_a = options.colorParameter) != null ? _a : 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}"`); | ||
const eventParams = event.params.replace(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.?\d* UTC/g, (date) => `"${date}"`); | ||
const params = JSON.parse(eventParams); | ||
@@ -78,3 +89,3 @@ let query = event.query; | ||
for (let index = matches.length - 1; index >= 0; index--) { | ||
const {0: fullMatch, index: matchIndex} = matches[index]; | ||
const { 0: fullMatch, index: matchIndex } = matches[index]; | ||
if (!matchIndex || !fullMatch) { | ||
@@ -95,4 +106,5 @@ continue; | ||
} | ||
exports.createPrismaQueryEventHandler = createPrismaQueryEventHandler; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
createPrismaQueryEventHandler | ||
}); |
{ | ||
"name": "prisma-query-log", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Log prisma query event", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11489
157