Skip to content

Commit

Permalink
refactor: lodash imports
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceau committed Jul 26, 2023
1 parent 7d58527 commit d7cf022
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
7 changes: 6 additions & 1 deletion src/stats/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { get, isEqual, keyBy, last, set, size } from "lodash";
import get from "lodash/get";
import isEqual from "lodash/isEqual";
import keyBy from "lodash/keyBy";
import last from "lodash/last";
import set from "lodash/set";
import size from "lodash/size";

import type { FrameEntryType, GameStartType } from "../types";
import type { ActionCountsType, PlayerIndexedType } from "./common";
Expand Down
2 changes: 1 addition & 1 deletion src/stats/combos.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from "events";
import { last } from "lodash";
import last from "lodash/last";

import type { FrameEntryType, FramesType, GameStartType, PostFrameUpdateType } from "../types";
import type { ComboType, MoveLandedType, PlayerIndexedType } from "./common";
Expand Down
6 changes: 5 additions & 1 deletion src/stats/conversions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { EventEmitter } from "events";
import { filter, get, groupBy, last, orderBy } from "lodash";
import filter from "lodash/filter";
import get from "lodash/get";
import groupBy from "lodash/groupBy";
import last from "lodash/last";
import orderBy from "lodash/orderBy";

import type { FrameEntryType, FramesType, GameStartType, PostFrameUpdateType } from "../types";
import type { ConversionType, MoveLandedType, PlayerIndexedType } from "./common";
Expand Down
9 changes: 8 additions & 1 deletion src/stats/overall.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { first, flatten, get, groupBy, keyBy, last, mapValues, zip } from "lodash";
import first from "lodash/first";
import flatten from "lodash/flatten";
import get from "lodash/get";
import groupBy from "lodash/groupBy";
import keyBy from "lodash/keyBy";
import last from "lodash/last";
import mapValues from "lodash/mapValues";
import zip from "lodash/zip";

import type { GameStartType } from "../types";
import type { ConversionType, InputCountsType, OverallType, RatioType } from "./common";
Expand Down
2 changes: 1 addition & 1 deletion src/stats/stats.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { get } from "lodash";
import get from "lodash/get";

import type { FrameEntryType, FramesType, GameStartType } from "../types";
import { Frames } from "../types";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fullwidth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { map } from "lodash";
import map from "lodash/map";

export function toHalfwidth(str: string): string {
// Converts a fullwidth character to halfwidth
Expand Down
2 changes: 1 addition & 1 deletion src/utils/slpFile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { WriteStream } from "fs";
import fs from "fs";
import { forEach } from "lodash";
import forEach from "lodash/forEach";
import type { WritableOptions } from "stream";
import { Writable } from "stream";

Expand Down
4 changes: 3 additions & 1 deletion src/utils/slpParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { EventEmitter } from "events";
import { get, keyBy, set } from "lodash";
import get from "lodash/get";
import keyBy from "lodash/keyBy";
import set from "lodash/set";
import semver from "semver";

import type {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/slpReader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { decode } from "@shelacek/ubjson";
import fs from "fs";
import iconv from "iconv-lite";
import { mapValues } from "lodash";
import mapValues from "lodash/mapValues";

import type {
EventCallbackFunc,
Expand Down

0 comments on commit d7cf022

Please sign in to comment.