Skip to content

Commit 98e64f8

Browse files
authored
Update protodef.js to remove lodash.get (#167)
* Update protodef.js to remove lodash.get * Update package.json
1 parent 0002700 commit 98e64f8

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"tonicExampleFilename": "example.js",
1616
"license": "MIT",
1717
"dependencies": {
18-
"lodash.get": "^4.4.2",
1918
"lodash.reduce": "^4.6.0",
2019
"protodef-validator": "^1.3.0",
2120
"readable-stream": "^4.4.0"

src/protodef.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const { getFieldInfo, tryCatch } = require('./utils')
22
const reduce = require('lodash.reduce')
3-
const get = require('lodash.get')
43
const Validator = require('protodef-validator')
54

65
function isFieldInfo (type) {
@@ -60,7 +59,7 @@ class ProtoDef {
6059
function recursiveAddTypes (protocolData, path) {
6160
if (protocolData === undefined) { return }
6261
if (protocolData.types) { self.addTypes(protocolData.types) }
63-
recursiveAddTypes(get(protocolData, path.shift()), path)
62+
recursiveAddTypes(protocolData?.[path[0]], path.slice(1))
6463
}
6564

6665
if (this.validator) { this.validator.validateProtocol(protocolData) }

0 commit comments

Comments
 (0)