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

@embracesql/shared

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@embracesql/shared - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

src/parsers/index.ts

10

package.json
{
"name": "@embracesql/shared",
"version": "0.0.2",
"version": "0.0.3",
"description": "EmbraceSQL shared types between browser and node.",

@@ -13,9 +13,7 @@ "type": "module",

"dependencies": {
"change-case": ">=4.0.0",
"change-case": "^5.3.0",
"parsimmon": "^1.18.1",
"uuid": "^9.0.1"
},
"devDependencies": {
"ts-jest": "^29.1.1"
},
"gitHead": "ae6361bd48bb27798c635cdb30e0990d5c90960c"
"gitHead": "ce8c43da83ab6e340d337431a8d18e652a127cbd"
}

15

src/ast.ts

@@ -1,2 +0,2 @@

import { GenerationContext } from ".";
import { GeneratesTypeScriptParser, GenerationContext } from ".";
import { DispatchOperation } from "./index";

@@ -20,2 +20,3 @@ import { camelCase, pascalCase } from "change-case";

IndexColumn,
Type,
}

@@ -78,2 +79,3 @@

[ASTKind.IndexColumn]?: Visitor<IndexColumnNode>;
[ASTKind.Type]?: Visitor<TypeNode>;
};

@@ -185,2 +187,13 @@

/**
* Represents a single type inside of postgres.
*
* These are grouped by schema.
*/
export class TypeNode extends ASTNode {
constructor(schema: SchemaNode, public parser: GeneratesTypeScriptParser) {
super(ASTKind.Type, schema);
}
}
/**
* Collects all tables in a schema in a database.

@@ -187,0 +200,0 @@ */

@@ -5,2 +5,3 @@ import { DatabaseNode, VisitorMap } from "./ast";

export * from "./typescript";
export * from "./parsers";

@@ -100,1 +101,3 @@ /**

export type DispatchOperation = "" | ".create";
export type { GeneratesTypeScriptParser } from "./typescript";

@@ -0,1 +1,2 @@

import { GenerationContext } from ".";
import { ASTNode, Visitor, isNamed } from "./ast";

@@ -49,1 +50,12 @@ import { pascalCase } from "change-case";

};
/**
* Pretty much everything touched with JS/TS ends up as a string.
* And needs to be parsed back from a string to a type.
*
* Implement this interface to generate a function that is a parser from
* string back to a type.
*/
export interface GeneratesTypeScriptParser {
typescriptTypeParser(context: GenerationContext) : string;
}
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