+import { intoArray } from '@app/helpers'
import {
BooleanBothQuery,
BooleanQuery,
this.categoryOneOf = options.categoryOneOf || undefined
this.licenceOneOf = options.licenceOneOf || undefined
this.languageOneOf = options.languageOneOf || undefined
- this.tagsOneOf = this.intoArray(options.tagsOneOf)
- this.tagsAllOf = this.intoArray(options.tagsAllOf)
+ this.tagsOneOf = intoArray(options.tagsOneOf)
+ this.tagsAllOf = intoArray(options.tagsAllOf)
this.durationMin = parseInt(options.durationMin, 10)
this.durationMax = parseInt(options.durationMax, 10)
originallyPublishedStartDate: this.originallyPublishedStartDate,
originallyPublishedEndDate: this.originallyPublishedEndDate,
nsfw: this.nsfw,
- categoryOneOf: this.intoArray(this.categoryOneOf),
- licenceOneOf: this.intoArray(this.licenceOneOf),
- languageOneOf: this.intoArray(this.languageOneOf),
+ categoryOneOf: intoArray(this.categoryOneOf),
+ licenceOneOf: intoArray(this.licenceOneOf),
+ languageOneOf: intoArray(this.languageOneOf),
tagsOneOf: this.tagsOneOf,
tagsAllOf: this.tagsAllOf,
durationMin: this.durationMin,
return true
}
-
- private intoArray (value: any) {
- if (!value) return undefined
- if (Array.isArray(value)) return value
-
- if (typeof value === 'string') return value.split(',')
-
- return [ value ]
- }
}