@ronin/compiler
Advanced tools
+10
-3
@@ -1670,5 +1670,8 @@ // src/utils/helpers.ts | ||
| const query = this.queries.at(-index); | ||
| const fields = this.fields.at(-index); | ||
| const rawModelFields = this.fields.at(-index); | ||
| const { queryType, queryModel, queryInstructions } = splitQuery(query); | ||
| const model = getModelBySlug(this.models, queryModel); | ||
| const modelFields = Object.fromEntries( | ||
| model.fields.map((field) => [field.slug, field.type]) | ||
| ); | ||
| if (queryType === "count") { | ||
@@ -1679,7 +1682,11 @@ return { amount: rows[0][0] }; | ||
| if (single) { | ||
| return { record: rows[0] ? this.formatRows(fields, rows, single) : null }; | ||
| return { | ||
| record: rows[0] ? this.formatRows(rawModelFields, rows, single) : null, | ||
| modelFields | ||
| }; | ||
| } | ||
| const pageSize = queryInstructions?.limitedTo; | ||
| const output = { | ||
| records: this.formatRows(fields, rows, single) | ||
| records: this.formatRows(rawModelFields, rows, single), | ||
| modelFields | ||
| }; | ||
@@ -1686,0 +1693,0 @@ if (pageSize && output.records.length > 0) { |
+1
-1
| { | ||
| "name": "@ronin/compiler", | ||
| "version": "0.11.6", | ||
| "version": "0.11.7", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Compiles RONIN queries to SQL statements.", |
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
462955
0.08%7803
0.12%