Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit ac944d0

Browse files
authored
Merge pull request #225 from streamr-dev/validate-ethereum-config-lodash
Use `lodash/*` instead of `lodash.*`
2 parents 567d1cb + 3e6a80e commit ac944d0

File tree

7 files changed

+43
-28
lines changed

7 files changed

+43
-28
lines changed

.babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module.exports = {
2222
['@babel/preset-typescript']
2323
],
2424
plugins: [
25-
"add-module-exports",
25+
'lodash',
26+
'add-module-exports',
2627
['@babel/plugin-transform-runtime', {
2728
corejs: 3,
2829
helpers: true,

package-lock.json

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

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"@typescript-eslint/parser": "^4.17.0",
8989
"babel-loader": "^8.2.2",
9090
"babel-plugin-add-module-exports": "^1.0.4",
91+
"babel-plugin-lodash": "^3.3.4",
9192
"babel-plugin-transform-class-properties": "^6.24.1",
9293
"benchmark": "^2.1.4",
9394
"buffer": "^6.0.3",
@@ -106,6 +107,7 @@
106107
"git-revision-webpack-plugin": "^3.0.6",
107108
"jest": "^26.6.3",
108109
"jest-circus": "^26.6.3",
110+
"lodash-webpack-plugin": "^0.11.6",
109111
"nightwatch": "^1.5.1",
110112
"process": "^0.11.10",
111113
"sinon": "^9.2.4",
@@ -138,10 +140,7 @@
138140
"@ethersproject/web": "^5.0.13",
139141
"debug": "^4.3.2",
140142
"eventemitter3": "^4.0.7",
141-
"lodash.uniqueid": "^4.0.1",
142-
"lodash.has": "^4.0.1",
143-
"lodash.get": "^4.0.1",
144-
"lodash.set": "^4.0.1",
143+
"lodash": "^4.17.21",
145144
"mem": "^8.0.0",
146145
"node-abort-controller": "^1.1.0",
147146
"node-fetch": "^2.6.1",

src/Config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { ConnectionInfo } from '@ethersproject/web'
1111
import { EthereumAddress, Todo } from './types'
1212
import { BytesLike } from '@ethersproject/bytes'
1313
import { isAddress } from '@ethersproject/address'
14-
import has from 'lodash.has'
15-
import get from 'lodash.get'
14+
import has from 'lodash/has'
15+
import get from 'lodash/get'
1616

1717
export type EthereumConfig = ExternalProvider|JsonRpcFetchFunc
1818

src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { inspect } from 'util'
22
import EventEmitter from 'events'
33

44
import { v4 as uuidv4 } from 'uuid'
5-
import uniqueId from 'lodash.uniqueid'
5+
import uniqueId from 'lodash/uniqueId'
66
import pMemoize from 'p-memoize'
77
import pLimit from 'p-limit'
88
import mem from 'mem'

test/unit/Config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import set from 'lodash/set'
12
import { arrayify, BytesLike } from '@ethersproject/bytes'
3+
24
import { StreamrClient } from '../../src/StreamrClient'
3-
import set from 'lodash.set'
45

56
describe('Config', () => {
6-
77
describe('validate ethereum addresses', () => {
88
const createClient = (propertyPaths: string, value: string|undefined|null) => {
99
const opts: any = {}

webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const path = require('path')
77

88
const webpack = require('webpack')
99
const TerserPlugin = require('terser-webpack-plugin')
10+
const LodashWebpackPlugin = require('lodash-webpack-plugin')
1011
const { merge } = require('webpack-merge')
1112
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
1213
const GitRevisionPlugin = require('git-revision-webpack-plugin')
@@ -105,6 +106,7 @@ module.exports = (env, argv) => {
105106
}
106107
},
107108
plugins: [
109+
new LodashWebpackPlugin(),
108110
new webpack.ProvidePlugin({
109111
process: 'process/browser',
110112
Buffer: ['buffer', 'Buffer'],

0 commit comments

Comments
 (0)