Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
641 B
Text
19 lines
641 B
Text
import { SchedulerLike } from '../types';
|
|
import { isFunction } from './isFunction';
|
|
import { isScheduler } from './isScheduler';
|
|
|
|
function last<T>(arr: T[]): T | undefined {
|
|
return arr[arr.length - 1];
|
|
}
|
|
|
|
export function popResultSelector(args: any[]): ((...args: unknown[]) => unknown) | undefined {
|
|
return isFunction(last(args)) ? args.pop() : undefined;
|
|
}
|
|
|
|
export function popScheduler(args: any[]): SchedulerLike | undefined {
|
|
return isScheduler(last(args)) ? args.pop() : undefined;
|
|
}
|
|
|
|
export function popNumber(args: any[], defaultValue: number): number {
|
|
return typeof last(args) === 'number' ? args.pop()! : defaultValue;
|
|
}
|