@ginger.io/beyonce
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -6,10 +6,10 @@ "use strict"; | ||
const imports = []; | ||
models.forEach(m => { | ||
models.forEach((m) => { | ||
const generatedInterface = generateModelInterface(m); | ||
code.push(generatedInterface.code); | ||
generatedInterface.imports.forEach(_ => imports.push(_)); | ||
generatedInterface.imports.forEach((_) => imports.push(_)); | ||
}); | ||
return { | ||
code, | ||
imports | ||
imports, | ||
}; | ||
@@ -24,6 +24,6 @@ } | ||
fields.push(generatedField.code); | ||
generatedField.imports.forEach(_ => imports.push(_)); | ||
generatedField.imports.forEach((_) => imports.push(_)); | ||
}); | ||
const code = ` | ||
export interface ${model.name} extends Model { | ||
export interface ${model.name} { | ||
model: ModelType.${model.name} | ||
@@ -40,3 +40,3 @@ ${fields.join("\n")} | ||
code: `${name}: ${existingTypeName}`, | ||
imports: [`import { ${existingTypeName} } from "${packageName}"`] | ||
imports: [`import { ${existingTypeName} } from "${packageName}"`], | ||
}; | ||
@@ -43,0 +43,0 @@ } |
{ | ||
"name": "@ginger.io/beyonce", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Type-safe DynamoDB query builder for TypeScript. Designed with single-table architecture in mind.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -9,6 +9,6 @@ import { Model } from "./types" | ||
models.forEach(m => { | ||
models.forEach((m) => { | ||
const generatedInterface = generateModelInterface(m) | ||
code.push(generatedInterface.code) | ||
generatedInterface.imports.forEach(_ => imports.push(_)) | ||
generatedInterface.imports.forEach((_) => imports.push(_)) | ||
}) | ||
@@ -18,3 +18,3 @@ | ||
code, | ||
imports | ||
imports, | ||
} | ||
@@ -32,7 +32,7 @@ } | ||
fields.push(generatedField.code) | ||
generatedField.imports.forEach(_ => imports.push(_)) | ||
generatedField.imports.forEach((_) => imports.push(_)) | ||
}) | ||
const code = ` | ||
export interface ${model.name} extends Model { | ||
export interface ${model.name} { | ||
model: ModelType.${model.name} | ||
@@ -54,3 +54,3 @@ ${fields.join("\n")} | ||
code: `${name}: ${existingTypeName}`, | ||
imports: [`import { ${existingTypeName} } from "${packageName}"`] | ||
imports: [`import { ${existingTypeName} } from "${packageName}"`], | ||
} | ||
@@ -57,0 +57,0 @@ } else { |
import { generateModels } from "../../main/codegen/generateModels" | ||
const authorInterface = `export interface Author extends Model { | ||
const authorInterface = `export interface Author { | ||
model: ModelType.Author | ||
@@ -9,3 +9,3 @@ id: string | ||
const bookInterface = `export interface Book extends Model { | ||
const bookInterface = `export interface Book { | ||
model: ModelType.Book | ||
@@ -12,0 +12,0 @@ id: string |
@@ -6,3 +6,2 @@ import { JayZ } from "@ginger.io/jay-z" | ||
import { key } from "../../main/dynamo/Key" | ||
import { Model } from "../../main/dynamo/Model" | ||
import { JayZConfig } from "../../main/dynamo/JayZConfig" | ||
@@ -22,3 +21,3 @@ | ||
export interface Musician extends Model { | ||
export interface Musician { | ||
readonly model: ModelType.MUSICIAN | ||
@@ -29,3 +28,3 @@ readonly id: string | ||
export interface Song extends Model { | ||
export interface Song { | ||
readonly model: ModelType.SONG | ||
@@ -32,0 +31,0 @@ readonly musicianId: string |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114006
2236