diff --git a/cloud/scrapers/filmhuisdenhaag.ts b/cloud/scrapers/filmhuisdenhaag.ts index 54500456..ee59dd98 100644 --- a/cloud/scrapers/filmhuisdenhaag.ts +++ b/cloud/scrapers/filmhuisdenhaag.ts @@ -3,7 +3,7 @@ import { DateTime } from 'luxon' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/filmhuislumen.ts b/cloud/scrapers/filmhuislumen.ts index 32ea3e19..291e0932 100644 --- a/cloud/scrapers/filmhuislumen.ts +++ b/cloud/scrapers/filmhuislumen.ts @@ -3,7 +3,7 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberDutch } from './utils/monthToNumber' const logger = parentLogger.createChild({ diff --git a/cloud/scrapers/filmkoepel.ts b/cloud/scrapers/filmkoepel.ts index fe0b73fa..77ef6f40 100644 --- a/cloud/scrapers/filmkoepel.ts +++ b/cloud/scrapers/filmkoepel.ts @@ -4,7 +4,7 @@ import { Screening } from 'types' import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { monthToNumber } from './utils/monthToNumber' const logger = parentLogger.createChild({ diff --git a/cloud/scrapers/forumgroningen.ts b/cloud/scrapers/forumgroningen.ts index c74c1890..85b3d160 100644 --- a/cloud/scrapers/forumgroningen.ts +++ b/cloud/scrapers/forumgroningen.ts @@ -3,7 +3,7 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { fullMonthToNumberEnglish } from './utils/monthToNumber' const logger = parentLogger.createChild({ diff --git a/cloud/scrapers/hartlooper.ts b/cloud/scrapers/hartlooper.ts index ef8a92f6..fe4ce034 100644 --- a/cloud/scrapers/hartlooper.ts +++ b/cloud/scrapers/hartlooper.ts @@ -5,9 +5,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { fullMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/ketelhuis.ts b/cloud/scrapers/ketelhuis.ts index 1314cfe9..11073ce6 100644 --- a/cloud/scrapers/ketelhuis.ts +++ b/cloud/scrapers/ketelhuis.ts @@ -9,7 +9,7 @@ import { fullMonthToNumberDutch, shortMonthToNumberDutch, } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/lab111.ts b/cloud/scrapers/lab111.ts index 7712c2b3..a0c3fbfb 100644 --- a/cloud/scrapers/lab111.ts +++ b/cloud/scrapers/lab111.ts @@ -3,9 +3,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import xRayPuppeteer from '../xRayPuppeteer' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/lantarenvenster.ts b/cloud/scrapers/lantarenvenster.ts index 231ee1ad..e8d6e426 100644 --- a/cloud/scrapers/lantarenvenster.ts +++ b/cloud/scrapers/lantarenvenster.ts @@ -3,9 +3,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/lumiere.ts b/cloud/scrapers/lumiere.ts index 3fd2fd58..1c058ea5 100644 --- a/cloud/scrapers/lumiere.ts +++ b/cloud/scrapers/lumiere.ts @@ -4,9 +4,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import xRayPuppeteer from '../xRayPuppeteer' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/lux.ts b/cloud/scrapers/lux.ts index 4489745d..24793168 100644 --- a/cloud/scrapers/lux.ts +++ b/cloud/scrapers/lux.ts @@ -4,9 +4,9 @@ import { Screening } from 'types' import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { fullMonthToNumberEnglish } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/natlab.ts b/cloud/scrapers/natlab.ts index 5d3e23f2..49912791 100644 --- a/cloud/scrapers/natlab.ts +++ b/cloud/scrapers/natlab.ts @@ -3,9 +3,9 @@ import { Screening } from 'types' import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/rialto.ts b/cloud/scrapers/rialto.ts index 38c4f0cc..15cc2729 100644 --- a/cloud/scrapers/rialto.ts +++ b/cloud/scrapers/rialto.ts @@ -4,9 +4,9 @@ import { Screening } from 'types' import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { fullMonthToNumberEnglish } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/schuur.ts b/cloud/scrapers/schuur.ts index 423ffd60..5b811887 100644 --- a/cloud/scrapers/schuur.ts +++ b/cloud/scrapers/schuur.ts @@ -4,9 +4,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import xRayPuppeteer from '../xRayPuppeteer' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/slachtstraat.ts b/cloud/scrapers/slachtstraat.ts index 6cc8106d..2337661f 100644 --- a/cloud/scrapers/slachtstraat.ts +++ b/cloud/scrapers/slachtstraat.ts @@ -5,9 +5,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { fullMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/springhaver.ts b/cloud/scrapers/springhaver.ts index 66fb9281..400a106e 100644 --- a/cloud/scrapers/springhaver.ts +++ b/cloud/scrapers/springhaver.ts @@ -4,9 +4,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { fullMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/studiok.ts b/cloud/scrapers/studiok.ts index 8d10caf3..d808016c 100644 --- a/cloud/scrapers/studiok.ts +++ b/cloud/scrapers/studiok.ts @@ -4,9 +4,9 @@ import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' import { Screening } from '../types' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberDutch } from './utils/monthToNumber' -import splitTime from './utils/splitTime' +import { splitTime } from './utils/splitTime' const logger = parentLogger.createChild({ persistentLogAttributes: { diff --git a/cloud/scrapers/themovies.ts b/cloud/scrapers/themovies.ts index 2b57c99a..f6cbef96 100644 --- a/cloud/scrapers/themovies.ts +++ b/cloud/scrapers/themovies.ts @@ -4,7 +4,7 @@ import { Screening } from 'types' import Xray from 'x-ray' import { logger as parentLogger } from '../powertools' -import guessYear from './utils/guessYear' +import { guessYear } from './utils/guessYear' import { shortMonthToNumberEnglish } from './utils/monthToNumber' const logger = parentLogger.createChild({ diff --git a/cloud/scrapers/utils/guessYear.ts b/cloud/scrapers/utils/guessYear.ts index 31939682..9d21b294 100644 --- a/cloud/scrapers/utils/guessYear.ts +++ b/cloud/scrapers/utils/guessYear.ts @@ -1,7 +1,7 @@ import { DateObjectUnits, DateTime } from 'luxon' // if the date is over half a year in the past, it's likely one belonging to next year -const guessYear = (dateObjects: DateObjectUnits) => { +export const guessYear = (dateObjects: DateObjectUnits) => { const now = DateTime.local() let date = DateTime.fromObject(dateObjects) @@ -17,5 +17,3 @@ const guessYear = (dateObjects: DateObjectUnits) => { return date.year } } - -export default guessYear diff --git a/cloud/scrapers/utils/monthToNumber.ts b/cloud/scrapers/utils/monthToNumber.ts index 5536579b..99f0e437 100644 --- a/cloud/scrapers/utils/monthToNumber.ts +++ b/cloud/scrapers/utils/monthToNumber.ts @@ -90,6 +90,7 @@ const monthToNumberWithWarning = ( return monthNumber } + export function fullMonthToNumberDutch(month: string) { return monthToNumberWithWarning( 'fullMonthToNumberDutch', @@ -105,6 +106,7 @@ export function shortMonthToNumberDutch(month: string) { month, ) } + export function fullMonthToNumberEnglish(month: string) { return monthToNumberWithWarning( 'fullMonthToNumberEnglish', @@ -112,6 +114,7 @@ export function fullMonthToNumberEnglish(month: string) { month, ) } + export function shortMonthToNumberEnglish(month: string) { return monthToNumberWithWarning( 'shortMonthToNumberEnglish', diff --git a/cloud/scrapers/utils/splitTime.ts b/cloud/scrapers/utils/splitTime.ts index bccf9989..800adbd0 100644 --- a/cloud/scrapers/utils/splitTime.ts +++ b/cloud/scrapers/utils/splitTime.ts @@ -1,4 +1,3 @@ // : or . as separator -const splitTime = (time: string) => time.split(/:|\./).map((x) => Number(x)) - -export default splitTime +export const splitTime = (time: string) => + time.split(/:|\./).map((x) => Number(x))