Skip to content

Commit a13226e

Browse files
committed
Adds valueOf method to Command
1 parent ddd667d commit a13226e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@highmobility/auto-api-javascript",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Auto API for JavaScript - the parsing library for the Auto API vehicle data model",
55
"main": "lib/index.js",
66
"module": "es/index.js",

src/core/Command.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ export class Command {
6969
}
7070

7171
public toJSON() {
72+
return this.valueOf();
73+
}
74+
75+
public valueOf() {
7276
const { capability, name } = this;
7377
return {
7478
[name]: {
75-
[capability.name]: capability,
79+
[capability.name]: capability.valueOf(),
7680
},
7781
};
7882
}

0 commit comments

Comments
 (0)