New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@balena/abstract-sql-to-typescript

Package Overview
Dependencies
Maintainers
3
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@balena/abstract-sql-to-typescript - npm Package Compare versions

Comparing version 4.0.3 to 4.0.4-build-no-writable-fields-573c4da6d9e4521f700e7f38a033640ef8afe533-1

6

CHANGELOG.md

@@ -7,4 +7,8 @@ # Change Log

## 4.0.3 - 2024-09-06
## 4.0.4 - 2024-09-12
* Correctly use `Record<string, never>` when there are no writable fields [Pagan Gazzard]
## 4.0.3 - 2024-09-08
* Fix accidentally omitting `Read` types for computed fields [Pagan Gazzard]

@@ -11,0 +15,0 @@

7

out/generate.js

@@ -119,7 +119,10 @@ "use strict";

const tableToInterface = (m, table) => {
const writeType = table.definition != null
const writableFields = table.definition != null
? []
: fieldsToInterfaceProps(m, table.fields, 'Write');
const writeType = writableFields.length === 0
?
'Record<string, never>'
: `{
${[...fieldsToInterfaceProps(m, table.fields, 'Write')].join('\n\t\t')}
${writableFields.join('\n\t\t')}
}`;

@@ -126,0 +129,0 @@ return trimNL `

{
"name": "@balena/abstract-sql-to-typescript",
"version": "4.0.3",
"version": "4.0.4-build-no-writable-fields-573c4da6d9e4521f700e7f38a033640ef8afe533-1",
"description": "A translator for abstract sql into typescript types.",

@@ -56,4 +56,4 @@ "main": "out/index.js",

"versionist": {
"publishedAt": "2024-09-06T15:36:03.898Z"
"publishedAt": "2024-09-12T16:01:33.498Z"
}
}

@@ -213,8 +213,12 @@ import type {

const tableToInterface = (m: RequiredModelSubset, table: AbstractSqlTable) => {
const writableFields =
table.definition != null
? []
: fieldsToInterfaceProps(m, table.fields, 'Write');
const writeType =
table.definition != null
writableFields.length === 0
? // If there's a table definition then we cannot write anything
'Record<string, never>'
: `{
${[...fieldsToInterfaceProps(m, table.fields, 'Write')].join('\n\t\t')}
${writableFields.join('\n\t\t')}
}`;

@@ -221,0 +225,0 @@ return trimNL`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc