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

domain-knex

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domain-knex - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

30

lib/index.js

@@ -47,3 +47,3 @@ "use strict";

var domainSchema = new domain_schema_1.default(schema);
var tableName = humps_1.decamelize(domainSchema.name);
var tableName = humps_1.decamelize(domainSchema.__.name);
var parentPath = [];

@@ -67,3 +67,3 @@ var selectItems = [];

if (domainSchema.__.transient) {
throw new Error("Unable to create tables for transient schema: " + domainSchema.name);
throw new Error("Unable to create tables for transient schema: " + domainSchema.__.name);
}

@@ -100,3 +100,3 @@ return this._createTables(null, domainSchema, []);

else {
throw new Error("Don't know how to handle type " + type.name + " of " + tableName + "." + columnName);
throw new Error("Don't know how to handle type " + type.__.name + " of " + tableName + "." + columnName);
}

@@ -118,8 +118,8 @@ if (value.unique) {

return __generator(this, function (_a) {
if (seen.indexOf(schema.name) >= 0) {
if (seen.indexOf(schema.__.name) >= 0) {
return [2, Promise.resolve(null)];
}
seen.push(schema.name);
seen.push(schema.__.name);
domainSchema = new domain_schema_1.default(schema);
tableName = humps_1.decamelize(domainSchema.name);
tableName = humps_1.decamelize(domainSchema.__.name);
return [2, this.knex.schema.createTable(tableName, function (table) {

@@ -147,7 +147,7 @@ if (parentTableName) {

promises.push(newPromise);
debug("Schema key: " + tableName + "." + column + " -> " + type.name);
debug("Schema key: " + tableName + "." + column + " -> " + type.__.name);
}
else if (!value.transient && key !== 'id') {
DomainKnex._addColumn(tableName, table, key, value);
debug("Scalar key: " + tableName + "." + column + " -> " + type.name);
debug("Scalar key: " + tableName + "." + column + " -> " + type.__.name);
}

@@ -161,7 +161,7 @@ }

DomainKnex.prototype._getTableNames = function (domainSchema, seen) {
if (seen.indexOf(domainSchema.name) >= 0) {
if (seen.indexOf(domainSchema.__.name) >= 0) {
return [];
}
seen.push(domainSchema.name);
var tableName = humps_1.decamelize(domainSchema.name);
seen.push(domainSchema.__.name);
var tableName = humps_1.decamelize(domainSchema.__.name);
var tableNames = [];

@@ -182,6 +182,6 @@ if (domainSchema.__.transient) {

DomainKnex.prototype._getSelectFields = function (fields, parentPath, domainSchema, selectItems, joinNames, seen) {
if (seen.indexOf(domainSchema.name) >= 0) {
if (seen.indexOf(domainSchema.__.name) >= 0) {
return;
}
seen.push(domainSchema.name);
seen.push(domainSchema.__.name);
for (var _i = 0, _a = Object.keys(fields); _i < _a.length; _i++) {

@@ -194,3 +194,3 @@ var key = _a[_i];

var as = parentPath.length > 0 ? parentPath.join('_') + "_" + key : key;
selectItems.push(humps_1.decamelize(domainSchema.name) + "." + humps_1.decamelize(key) + " as " + as);
selectItems.push(humps_1.decamelize(domainSchema.__.name) + "." + humps_1.decamelize(key) + " as " + as);
}

@@ -201,3 +201,3 @@ }

if (!type.__.transient) {
joinNames.push(humps_1.decamelize(type.name));
joinNames.push(humps_1.decamelize(type.__.name));
}

@@ -204,0 +204,0 @@ parentPath.push(key);

{
"name": "domain-knex",
"version": "0.0.12",
"version": "0.0.13",
"description": "Knex generator for Domain Schema",

@@ -5,0 +5,0 @@ "repository": "https://github.com/sysgears/domain-schema.git",

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