From 18783ec0f319260206e51ffde1ba601e7896727a Mon Sep 17 00:00:00 2001 From: Emil Johansson Date: Sat, 25 Feb 2023 09:13:44 -0700 Subject: [PATCH] fix husky pre-commit --- .husky/pre-commit | 2 +- apps/next/app/encryption/page.tsx | 12 ++++++------ package.json | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 75fac8e..58993aa 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npm run lint +pnpm lint diff --git a/apps/next/app/encryption/page.tsx b/apps/next/app/encryption/page.tsx index bb5cc55..d4dbeb5 100644 --- a/apps/next/app/encryption/page.tsx +++ b/apps/next/app/encryption/page.tsx @@ -18,9 +18,9 @@ const Encrypt = () => { const string = stringRef.current?.value console.log({ secret, - string - }); - + string, + }) + if (!secret || !string) return const encrypted = AES.encrypt(string, secret).toString() setEncryptedValue(encrypted) @@ -57,9 +57,9 @@ const Decrypt = () => { const encryptedValue = stringRef.current?.value console.log({ secret, - encryptedValue - }); - + encryptedValue, + }) + if (!secret || !encryptedValue) return const bytes = AES.decrypt(encryptedValue, secret) setDecryptedValue(bytes.toString(enc.Utf8)) diff --git a/package.json b/package.json index 3c6f17d..d578ea6 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ ], "license": "MIT", "scripts": { + "prepare": "husky install", "build": "turbo run build", "export": "turbo run export", "dev": "turbo run dev --parallel",