Skip to content

Commit

Permalink
chore: update interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
galin-chung-nguyen committed Oct 19, 2024
1 parent a616392 commit 3395f0f
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 344 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const config = {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/prefer-for-of": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports" },
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
crawler
20 changes: 11 additions & 9 deletions app/TCKSUtils.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import { parse as parseCSVLine } from "csv-parse";
import * as sha256 from "sha256";
import { z } from "zod";

import type { Transaction } from "./types/Transaction";
import type { DateValue, RangeValue } from "@nextui-org/react";

export const TCSKUtils = {
sha256: async (data: string) => {
return crypto.subtle
.digest("SHA-256", new TextEncoder().encode(data.toString()))
.then((hashBuffer) => {
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray
.map((b) => b.toString(16).padStart(2, "0"))
.join("");
// return crypto.subtle
// .digest("SHA-256", new TextEncoder().encode(data.toString()))
// .then((hashBuffer) => {
// const hashArray = Array.from(new Uint8Array(hashBuffer));
// const hashHex = hashArray
// .map((b) => b.toString(16).padStart(2, "0"))
// .join("");

return hashHex;
});
// return hashHex;
// });
return sha256.default(data);
},
lineToCells: async (line: string): Promise<Array<string>> => {
return new Promise((resolve, reject) => {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
331 changes: 0 additions & 331 deletions lib/pdfExtractor.ts

This file was deleted.

Loading

0 comments on commit 3395f0f

Please sign in to comment.