Helpers

getYearById.mjs

@mr_ozio/scraper-utils · v2.5.0 · Generated April 21, 2026

Target Style

Target Style

3 exports

const

yearForId

Target Style
export const yearForId = ({ platform, id }) => {

Guesses the year for an item id using named options.

Target style API. Preferred for new code.

Parameters

  • options{ platform: 'ic' | 'rd', id: number }

Returns

number | undefined

Example

const year = yearForId({
  platform: 'ic',
  id: 125001,
})

const

getYearByICId

Target Style
export const getYearByICId = (id) => yearForId({ platform: 'ic', id })

Guesses the year for an Intimcity id.

Target style API. Preferred for new code.

Parameters

  • idnumber

Returns

number | undefined

const

getYearByRDId

Target Style
export const getYearByRDId = (id) => yearForId({ platform: 'rd', id })

Guesses the year for an RD id.

Target style API. Preferred for new code.

Parameters

  • idnumber

Returns

number | undefined

Legacy Style

Legacy Style

1 exports

const

getYearById

Legacy Style
export const getYearById = (platform, id) => guessYear({ platform, id })

Guesses the year for an item id on a supported platform.

Supported platforms:

  • ic
  • rd

Legacy API. Kept for older code and not the preferred choice for new code.

Parameters

  • platform'ic' | 'rd'
  • idnumber

Returns

number | undefined