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

@ginger.io/beyonce

Package Overview
Dependencies
Maintainers
7
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ginger.io/beyonce - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

dist/codegen/generateModelHelpers.d.ts

4

dist/codegen/generateModels.js

@@ -30,2 +30,3 @@ "use strict";

const generateTables_1 = require("./generateTables");
const generateModelHelpers_1 = require("./generateModelHelpers");
function generateModels(yamlData) {

@@ -42,2 +43,3 @@ const config = parseYaml(yamlData);

modelInterfaces.imports.forEach(_ => imports.add(_));
const modelHelpers = generateModelHelpers_1.generateModelHelpers(models);
const code = `

@@ -50,2 +52,4 @@ ${Array.from(imports).join("\n")}

${modelHelpers}
${tables}

@@ -52,0 +56,0 @@ `;

2

package.json
{
"name": "@ginger.io/beyonce",
"version": "0.0.6",
"version": "0.0.7",
"description": "Type-safe DynamoDB query builder for TypeScript. Designed with single-table architecture in mind.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -85,2 +85,3 @@ # Beyonce

Author,
author,
Book,

@@ -103,7 +104,7 @@ ModelType,

```TypeScript
const authorModel: Author = {
// Beyonce generates helper methods to create model objects for you
const authorModel = author({
id: "1",
name: "Jane Austin",
model: ModelType.Author
}
name: "Jane Austin"
})

@@ -110,0 +111,0 @@ await db.put(

@@ -8,2 +8,3 @@ import yaml from "js-yaml"

import { ModelDefinitions, Table } from "./types"
import { generateModelHelpers } from "./generateModelHelpers"

@@ -25,2 +26,4 @@ export function generateModels(yamlData: string): string {

const modelHelpers = generateModelHelpers(models)
const code = `

@@ -33,2 +36,4 @@ ${Array.from(imports).join("\n")}

${modelHelpers}
${tables}

@@ -35,0 +40,0 @@ `

@@ -30,2 +30,9 @@ import { generateModels } from "../../main/codegen/generateModels"

export function author(fields: Omit<Author, "model">): Author {
return {
...fields,
model: ModelType.Author
}
}
export const LibraryTable = {

@@ -87,2 +94,16 @@ name: "Library",

export function author(fields: Omit<Author, "model">): Author {
return {
...fields,
model: ModelType.Author
}
}
export function book(fields: Omit<Book, "model">): Book {
return {
...fields,
model: ModelType.Book
}
}
export const LibraryTable = {

@@ -89,0 +110,0 @@ name: "Library",

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