Skip to content

Commit

Permalink
added check for debug functions to luacheckgenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonaasan committed Sep 27, 2024
1 parent 257d08c commit a8e5494
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Prisma/prisma/debug/luacheckgenerator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ string.prisma.debug = string.prisma.debug or {};
string.prisma.debug.luacheckgenerator = {};

function string.prisma.debug.luacheckgenerator.luaCheckGlobalsTable(node)
if not string.prisma.debug.enabled then
return;
end;

local resultTable = {}

if type(node) == "table" then
Expand All @@ -21,6 +25,10 @@ function string.prisma.debug.luacheckgenerator.luaCheckGlobalsTable(node)
end

function string.prisma.debug.luacheckgenerator.customEncode(value)
if not string.prisma.debug.enabled then
return;
end;

if type(value) == "table" then
local elements = {}
for k, v in pairs(value) do
Expand All @@ -38,6 +46,10 @@ function string.prisma.debug.luacheckgenerator.customEncode(value)
end

function string.prisma.debug.luacheckgenerator.cleanUp(input)
if not string.prisma.debug.enabled then
return;
end;

local output = input:gsub(':', ' =')
output = output:gsub(' fields = {}', '')
output = output:gsub('{"', '{ ')
Expand Down

0 comments on commit a8e5494

Please sign in to comment.