Get rid of lots of unnecessary lodash calls.
This commit is contained in:
parent
b734a422a7
commit
5592892f0d
16 changed files with 99 additions and 115 deletions
server/utils
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue