Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
chore: added LowWithLodash class as a utility.
  • Loading branch information
hanoak20 committed Mar 14, 2024
commit 3eee6544704623273d8f902014975dd9094ced94
8 changes: 1 addition & 7 deletions src/models/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// src/models/Authentication.ts
import { Low } from "lowdb";
import { JSONFile } from "lowdb/node";
import lodash from "lodash";

class LowWithLodash<T> extends Low<T> {
chain: lodash.ExpChain<this["data"]> = lodash.chain(this).get("data");
}

import LowWithLodash from "../utils/lowdb-lodash.utils.js";
interface AuthenticationDocument {
users: {
user_id: string;
Expand Down
6 changes: 6 additions & 0 deletions src/utils/lowdb-lodash.utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import lodash from "lodash";
import { Low } from "lowdb";

export default class LowWithLodash<T> extends Low<T> {
chain: lodash.ExpChain<this["data"]> = lodash.chain(this).get("data");
}