-export const hasOwnProp = (object: unknown, property: PropertyKey): boolean => {
- return isObject(object) && Object.hasOwn(object, property)
+/**
+ * Detects whether the given value is an asynchronous function or not.
+ *
+ * @param fn - Unknown value.
+ * @returns `true` if `fn` was an asynchronous function, otherwise `false`.
+ * @internal
+ */
+export const isAsyncFunction = (fn: unknown): fn is (...args: unknown[]) => Promise<unknown> => {
+ return typeof fn === 'function' && fn.constructor.name === 'AsyncFunction'
+}
+
+export const isObject = (value: unknown): value is object => {
+ return value != null && typeof value === 'object' && !Array.isArray(value)
+}
+
+export const isEmptyObject = (object: object): object is EmptyObject => {
+ if (object.constructor !== Object) {
+ return false
+ }
+ // Iterates over the keys of an object, if
+ // any exist, return false.
+ // eslint-disable-next-line no-unreachable-loop
+ for (const _ in object) {
+ return false
+ }
+ return true
+}
+
+export const hasOwnProp = (value: unknown, property: PropertyKey): boolean => {
+ return isObject(value) && Object.hasOwn(value, property)