AP featured collectionの修正 / Collection Activityの対応 / typeの修正など (#5460)
* resolver type / fix updateFeatured * type ApObject * fix strange type * AP Activity * Collection Activityが失敗したらとりあえず無視
This commit is contained in:
@ -120,3 +120,11 @@ export function cumulativeSum(xs: number[]): number[] {
|
||||
export function fromEntries(xs: [string, any][]): { [x: string]: any; } {
|
||||
return xs.reduce((obj, [k, v]) => Object.assign(obj, { [k]: v }), {} as { [x: string]: any; });
|
||||
}
|
||||
|
||||
export function toArray<T>(x: T | T[] | undefined): T[] {
|
||||
return Array.isArray(x) ? x : x != null ? [x] : [];
|
||||
}
|
||||
|
||||
export function toSingle<T>(x: T | T[] | undefined): T | undefined {
|
||||
return Array.isArray(x) ? x[0] : x;
|
||||
}
|
||||
|
Reference in New Issue
Block a user