Skip to content

Commit

Permalink
Add @name in constants jsdocs to fix type generation (date-fns#3125)
Browse files Browse the repository at this point in the history
Fixed TypeScript and flow types for daysInYear constant.
  • Loading branch information
fturmel authored Jul 22, 2022
1 parent c5065fe commit 04f4aae
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/constants/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.

export const daysInWeek: number
export const daysInWeek: number
export const daysInYear: number
export const maxTime: number
export const millisecondsInMinute: number
export const millisecondsInHour: number
Expand Down
8 changes: 5 additions & 3 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ export const daysInWeek = 7
*
* > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
* @constant
* @type {number}
* @default
*
* @name daysInYear
* @constant
* @type {number}
* @default
*/
export const daysInYear: number = 365.2425

Expand Down
2 changes: 1 addition & 1 deletion src/fp/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ declare module.exports: {
yearsToMonths: CurriedFn1<number, number>,
yearsToQuarters: CurriedFn1<number, number>,
daysInWeek: number,
daysInWeek: number,
daysInYear: number,
maxTime: number,
millisecondsInMinute: number,
millisecondsInHour: number,
Expand Down
2 changes: 1 addition & 1 deletion src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ declare module.exports: {

daysInWeek: number,

daysInWeek: number,
daysInYear: number,

maxTime: number,

Expand Down
16 changes: 8 additions & 8 deletions typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ declare module 'date-fns' {

const daysInWeek: number

const daysInWeek: number
const daysInYear: number

const maxTime: number

Expand Down Expand Up @@ -1233,7 +1233,7 @@ declare module 'date-fns' {

declare module 'date-fns/constants' {
export const daysInWeek: number
export const daysInWeek: number
export const daysInYear: number
export const maxTime: number
export const millisecondsInMinute: number
export const millisecondsInHour: number
Expand All @@ -1254,7 +1254,7 @@ declare module 'date-fns/constants' {

declare module 'date-fns/constants/index' {
export const daysInWeek: number
export const daysInWeek: number
export const daysInYear: number
export const maxTime: number
export const millisecondsInMinute: number
export const millisecondsInHour: number
Expand All @@ -1275,7 +1275,7 @@ declare module 'date-fns/constants/index' {

declare module 'date-fns/constants/index.js' {
export const daysInWeek: number
export const daysInWeek: number
export const daysInYear: number
export const maxTime: number
export const millisecondsInMinute: number
export const millisecondsInHour: number
Expand Down Expand Up @@ -6021,7 +6021,7 @@ declare module 'date-fns/fp' {

const daysInWeek: number

const daysInWeek: number
const daysInYear: number

const maxTime: number

Expand Down Expand Up @@ -10972,7 +10972,7 @@ declare module 'date-fns/esm' {

const daysInWeek: number

const daysInWeek: number
const daysInYear: number

const maxTime: number

Expand Down Expand Up @@ -15734,7 +15734,7 @@ declare module 'date-fns/esm/fp' {

const daysInWeek: number

const daysInWeek: number
const daysInYear: number

const maxTime: number

Expand Down Expand Up @@ -23766,7 +23766,7 @@ interface dateFns {

daysInWeek: number

daysInWeek: number
daysInYear: number

maxTime: number

Expand Down

0 comments on commit 04f4aae

Please sign in to comment.