chore: setup rollup-plugin-visualizer and remove lodash (#6974)

* chore: setup rollup-plugin-visualizer

* chore: remove lodash

* format

* remove lodash-es from build
This commit is contained in:
Ben McCann 2024-02-07 23:27:54 -08:00 committed by GitHub
parent abb6922c2b
commit b273ea2ba4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 261 additions and 23 deletions

View file

@ -1,5 +1,5 @@
import type { AssetResponseDto } from '@api';
import lodash from 'lodash-es';
import { chain } from 'lodash-es';
import { DateTime, Interval } from 'luxon';
export const fromLocalDateTime = (localDateTime: string) => DateTime.fromISO(localDateTime, { zone: 'UTC' });
@ -45,8 +45,7 @@ export function splitBucketIntoDateGroups(
assets: AssetResponseDto[],
locale: string | undefined,
): AssetResponseDto[][] {
return lodash
.chain(assets)
return chain(assets)
.groupBy((asset) => fromLocalDateTime(asset.localDateTime).toLocaleString(groupDateFormat, { locale }))
.sortBy((group) => assets.indexOf(group[0]))
.value();