refactor(utils): setCallback

This commit is contained in:
Linden committed 2023-07-28 06:09:08 +10:00
1 parent 68f0dc526a
commit bcb703a11f
4 files changed
+21 -26

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
import type { CFXCallback, CFXParameters } from '../types';
export const setCallback = (parameters?: CFXParameters | CFXCallback, cb?: CFXCallback) => {
if (cb && typeof cb === 'function') return cb;
if (parameters && typeof parameters === 'function') return parameters;
};