mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 02:16:40 -05:00
continuing, WIP
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { SiteConfig } from 'epg-grabber'
|
||||
import { deepMerge } from '../functions/functions'
|
||||
import { deepMerge } from '../functions'
|
||||
import { pathToFileURL } from 'url'
|
||||
|
||||
export class ConfigLoader {
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
* const uniqueItems = uniqBy(items, item => item.id);
|
||||
* // uniqueItems will be [{ id: 1, name: 'A' }, { id: 2, name: 'B' }]
|
||||
*/
|
||||
export const uniqBy = <T, K>(arr: T[], fn: (item: T) => K): T[] =>
|
||||
Array.from(new Map(arr.map(item => [fn(item), item])).values())
|
||||
export const uniqBy = <T, K>(arr: T[], fn: (item: T) => K): T[] => [...new Map(arr.map(x => [fn(x), x])).values()]
|
||||
|
||||
/**
|
||||
* Recursively merges multiple objects into a single object.
|
||||
|
||||
1
scripts/functions/index.ts
Normal file
1
scripts/functions/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './functions'
|
||||
Reference in New Issue
Block a user