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

typeorm

Package Overview
Dependencies
Maintainers
1
Versions
828
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeorm - npm Package Compare versions

Comparing version 0.0.2-alpha.12 to 0.0.2-alpha.13

2

package.json
{
"name": "typeorm",
"private": false,
"version": "0.0.2-alpha.12",
"version": "0.0.2-alpha.13",
"description": "Data-mapper ORM for Typescript",

@@ -6,0 +6,0 @@ "license": "Apache-2.0",

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

this.addSelect(alias);
return this.join("INNER", entityOrProperty, alias, conditionType, condition);
return this.join("INNER", entityOrProperty, alias, conditionType, condition, parameters);
};

@@ -104,3 +104,3 @@ QueryBuilder.prototype.innerJoin = function (entityOrProperty, alias, conditionType, condition, parameters) {

if (condition === void 0) { condition = ""; }
return this.join("INNER", entityOrProperty, alias, conditionType, condition);
return this.join("INNER", entityOrProperty, alias, conditionType, condition, parameters);
};

@@ -295,3 +295,7 @@ QueryBuilder.prototype.leftJoinAndSelect = function (entityOrProperty, alias, conditionType, condition, parameters) {

.query(countQuery)
.then(function (results) { return parseInt(results[0]["cnt"]); });
.then(function (results) {
if (!results || !results[0] || !results[0]["cnt"])
return 0;
return parseInt(results[0]["cnt"]);
});
};

@@ -498,4 +502,11 @@ QueryBuilder.prototype.getResultsAndCount = function () {

var inverseJoinColumnName = joinTable.inverseReferencedColumn.name; // not sure if this is correct
var condition1 = junctionAlias + "." + junctionMetadata.columns[0].name + "=" + parentAlias + "." + joinTableColumn; // todo: use column names from junction table somehow
var condition2 = joinAlias + "." + inverseJoinColumnName + "=" + junctionAlias + "." + junctionMetadata.columns[1].name;
var condition1 = "", condition2 = "";
if (relation.isOwning) {
condition1 = junctionAlias + "." + junctionMetadata.columns[0].name + "=" + parentAlias + "." + joinTableColumn;
condition2 = joinAlias + "." + inverseJoinColumnName + "=" + junctionAlias + "." + junctionMetadata.columns[1].name;
}
else {
condition1 = junctionAlias + "." + junctionMetadata.columns[1].name + "=" + parentAlias + "." + joinTableColumn;
condition2 = joinAlias + "." + inverseJoinColumnName + "=" + junctionAlias + "." + junctionMetadata.columns[0].name;
}
return " " + joinType + " JOIN " + junctionTable + " " + junctionAlias + " " + join.conditionType + " " + condition1 +

@@ -557,3 +568,3 @@ " " + joinType + " JOIN " + joinTableName + " " + joinAlias + " " + join.conditionType + " " + condition2 + appendedCondition;

var value = _this.parameters[key] !== null && _this.parameters[key] !== undefined ? _this.driver.escape(_this.parameters[key]) : "NULL";
sql = sql.replace(":" + key, value); // todo: make replace only in value statements, otherwise problems
sql = sql.replace(new RegExp(":" + key, "g"), value); // todo: make replace only in value statements, otherwise problems
});

@@ -560,0 +571,0 @@ return sql;

@@ -38,3 +38,7 @@ "use strict";

.map(function (group) { return _this.transformIntoSingleResult(group.items, alias, metadata); })
.filter(function (res) { return !!res; });
.filter(function (res) { return !!res; })
.map(function (res) {
// console.log("res: ", res);
return res;
});
};

@@ -61,4 +65,5 @@ /**

var relatedEntities = _this.groupAndTransform(rawSqlResults, relationAlias);
var result = (relation.isManyToOne || relation.isOneToOne) ? relatedEntities[0] : relatedEntities;
if (result) {
var isResultArray = relation.isManyToMany || relation.isOneToMany;
var result = !isResultArray ? relatedEntities[0] : relatedEntities;
if (result && (!isResultArray || result.length > 0)) {
if (relation.isLazy) {

@@ -65,0 +70,0 @@ entity["__" + relation.propertyName + "__"] = result;

Sorry, the diff of this file is not supported yet

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