Skip to content

Commit

Permalink
chore: cleanup imports in expression file
Browse files Browse the repository at this point in the history
Signed-off-by: Lucian Buzzo <lucian.buzzo@gmail.com>
  • Loading branch information
LucianBuzzo committed Dec 11, 2023
1 parent 3a5c74f commit 73597a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/expressions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Prisma, PrismaClient } from "@prisma/client";
import { Dictionary, get } from "lodash";
import { PrismaClient } from "@prisma/client";
import random from "lodash/random";
import matches from "lodash/matches";
import { Parser } from "node-sql-parser";
import { escapeIdentifier, escapeLiteral } from "./escape";
import { escapeLiteral } from "./escape";
import { defineDmmfProperty } from "@prisma/client/runtime/library";

// This is black magic to get the runtime data model from the Prisma client
Expand All @@ -29,7 +28,7 @@ const deepFind = (obj: any, subObj: any): any => {
type Token = {
astFragment: any;
};
type Tokens = Dictionary<Token>;
type Tokens = Record<string, Token>;

export type Expression<ContextKeys extends string = string> =
| string
Expand Down Expand Up @@ -66,7 +65,7 @@ const tokenizeWhereExpression = (
/** The Prisma client to use for metadata */
client: PrismaClient,
/** The Prisma where expression to be tokenized */
where: Dictionary<any>,
where: Record<string, any>,
/** The base table we are generating an expression for */
table: string,
/** The model name being queried. e.g. 'User' */
Expand All @@ -75,7 +74,7 @@ const tokenizeWhereExpression = (
tokens: Tokens = {},
): {
tokens: Tokens;
where: Dictionary<any>;
where: Record<string, any>;
} => {
for (const field in where) {
// Get field data from the prisma client for the model and field being queried
Expand Down
1 change: 0 additions & 1 deletion test/integration/rbac.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { PrismaClient, User } from "@prisma/client";
import { setup } from "../../src";
import { v4 as uuid } from "uuid";
import { update } from "lodash";

let adminClient: PrismaClient;

Expand Down

0 comments on commit 73597a1

Please sign in to comment.