import { TZDate } from '../../../../../../@date-fns_tz@1.4.1/node_modules/@date-fns/tz/date/index.js';
import '../../../../../../@date-fns_tz@1.4.1/node_modules/@date-fns/tz/date/mini.js';

/**
 * Convert a {@link Date} or {@link TZDate} instance to the given time zone.
 * Reuses the same instance when it is already a {@link TZDate} using the target
 * time zone to avoid extra allocations.
 */
function toTimeZone(date, timeZone) {
    if (date instanceof TZDate && date.timeZone === timeZone) {
        return date;
    }
    return new TZDate(date, timeZone);
}

export { toTimeZone };
//# sourceMappingURL=toTimeZone.js.map
