Skip to content

Commit ea40850

Browse files
committed
call for check
1 parent 1f2841d commit ea40850

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/cloudevent.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ function Cloudevent(_spec, _formatter){
1616
* To format the payload using the formatter
1717
*/
1818
Cloudevent.prototype.format = function(){
19+
// Check the constraints
20+
this.spec.check();
21+
22+
// Then, format
1923
return this.formatter.format(this.spec.payload);
2024
}
2125

lib/specs/spec_0_2.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ function Spec_0_2(){
77
};
88
}
99

10+
/*
11+
* Check the spec constraints.
12+
*/
13+
Spec_0_2.prototype.check = function(){
14+
15+
}
16+
1017
Spec_0_2.prototype.type = function(_type){
1118
this.payload['type'] = _type;
1219
return this;

0 commit comments

Comments
 (0)