mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 18:31:54 +00:00
11 lines
296 B
TypeScript
11 lines
296 B
TypeScript
/**
|
|
* 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
|
|
}
|