Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kysely-kit

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kysely-kit - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

19

build/commands/generate-types/generate-overrides.js

@@ -6,8 +6,19 @@ import camelcase from 'camelcase';

const [tableName, columnName] = column.split('.');
sourceFile
.getInterfaceOrThrow(camelcase(`${tableName}Table`, { pascalCase: true }))
.getPropertyOrThrow(camelcase(columnName))
.setType(type);
if (tableName === '*') {
sourceFile.getInterfaces().forEach((interface_) => {
interface_.getProperties().forEach((property) => {
if (property.getName() === camelcase(columnName)) {
property.setType(type);
}
});
});
}
else {
sourceFile
.getInterfaceOrThrow(camelcase(`${tableName}Table`, { pascalCase: true }))
.getPropertyOrThrow(camelcase(columnName))
.setType(type);
}
});
}
}

@@ -13,18 +13,10 @@ import camelcase from 'camelcase';

let type = mapDataType(isArray ? column.dataType.slice(1) : column.dataType);
if (name === 'createdAt' && type === 'Date' && column.hasDefaultValue) {
type = 'GeneratedAlways<Date>';
if (isArray) {
type = `${type}[]`;
}
else if (name === 'updatedAt' && type === 'Date' && column.isNullable) {
type = 'ColumnType<Date | null, never, Date>';
if (column.isAutoIncrementing) {
type = `GeneratedAlways<${type}>`;
}
else {
if (isArray) {
type = `${type}[]`;
}
if (column.isAutoIncrementing) {
type = `GeneratedAlways<${type}>`;
}
if (column.isNullable) {
type = `${type} | null`;
}
if (column.isNullable) {
type = `${type} | null`;
}

@@ -31,0 +23,0 @@ return {

{
"name": "kysely-kit",
"description": "Useful utilities for working with Kysely",
"version": "0.5.1",
"version": "0.6.0",
"author": "Vlad Shcherbin <vlad.shcherbin@gmail.com>",

@@ -21,4 +21,4 @@ "repository": "vladshcherbin/kysely-kit",

"sade": "^1.8.1",
"ts-morph": "^21.0.1",
"valibot": "^0.29.0"
"ts-morph": "^22.0.0",
"valibot": "^0.30.0"
},

@@ -30,11 +30,11 @@ "peerDependencies": {

"devDependencies": {
"@shcherbin/eslint-config-node-typescript": "^0.1.1",
"@tsconfig/node20": "^20.1.2",
"@types/node": "^20.11.24",
"@types/pg": "^8.11.2",
"@shcherbin/eslint-config-node-typescript": "^0.2.0",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^20.12.7",
"@types/pg": "^8.11.5",
"eslint": "^8.57.0",
"kysely": "^0.27.2",
"pg": "^8.11.3",
"tsx": "^4.7.1",
"typescript": "^5.3.3"
"kysely": "^0.27.3",
"pg": "^8.11.5",
"tsx": "^4.7.2",
"typescript": "^5.4.5"
},

@@ -41,0 +41,0 @@ "files": [

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