Skip to content

Commit

Permalink
使用findKey替代filter (#28)
Browse files Browse the repository at this point in the history
* replace filter with findKey

* fix package.json
  • Loading branch information
re0marb1e authored Jan 4, 2024
1 parent a47c292 commit 29a5f58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"bindings": "^1.5.0",
"browser-or-node": "^1.2.1",
"isomorphic-ws": "^4.0.1",
"lodash": "^4.17.21",
"node-int64": "^0.4.0",
"q": "^1.5.0",
"ws": "^5.2.2",
"lodash": "^4.17.21"
"ws": "^5.2.2"
},
"keywords": [
"nebula",
Expand All @@ -40,11 +40,18 @@
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.6",
"@babel/node": "^7.14.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.14.5",
"@babel/plugin-proposal-do-expressions": "^7.14.5",
"@babel/plugin-proposal-export-default-from": "^7.14.5",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-function-bind": "^7.14.5",
"@babel/plugin-proposal-function-sent": "^7.14.5",
"@babel/plugin-proposal-json-strings": "^7.18.6",
"@babel/plugin-proposal-logical-assignment-operators": "^7.20.7",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-numeric-separator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-proposal-pipeline-operator": "^7.14.5",
"@babel/plugin-proposal-throw-expressions": "^7.14.5",
"@babel/plugin-syntax-import-meta": "^7.10.4",
Expand Down
3 changes: 1 addition & 2 deletions src/nebula/parser/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ const NebulaValueTypeNames = [
'gVal'
]


const getNebulaValueTypeName = (obj: NebulaValue): string => {
return _.chain(obj).keys().filter(k => obj[k] !== null).first().value()
return _.findKey(obj, o => o !== null)
}

const isNebulaValue = (obj: any): boolean => {
Expand Down

0 comments on commit 29a5f58

Please sign in to comment.