Get rid of lots of unnecessary lodash calls.

This commit is contained in:
baldo 2022-07-28 13:16:13 +02:00
parent b734a422a7
commit 5592892f0d
16 changed files with 99 additions and 115 deletions
server/utils

View file

@ -1,5 +1,4 @@
import {DurationSeconds, UnixTimestampSeconds} from "../types";
import _ from "lodash";
import {DurationSeconds, isString, UnixTimestampSeconds} from "../types";
import moment, {Moment} from "moment";
export function now(): UnixTimestampSeconds {
@ -45,7 +44,7 @@ export function formatTimestamp(timestamp: UnixTimestampSeconds): string {
}
export function parseTimestamp(timestamp: any): UnixTimestampSeconds | null {
if (!_.isString(timestamp)) {
if (!isString(timestamp)) {
return null;
}
const parsed = moment.utc(timestamp);