Remove Fluent, Tags

This commit is contained in:
Jon Staab
2024-12-13 15:18:33 -08:00
parent 6235c3f6bb
commit 760d6d07cd
7 changed files with 14 additions and 258 deletions
+5 -7
View File
@@ -1,6 +1,6 @@
import {ensureNumber} from '@welshman/lib'
import type {Filter} from '@welshman/util'
import {Tags} from '@welshman/util'
import {getTagValues} from '@welshman/util'
import {
FeedType,
Feed,
@@ -110,15 +110,13 @@ export const defaultTagFeedMappings: TagFeedMapping[] = [
['t', [FeedType.Tag, '#t']],
]
export const feedsFromTags = (tags: Tags, mappings?: TagFeedMapping[]) => {
export const feedsFromTags = (tags: string[][], mappings?: TagFeedMapping[]) => {
const feeds = []
for (const [tagName, templateFeed] of mappings || defaultTagFeedMappings) {
const filterTags = tags.whereKey(tagName)
if (filterTags.exists()) {
let values: string[] | number[] = filterTags.values().valueOf()
let values: any[] = getTagValues(tagName, tags)
if (values.length > 0) {
if (isKindFeed(templateFeed)) {
values = values.map(ensureNumber) as number[]
}
@@ -130,7 +128,7 @@ export const feedsFromTags = (tags: Tags, mappings?: TagFeedMapping[]) => {
return feeds
}
export const feedFromTags = (tags: Tags, mappings?: TagFeedMapping[]) =>
export const feedFromTags = (tags: string[][], mappings?: TagFeedMapping[]) =>
makeIntersectionFeed(...feedsFromTags(tags, mappings))
export const feedsFromFilter = ({since, until, ...filter}: Filter) => {