first commit

This commit is contained in:
2025-04-06 20:33:29 +03:00
commit f977d6b3d4
76 changed files with 16809 additions and 0 deletions

12
src/boot/helpers.ts Normal file
View File

@@ -0,0 +1,12 @@
export function isObjEqual<Type>(obj1: Type, obj2: Type): boolean {
return obj1 && obj2 && Object.keys(obj1).length === Object.keys(obj2).length &&
(Object.keys(obj1) as (keyof typeof obj1)[]).every(key => {
return Object.prototype.hasOwnProperty.call(obj2, key) && obj1[key] === obj2[key]
})
}
export function parseIntString (s: string | string[] | undefined) :number | null {
if (typeof s !== 'string') return null
const regex = /^[+-]?\d+$/
return regex.test(s) ? Number(s) : null
}