Skip to content

Commit a668514

Browse files
committed
refactor: replace lodash with es-toolkit
Replace lodash utility functions with es-toolkit equivalents to reduce bundle size and improve performance. Update imports in config service and merge-configs utility.
1 parent 6dc1ffb commit a668514

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

lib/config.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { Inject, Injectable, Optional } from '@nestjs/common';
22
import { isUndefined } from '@nestjs/common/utils/shared.utils';
33
import * as dotenv from 'dotenv';
44
import fs from 'fs';
5-
import get from 'lodash/get';
6-
import has from 'lodash/has';
7-
import set from 'lodash/set';
5+
import { get, has, set } from 'es-toolkit/compat';
86
import { Subject } from 'rxjs';
97
import {
108
CONFIGURATION_TOKEN,

lib/utils/merge-configs.util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import set from 'lodash/set';
1+
import { set } from 'es-toolkit/compat';
22

33
/**
44
* @publicApi

package-lock.json

Lines changed: 15 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"dependencies": {
2121
"dotenv": "16.4.7",
2222
"dotenv-expand": "12.0.2",
23-
"lodash": "4.17.21"
23+
"es-toolkit": "^1.39.3"
2424
},
2525
"devDependencies": {
2626
"@commitlint/cli": "19.8.1",
@@ -32,7 +32,6 @@
3232
"@nestjs/platform-express": "11.1.3",
3333
"@nestjs/testing": "11.1.3",
3434
"@types/jest": "30.0.0",
35-
"@types/lodash": "4.17.17",
3635
"@types/node": "22.15.32",
3736
"eslint": "9.29.0",
3837
"eslint-config-prettier": "10.1.5",

0 commit comments

Comments
 (0)