UNPKG

@humanspeak/svelte-motion

Version:

Framer Motion for Svelte 5. Declarative motion.<tag> components with AnimatePresence exit animations, gestures (hover, tap, drag, focus, in-view), variants, FLIP layout animations, shared-layout transitions, spring physics, and scroll-linked motion values

30 lines (29 loc) 1.01 kB
import type { DOMKeyframesDefinition } from 'motion'; /** * Checks if an object is empty or undefined. * * @param obj - The object to check. Can be a regular object, animation keyframes, or undefined * @returns true if the object is undefined or has no own properties, false otherwise * * @example * ```ts * isEmpty({}) // true * isEmpty(undefined) // true * isEmpty({ opacity: 0 }) // false * ``` */ export declare const isEmpty: (obj: Record<string, unknown> | DOMKeyframesDefinition | undefined) => boolean; /** * Checks if an object is not empty and defined. * * @param obj - The object to check. Can be a regular object, animation keyframes, or undefined * @returns true if the object has at least one own property, false if empty or undefined * * @example * ```ts * isNotEmpty({}) // false * isNotEmpty(undefined) // false * isNotEmpty({ scale: 1 }) // true * ``` */ export declare const isNotEmpty: (obj: Record<string, unknown> | DOMKeyframesDefinition | undefined) => boolean;