prisma-query-log
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -32,3 +32,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts | ||
function unescapeQuery(query) { | ||
const regex = /`\w+`\.`\w+`(\.`\w+`)?/g; | ||
const regex = /`\w+`(\.`\w+`)?(\.`\w+`)?/g; | ||
const matchAllResult = query.matchAll(regex); | ||
@@ -42,7 +42,10 @@ const matches = Array.from(matchAllResult); | ||
const parts = fullMatch.split("`.`"); | ||
let replacement = ""; | ||
if (parts.length >= 2) { | ||
parts.shift(); | ||
const replacement = parts.join(".").slice(0, -1); | ||
query = query.slice(0, matchIndex) + replacement + query.slice(matchIndex + fullMatch.length); | ||
replacement = parts.join(".").slice(0, -1); | ||
} else { | ||
replacement = parts[0].slice(1, -1); | ||
} | ||
query = query.slice(0, matchIndex) + replacement + query.slice(matchIndex + fullMatch.length); | ||
} | ||
@@ -49,0 +52,0 @@ return query; |
{ | ||
"name": "prisma-query-log", | ||
"version": "1.1.1", | ||
"version": "1.1.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
8032
83