Skip to content

Commit

Permalink
add type and id in json field to avoid empty json string (#32)
Browse files Browse the repository at this point in the history
* add type and id in json field to avoid empty json string

* bump version
  • Loading branch information
Shawn Li authored Sep 24, 2020
1 parent 71d9b61 commit 90e475c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function dispatch({ type, uri, id, checksum, source, message, json }) {

let jsonStr;
try {
jsonStr = JSON.stringify(json);
jsonStr = JSON.stringify(Object.assign({ type, id }, json));
} catch (e) {
throw new InvalidEventJsonError("event json is invalid");
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@luxuryescapes/lib-events",
"version": "1.0.31",
"version": "1.0.32",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/jest && yarn run lint",
Expand Down

0 comments on commit 90e475c

Please sign in to comment.