This commit is contained in:
Benjamin Toby 2026-02-21 03:22:24 +01:00
parent ac489ce443
commit 3d4ee58d01
3 changed files with 7 additions and 7 deletions

View File

@ -22,14 +22,13 @@ function generateTypeDefinition({ paradigm, table, query, typeDefName, allValues
return schemaType.options return schemaType.options
.map((opt) => { .map((opt) => {
var _a; var _a;
return ((_a = schemaType.dataType) === null || _a === void 0 ? void 0 : _a.match(/int/i)) || return ((_a = schemaType.dataType) === null || _a === void 0 ? void 0 : _a.match(/int|double|decimal|float/i)) || typeof opt == "number"
typeof opt == "number"
? `${opt}` ? `${opt}`
: `"${opt}"`; : `"${opt}"`;
}) })
.join(" | "); .join(" | ");
} }
if ((_a = schemaType.dataType) === null || _a === void 0 ? void 0 : _a.match(/int|double|decimal/i)) { if ((_a = schemaType.dataType) === null || _a === void 0 ? void 0 : _a.match(/int|double|decimal|float/i)) {
return "number"; return "number";
} }
if ((_b = schemaType.dataType) === null || _b === void 0 ? void 0 : _b.match(/text|varchar|timestamp/i)) { if ((_b = schemaType.dataType) === null || _b === void 0 ? void 0 : _b.match(/text|varchar|timestamp/i)) {

View File

@ -40,15 +40,16 @@ export default function generateTypeDefinition({
if (schemaType.options && schemaType.options.length > 0) { if (schemaType.options && schemaType.options.length > 0) {
return schemaType.options return schemaType.options
.map((opt) => .map((opt) =>
schemaType.dataType?.match(/int/i) || schemaType.dataType?.match(
typeof opt == "number" /int|double|decimal|float/i,
) || typeof opt == "number"
? `${opt}` ? `${opt}`
: `"${opt}"`, : `"${opt}"`,
) )
.join(" | "); .join(" | ");
} }
if (schemaType.dataType?.match(/int|double|decimal/i)) { if (schemaType.dataType?.match(/int|double|decimal|float/i)) {
return "number"; return "number";
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@moduletrace/datasquirel", "name": "@moduletrace/datasquirel",
"version": "5.7.53", "version": "5.7.54",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {