mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-04-02 05:23:21 +00:00
feat: Worked with matt to create all the things
This commit is contained in:
10
lib/util/nullIfEmpty.ts
Normal file
10
lib/util/nullIfEmpty.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* A useful tool when doing a getConfig.
|
||||
* Look into the config {@link FileHelper} for an example of the use.
|
||||
* @param s
|
||||
* @returns
|
||||
*/
|
||||
export default function nullIfEmpty(s: null | Record<string, unknown>) {
|
||||
if (s === null) return null;
|
||||
return Object.keys(s).length === 0 ? null : s;
|
||||
}
|
||||
Reference in New Issue
Block a user