Skip to content

Commit

Permalink
feat(enum): add a toJSON() representation
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Jun 6, 2017
1 parent 1ee2c69 commit 1d51f24
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/internal/OnmsEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ export class OnmsEnum {
this.l = label;
Object.freeze(this);
}

/** convert to the JSON representation */
public toJSON() {
return {
id: this.i,
label: this.l,
};
}
}

0 comments on commit 1d51f24

Please sign in to comment.