From 38c398347ac5358d6475eb1c21c2045a3af2b4e7 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Thu, 28 Mar 2024 23:32:23 -0400 Subject: [PATCH] rename createNativeYearMonthParseOps --- packages/temporal-polyfill/src/funcApi/moveUtils.ts | 4 ++-- packages/temporal-polyfill/src/funcApi/plainYearMonth.ts | 9 ++++----- .../src/internal/calendarNativeQuery.ts | 5 +---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/temporal-polyfill/src/funcApi/moveUtils.ts b/packages/temporal-polyfill/src/funcApi/moveUtils.ts index 75b2914d..1be378c0 100644 --- a/packages/temporal-polyfill/src/funcApi/moveUtils.ts +++ b/packages/temporal-polyfill/src/funcApi/moveUtils.ts @@ -1,10 +1,10 @@ import { createNativeConvertOps } from '../internal/calendarNativeQuery' import { createNativeDayOfYearOps, + createNativeDayOps, createNativeDaysInMonthOps, createNativeDaysInYearOps, createNativeWeekOps, - createNativeYearMonthParseOps, } from '../internal/calendarNativeQuery' import * as errorMessages from '../internal/errorMessages' import { IsoDateFields } from '../internal/isoFields' @@ -96,7 +96,7 @@ export function moveToDayOfMonth>( const normDayOfMonth = clampEntity('day', day, 1, daysInMonth, overflow) return moveToDayOfMonthUnsafe( - createNativeYearMonthParseOps(calendar), + createNativeDayOps(calendar), slots, normDayOfMonth, ) diff --git a/packages/temporal-polyfill/src/funcApi/plainYearMonth.ts b/packages/temporal-polyfill/src/funcApi/plainYearMonth.ts index ab472b1e..dc7aa80a 100644 --- a/packages/temporal-polyfill/src/funcApi/plainYearMonth.ts +++ b/packages/temporal-polyfill/src/funcApi/plainYearMonth.ts @@ -6,10 +6,10 @@ import { import { refineCalendarId } from '../internal/calendarId' import { createNativeDateModOps, + createNativeDayOps, createNativeYearMonthDiffOps, createNativeYearMonthModOps, createNativeYearMonthMoveOps, - createNativeYearMonthParseOps, createNativeYearMonthRefineOps, } from '../internal/calendarNativeQuery' import { compareIsoDateFields, plainYearMonthsEqual } from '../internal/compare' @@ -109,10 +109,9 @@ export function fromFields( ) } -export const fromString = bindArgs( - parsePlainYearMonth, - createNativeYearMonthParseOps, -) as (s: string) => Record +export const fromString = bindArgs(parsePlainYearMonth, createNativeDayOps) as ( + s: string, +) => Record export function isInstance(record: any): record is Record { return Boolean(record) && record.branding === PlainYearMonthBranding diff --git a/packages/temporal-polyfill/src/internal/calendarNativeQuery.ts b/packages/temporal-polyfill/src/internal/calendarNativeQuery.ts index cc88e814..1d423a65 100644 --- a/packages/temporal-polyfill/src/internal/calendarNativeQuery.ts +++ b/packages/temporal-polyfill/src/internal/calendarNativeQuery.ts @@ -548,6 +548,7 @@ export const createNativeDiffOps = createNativeOpsCreator( isoDiffOps, intlDiffOps, ) +export const createNativeDayOps = createNativeOpsCreator(isoDayOps, intlDayOps) export const createNativeYearMonthMoveOps = createNativeOpsCreator( isoYearMonthMoveOps, intlYearMonthMoveOps, @@ -588,10 +589,6 @@ export const createNativeWeekOps = createNativeOpsCreator( ) // String Parsing -export const createNativeYearMonthParseOps = createNativeOpsCreator( - isoDayOps, - intlDayOps, -) export const createNativeMonthDayParseOps = createNativeOpsCreator( isoMonthDayParseOps, intlMonthDayParseOps,