Extract and validate images using a new conversion, regenerate docs

This commit is contained in:
Pieter Vander Vennet 2022-02-09 22:37:21 +01:00
parent 5198f5d310
commit b3c58ae82e
52 changed files with 8611 additions and 3408 deletions

View file

@ -10,17 +10,20 @@ export default class StaticFeatureSource implements FeatureSource {
constructor(features: any[] | UIEventSource<any[] | UIEventSource<{ feature: any, freshness: Date }>>, useFeaturesDirectly) {
const now = new Date();
if(features === undefined){
throw "Static feature source received undefined as source"
}
if (useFeaturesDirectly) {
// @ts-ignore
this.features = features
} else if (features instanceof UIEventSource) {
// @ts-ignore
this.features = features.map(features => features.map(f => ({feature: f, freshness: now})))
this.features = features.map(features => features?.map(f => ({feature: f, freshness: now}) ?? []))
} else {
this.features = new UIEventSource(features.map(f => ({
this.features = new UIEventSource(features?.map(f => ({
feature: f,
freshness: now
})))
}))??[])
}
}