Skip to content

Commit

Permalink
renamed roles manager to role manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgul committed May 21, 2024
1 parent 311749a commit fe6672e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/managers/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import tp from 'trivialperms';

// Managers
import * as rolesMan from './roles';
import * as rolesMan from './role';

// Models
import { Account } from '../../common/interfaces/models/account';
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/server/routes/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import express from 'express';
import { errorHandler } from './utils';

// Managers
import * as rolesMan from '../managers/roles';
import * as rolesMan from '../managers/role';

// Logger
import logging from '@strata-js/util-logging';
Expand Down
12 changes: 12 additions & 0 deletions src/server/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,16 @@ export function sortBy(key : string) : (a : Record<string, any>, b : Record<stri
};
}

/**
* Checks to see if an object is empty.
*
* @param obj - The object to check.
*
* @returns Returns `true` if the object is empty, `false` otherwise.
*/
export function isEmpty (obj : any) : boolean
{
return [ Object, Array ].includes((obj || {}).constructor) && !Object.entries((obj || {})).length;
}

//----------------------------------------------------------------------------------------------------------------------

0 comments on commit fe6672e

Please sign in to comment.