Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryk-dk committed Feb 12, 2024
1 parent b85e197 commit 5d8ef8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development",
"test": "jest --watch --onlyChanged",
"test:ci": "jest --passWithNoTests --maxWorkers 4",
"test": "jest",
"test:watch": "jest --watch --onlyChanged",
"test:ci": "jest --maxWorkers 4",
"test:coverage": "jest --collectCoverage",
"typecheck": "tsc --noEmit",
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "npm run lint -- --fix",
Expand Down
7 changes: 4 additions & 3 deletions pkg/plugin/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func parseStreamResponse(reader io.Reader) backend.DataResponse {
}
}

d, err := labelsToRawJson(labels)
d, err := labelsToJSON(labels)
if err != nil {
return newResponseError(err, backend.StatusInternal)
}
Expand All @@ -91,8 +91,9 @@ func parseStreamResponse(reader io.Reader) backend.DataResponse {
return rsp
}

func labelsToRawJson(labels data.Labels) (json.RawMessage, error) {
// data.Labels when converted to JSON keep the fields sorted
// labelsToJSON converts labels to json representation
// data.Labels when converted to JSON keep the fields sorted
func labelsToJSON(labels data.Labels) (json.RawMessage, error) {
bytes, err := json.Marshal(labels)
if err != nil {
return nil, err
Expand Down

0 comments on commit 5d8ef8b

Please sign in to comment.