Files
SnowLuma/.pnpm-store/v11/files/cf/81797ee4fd539d34d1b3d3bb49f1588a5c026a9d25e3a02b65db517202bfc31afc2e6bc552bfde73963be0d8d1582fbababdfc581e1093fa5608868c38e83e
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

15 lines
514 B
Plaintext

import { MIN_YEAR_SPACE, REFERENCE_YEAR } from '../../data/const'
import { MatchEstimated, MatchExtended } from '../../types'
export default ({ year, separator }: MatchExtended | MatchEstimated) => {
// base guesses: (year distance from REFERENCE_YEAR) * num_days * num_years
const yearSpace = Math.max(Math.abs(year - REFERENCE_YEAR), MIN_YEAR_SPACE)
let guesses = yearSpace * 365
// add factor of 4 for separator selection (one of ~4 choices)
if (separator) {
guesses *= 4
}
return guesses
}