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

Commit

Permalink
Merge pull request #65 from samchon/v1.0
Browse files Browse the repository at this point in the history
V1.0
  • Loading branch information
samchon authored Mar 21, 2022
2 parents 0403e1f + ab97a07 commit c4995ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
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

0 comments on commit c4995ff

Please sign in to comment.