Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

V1.0 #65

Merged
merged 2 commits into from
Mar 21, 2022
Merged

V1.0 #65

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safe-typeorm",
"version": "1.0.9",
"version": "1.0.11",
"description": "Safe Relationship Decorators for the TypeORM",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export abstract class Model extends orm.BaseEntity
(
this: Model.Creator<T>,
fieldLike: `${Literal}` | `${string}.${Literal}`,
operator: "IN",
operator: "IN" | "NOT IN",
parameters: Array<Field.MemberType<T, Literal>>,
): [string, Record<string, Array<Field.ValueType<T[Literal]>>>];

Expand Down
6 changes: 3 additions & 3 deletions src/functional/getWhereArguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function getWhereArguments<
(
creator: Creator<T>,
fieldLike: `${Literal}` | `${string}.${Literal}`,
operator: "IN",
operator: "IN" | "NOT IN",
parameters: Array<Field.MemberType<T, Literal>>
): [string, Record<string, [Field.ValueType<T[Literal]>, Field.ValueType<T[Literal]>]>];

Expand Down Expand Up @@ -171,7 +171,7 @@ export function getWhereArguments<
if (rest.length <= 2)
{
// SPECIALIZE OPERATOR AND PARAMETER
let operator: Operator | "IN";
let operator: Operator | "IN" | "NOT IN";
let param: Field.ValueType<T[Literal]>;

if (rest.length === 1)
Expand Down Expand Up @@ -199,7 +199,7 @@ export function getWhereArguments<

// RETURNS WITH BINDING
const uuid: string = crypto.randomBytes(64).toString("hex");
const binding: string = (operator === "IN")
const binding: string = (operator === "IN" || operator === "NOT IN")
? `(:...${uuid})`
: `:${uuid}`;
return [`${column} ${operator} ${binding}`, { [uuid]: param }];
Expand Down
3 changes: 2 additions & 1 deletion src/transactions/InsertCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function getDependencies<T extends object>
if (output === undefined)
{
output = new Set();
dependencies.set(target, output);

for (const meta of connection.entityMetadatas)
{
const child: Creator<object> = meta.target as Creator<object>;
Expand All @@ -168,7 +170,6 @@ function getDependencies<T extends object>
break;
}
}
dependencies.set(target, output);
}
return output;
}
Expand Down