configure lint staged (#588)

* chore: upgrade monorepo deps

* chore: configure lint-staged

* refactor: lenient use of any
This commit is contained in:
Carlos Valente
2023-11-13 22:04:55 +01:00
committed by GitHub
parent 140daef7e7
commit a41fe8806b
22 changed files with 1107 additions and 514 deletions
+3 -3
View File
@@ -3,11 +3,11 @@ import { deepmerge } from 'ontime-utils';
/**
* @description Ensures variable is string, it skips object types
* @param {any} val - variable to convert
* @param val - variable to convert
* @param {string} [fallback=''] - fallback value
* @returns {string} - value as string or fallback if not possible
*/
export const makeString = (val: any, fallback = ''): string => {
export const makeString = (val: unknown, fallback = ''): string => {
if (typeof val === 'string') return val;
else if (val == null || val.constructor === Object) return fallback;
return val.toString();
@@ -56,7 +56,7 @@ export const isEmptyObject = (obj: object) => {
* @param {object} a - any object
* @param {object} b - a potential partial object of same time as a
*/
export function mergeObject<T extends Record<string, any>>(a: T, b: Partial<Record<keyof T, any>>): T {
export function mergeObject<T extends object>(a: T, b: Partial<T>): T {
const merged = { ...a };
for (const key in b) {