Adds the appropriate return type for the method or function

This commit is contained in:
deepsource-autofix[bot] 2022-05-17 08:19:10 +00:00 committed by GitHub
parent 745e3e2890
commit 0472605a4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -4,7 +4,9 @@ import { secretKey, algorithm } from "@config/encryption";
const iv = crypto.randomBytes(16);
const encrypt = (text: any) => {
const encrypt = (text: any): {iv: error;
content: error;
} => {
const cipher = crypto.createCipheriv(algorithm, secretKey, iv);
const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);

View file

@ -1,6 +1,6 @@
import logger from "@root/logger";
export default (count: number, noun: string, suffix?: string) => {
export default (count: number, noun: string, suffix?: string): string => {
const result = `${count} ${noun}${count !== 1 ? suffix || "s" : ""}`;
logger?.verbose(`Pluralized ${count} to ${result}`);
return result;