@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
19 lines (18 loc) • 622 B
JavaScript
/**
* Returns whether a LazyMotion `features` value is an async loader.
*
* @param features - Feature bundle or loader passed to `<LazyMotion>`.
* @returns True when the features value should be invoked asynchronously.
*/
export const isLazyFeatureBundle = (features) => typeof features === 'function';
/**
* Normalizes an asynchronously loaded feature bundle.
*
* @param loaded - Resolved bundle or default-export module wrapper.
* @returns The concrete feature bundle.
*/
export const normalizeLazyFeatureBundle = (loaded) => {
if ('default' in loaded)
return loaded.default;
return loaded;
};