mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-01-13 00:28:15 -05:00
#1078 is at about 4,000 lines changed and includes both code implementing features and unrelated functional and stylistic changes. This set of changes is about ⅓ of the total and should be largely independent. These changes include: * have Dependabot ignore `patch` version changes * switch the cache invalidation Hasura action to asynchronous * add a uniqueness constraint on the combination of player and skill ids * print a comprehensible error message in the db seeding script on network errors * add a mutex on the account creation process & allow it to happen only once *(subsequent runs were failing b/c of the uniqueness constraint on the ETH address & returning `null` (closes #1098)) * adds some more profile editing related types * renames `HighLow7dType` to `HighLowType` * refactors the `ColorBar` component to include links to a color explanation * replaces `fake-tag`'s `gql` string identifier with the dependency-free `/* GraphQL */` * rename `lib/hooks/useUserXp.ts` to `useUserXP.ts` * fixed some typings to remove `any`s * bumped some library versions & fixed the version numbers of some others
13 lines
266 B
TypeScript
13 lines
266 B
TypeScript
export const isEmpty = (obj: unknown) => {
|
|
if (Array.isArray(obj) && obj.length === 0) {
|
|
return true;
|
|
}
|
|
if (obj === '') {
|
|
return true;
|
|
}
|
|
if (obj && typeof obj === 'object' && Object.keys(obj).length === 0) {
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|