Skip to content

Commit f68fdb4

Browse files
ptomatojustingrant
authored andcommitted
Editorial: Rename ToSecondsStringPrecision→ToSecondsStringPrecisionRecord
UPSTREAM_COMMIT=60f105239e4667dd25d24067d522fa59b9eed553
1 parent 31d3aa8 commit f68fdb4

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

lib/duration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ export class Duration implements Temporal.Duration {
402402
if (smallestUnit === 'hour' || smallestUnit === 'minute') {
403403
throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');
404404
}
405-
const { precision, unit, increment } = ES.ToSecondsStringPrecision(smallestUnit, digits);
405+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
406406
ES.uncheckedAssertNarrowedType<Exclude<typeof precision, 'minute'>>(
407407
precision,
408408
'Precision cannot be "minute" because of RangeError above'

lib/ecmascript.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ export function ToFractionalSecondDigits(
10061006
return digitCount as Exclude<Temporal.ToStringPrecisionOptions['fractionalSecondDigits'], 'auto'>;
10071007
}
10081008

1009-
export function ToSecondsStringPrecision(
1009+
export function ToSecondsStringPrecisionRecord(
10101010
smallestUnit: Temporal.ToStringPrecisionOptions['smallestUnit'],
10111011
precision: Temporal.ToStringPrecisionOptions['fractionalSecondDigits']
10121012
): {
@@ -2614,7 +2614,7 @@ export function FormatSecondsStringPart(
26142614
millisecond: number,
26152615
microsecond: number,
26162616
nanosecond: number,
2617-
precision: ReturnType<typeof ToSecondsStringPrecision>['precision']
2617+
precision: ReturnType<typeof ToSecondsStringPrecisionRecord>['precision']
26182618
) {
26192619
if (precision === 'minute') return '';
26202620

@@ -2636,7 +2636,7 @@ export function FormatSecondsStringPart(
26362636
export function TemporalInstantToString(
26372637
instant: Temporal.Instant,
26382638
timeZone: Temporal.TimeZoneProtocol | undefined,
2639-
precision: ReturnType<typeof ToSecondsStringPrecision>['precision']
2639+
precision: ReturnType<typeof ToSecondsStringPrecisionRecord>['precision']
26402640
) {
26412641
let outputTimeZone = timeZone;
26422642
if (outputTimeZone === undefined) {
@@ -2666,7 +2666,7 @@ export function TemporalInstantToString(
26662666
}
26672667

26682668
interface ToStringOptions {
2669-
unit: ReturnType<typeof ToSecondsStringPrecision>['unit'];
2669+
unit: ReturnType<typeof ToSecondsStringPrecisionRecord>['unit'];
26702670
increment: number;
26712671
roundingMode: ReturnType<typeof ToTemporalRoundingMode>;
26722672
}
@@ -2755,7 +2755,7 @@ export function TemporalDateToString(
27552755

27562756
export function TemporalDateTimeToString(
27572757
dateTime: Temporal.PlainDateTime,
2758-
precision: ReturnType<typeof ToSecondsStringPrecision>['precision'],
2758+
precision: ReturnType<typeof ToSecondsStringPrecisionRecord>['precision'],
27592759
showCalendar: ReturnType<typeof ToCalendarNameOption> = 'auto',
27602760
options: ToStringOptions | undefined = undefined
27612761
) {
@@ -2835,7 +2835,7 @@ export function TemporalYearMonthToString(
28352835

28362836
export function TemporalZonedDateTimeToString(
28372837
zdt: Temporal.ZonedDateTime,
2838-
precision: ReturnType<typeof ToSecondsStringPrecision>['precision'],
2838+
precision: ReturnType<typeof ToSecondsStringPrecisionRecord>['precision'],
28392839
showCalendar: ReturnType<typeof ToCalendarNameOption> = 'auto',
28402840
showTimeZone: ReturnType<typeof ToTimeZoneNameOption> = 'auto',
28412841
showOffset: ReturnType<typeof ToShowOffsetOption> = 'auto',

lib/instant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class Instant implements Temporal.Instant {
108108
if (smallestUnit === 'hour') throw new RangeError('smallestUnit must be a time unit other than "hour"');
109109
let timeZone = options.timeZone;
110110
if (timeZone !== undefined) timeZone = ES.ToTemporalTimeZone(timeZone);
111-
const { precision, unit, increment } = ES.ToSecondsStringPrecision(smallestUnit, digits);
111+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
112112
const ns = GetSlot(this, EPOCHNANOSECONDS);
113113
const roundedNs = ES.RoundInstant(ns, increment, unit, roundingMode);
114114
const roundedInstant = new Instant(roundedNs);

lib/plaindatetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ export class PlainDateTime implements Temporal.PlainDateTime {
378378
const roundingMode = ES.ToTemporalRoundingMode(options, 'trunc');
379379
const smallestUnit = ES.GetTemporalUnit(options, 'smallestUnit', 'time', undefined);
380380
if (smallestUnit === 'hour') throw new RangeError('smallestUnit must be a time unit other than "hour"');
381-
const { precision, unit, increment } = ES.ToSecondsStringPrecision(smallestUnit, digits);
381+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
382382
return ES.TemporalDateTimeToString(this, precision, showCalendar, { unit, increment, roundingMode });
383383
}
384384
toJSON(): Return['toJSON'] {

lib/plaintime.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ import type { PlainTimeParams as Params, PlainTimeReturn as Return } from './int
2525
const ObjectAssign = Object.assign;
2626

2727
type TemporalTimeToStringOptions = {
28-
unit: ReturnType<typeof ES.ToSecondsStringPrecision>['unit'];
29-
increment: ReturnType<typeof ES.ToSecondsStringPrecision>['increment'];
28+
unit: ReturnType<typeof ES.ToSecondsStringPrecisionRecord>['unit'];
29+
increment: ReturnType<typeof ES.ToSecondsStringPrecisionRecord>['increment'];
3030
roundingMode: Temporal.RoundingMode;
3131
};
3232

3333
function TemporalTimeToString(
3434
time: Temporal.PlainTime,
35-
precision: ReturnType<typeof ES.ToSecondsStringPrecision>['precision'],
35+
precision: ReturnType<typeof ES.ToSecondsStringPrecisionRecord>['precision'],
3636
options: TemporalTimeToStringOptions | undefined = undefined
3737
) {
3838
let hour = GetSlot(time, ISO_HOUR);
@@ -227,7 +227,7 @@ export class PlainTime implements Temporal.PlainTime {
227227
const roundingMode = ES.ToTemporalRoundingMode(options, 'trunc');
228228
const smallestUnit = ES.GetTemporalUnit(options, 'smallestUnit', 'time', undefined);
229229
if (smallestUnit === 'hour') throw new RangeError('smallestUnit must be a time unit other than "hour"');
230-
const { precision, unit, increment } = ES.ToSecondsStringPrecision(smallestUnit, digits);
230+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
231231
return TemporalTimeToString(this, precision, { unit, increment, roundingMode });
232232
}
233233
toJSON(): Return['toJSON'] {

lib/zoneddatetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ export class ZonedDateTime implements Temporal.ZonedDateTime {
440440
const smallestUnit = ES.GetTemporalUnit(options, 'smallestUnit', 'time', undefined);
441441
if (smallestUnit === 'hour') throw new RangeError('smallestUnit must be a time unit other than "hour"');
442442
const showTimeZone = ES.ToTimeZoneNameOption(options);
443-
const { precision, unit, increment } = ES.ToSecondsStringPrecision(smallestUnit, digits);
443+
const { precision, unit, increment } = ES.ToSecondsStringPrecisionRecord(smallestUnit, digits);
444444
return ES.TemporalZonedDateTimeToString(this, precision, showCalendar, showTimeZone, showOffset, {
445445
unit,
446446
increment,

0 commit comments

Comments
 (0)