Skip to content

Commit

Permalink
Remove lodash & other irrelevant dependencies entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Aug 17, 2023
1 parent 2c60b48 commit c3c566e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 43 deletions.
8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@
"@istanbuljs/nyc-config-babel": "3.0.0",
"@stellar/tsconfig": "^1.0.2",
"@types/chai": "^4.3.5",
"@types/detect-node": "^2.0.0",
"@types/eventsource": "^1.1.2",
"@types/lodash": "^4.14.197",
"@types/mocha": "^10.0.1",
"@types/node": "^20.5.0",
"@types/randombytes": "^2.0.0",
"@types/sinon": "^10.0.16",
"@types/urijs": "^1.19.6",
"@typescript-eslint/parser": "^6.4.0",
Expand Down Expand Up @@ -129,7 +126,6 @@
"node-polyfill-webpack-plugin": "^2.0.1",
"nyc": "^15.1.0",
"prettier": "^3.0.2",
"randombytes": "^2.1.0",
"sinon": "^15.2.0",
"sinon-chai": "^3.7.0",
"taffydb": "^2.7.3",
Expand All @@ -144,11 +140,7 @@
"axios": "^1.4.0",
"bignumber.js": "^9.1.1",
"buffer": "^6.0.3",
"detect-node": "^2.0.4",
"es6-promise": "^4.2.4",
"eventsource": "^2.0.2",
"lodash": "^4.17.21",
"randombytes": "^2.1.0",
"stellar-base": "10.0.0-soroban.7",
"toml": "^3.0.0",
"urijs": "^1.19.1"
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/// <reference path="../types/dom-monkeypatch.d.ts" />

/* tslint:disable:no-var-requires */
require("es6-promise").polyfill();
const version = require("../package.json").version;

// Expose all types
Expand Down
10 changes: 3 additions & 7 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/* tslint:disable:variable-name no-namespace */

import isEmpty from "lodash/isEmpty";
import merge from "lodash/merge";
import {
Account,
Address,
Expand Down Expand Up @@ -69,11 +66,10 @@ export class Server {
if (opts.appVersion) {
customHeaders["X-App-Version"] = opts.appVersion;
}
if (!isEmpty(customHeaders)) {
if (Object.keys(customHeaders).length === 0) {
AxiosClient.interceptors.request.use((config: any) => {
// merge the custom headers with an existing headers
config.headers = merge(customHeaders, config.headers);

// merge the custom headers into any existing headers
config.headers = Object.assign(config.headers, customHeaders);
return config;
});
}
Expand Down
27 changes: 0 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1397,11 +1397,6 @@
dependencies:
"@types/node" "*"

"@types/detect-node@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/detect-node/-/detect-node-2.0.0.tgz#696e024ddd105c72bbc6a2e3f97902a2886f2c3f"
integrity sha512-+BozjlbPTACYITf1PWf62HLtDV79HbmZosUN1mv1gGrnjDCRwBXkDKka1sf6YQJvspmfPXVcy+X6tFW62KteeQ==

"@types/eslint-scope@^3.7.3":
version "3.7.4"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16"
Expand Down Expand Up @@ -1462,11 +1457,6 @@
resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9"
integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==

"@types/lodash@^4.14.197":
version "4.14.197"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.197.tgz#e95c5ddcc814ec3e84c891910a01e0c8a378c54b"
integrity sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==

"@types/markdown-it@^12.2.3":
version "12.2.3"
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51"
Expand Down Expand Up @@ -1500,13 +1490,6 @@
resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.6.tgz#8fcf95990514d2a7624aa5f630c13bf2427f9cdd"
integrity sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA==

"@types/randombytes@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304"
integrity sha512-bz8PhAVlwN72vqefzxa14DKNT8jK/mV66CSjwdVQM/k3Th3EPKfUtdMniwZgMedQTFuywAsfjnZsg+pEnltaMA==
dependencies:
"@types/node" "*"

"@types/semver@^7.3.12":
version "7.5.0"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a"
Expand Down Expand Up @@ -3054,11 +3037,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015"
integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==

detect-node@^2.0.4:
version "2.1.0"
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==

dezalgo@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.4.tgz#751235260469084c132157dfa857f386d4c33d81"
Expand Down Expand Up @@ -3324,11 +3302,6 @@ es6-object-assign@^1.1.0:
resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c"
integrity sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==

es6-promise@^4.2.4:
version "4.2.8"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==

escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
Expand Down

0 comments on commit c3c566e

Please sign in to comment.