| 348 | } |
| 349 | |
| 350 | public groupIn<U>(key: ArrayFunc<LowestKey<T>, U>, comparator?: ArrayComparator<U>): DataArray<Ingrouped<U, T>> { |
| 351 | if (Groupings.isGrouping(this.values)) { |
| 352 | return this.map((v) => { |
| 353 | return { |
| 354 | key: (v as GroupElement<unknown>).key, |
| 355 | rows: this.lwrap((v as GroupElement<unknown>).rows) |
| 356 | .groupIn(key as ArrayFunc<unknown, unknown>) |
| 357 | .array(), |
| 358 | } as Ingrouped<U, T>; |
| 359 | }); |
| 360 | } else { |
| 361 | return this.groupBy(key as ArrayFunc<T, U>, comparator) as DataArray<Ingrouped<U, T>>; |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | public distinct<U>(key?: ArrayFunc<T, U>, comparator?: ArrayComparator<U>): DataArray<T> { |
| 366 | if (this.values.length == 0) return this; |