Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the size impact of lodash by picking the required modules only #41

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/I18n.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable class-methods-use-this, no-underscore-dangle */

import { get, has, set } from "lodash";
import get from "lodash/get";
import has from "lodash/has";
import set from "lodash/set";

import {
DateTime,
Expand Down
2 changes: 1 addition & 1 deletion src/Locales.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uniq } from "lodash";
import uniq from "lodash/uniq";

import { Dict, LocaleResolver } from "./typing";
import { I18n } from "./I18n";
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/camelCaseKeys.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { camelCase } from "lodash";
import camelCase from "lodash/camelCase";

import { Dict } from "../typing";

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/formatNumber.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BigNumber from "bignumber.js";
import { repeat } from "lodash";
import repeat from "lodash/repeat";

import { FormatNumberOptions, Numeric } from "../typing";
import { roundNumber } from "./roundNumber";
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/lookup.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 { Dict, Scope } from "../typing";
import { I18n } from "../I18n";
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/numberToHuman.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BigNumber from "bignumber.js";
import { sortBy, zipObject } from "lodash";
import sortBy from "lodash/sortBy";
import zipObject from "lodash/zipObject";

import { I18n } from "../I18n";
import { Numeric, NumberToHumanOptions, NumberToHumanUnits } from "../typing";
Expand Down
5 changes: 4 additions & 1 deletion src/helpers/propertyFlatList.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { isArray, isObject, flattenDeep } from "lodash";
import isArray from "lodash/isArray";
import isObject from "lodash/isObject";
import flattenDeep from "lodash/flattenDeep";

import { Dict } from "../typing";

interface Indexable {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/timeAgoInWords.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { range } from "lodash";
import range from "lodash/range";

import { I18n } from "../I18n";
import { DateTime, TimeAgoInWordsOptions } from "../typing";
Expand Down