Double quotes
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
2a7d3ba558
commit
2f6ac6775b
|
@ -1,9 +1,9 @@
|
||||||
var uuid = require('uuid/v4');
|
var uuid = require("uuid/v4");
|
||||||
var empty = require('is-empty')
|
var empty = require("is-empty")
|
||||||
|
|
||||||
function Spec_0_2(){
|
function Spec_0_2(){
|
||||||
this.payload = {
|
this.payload = {
|
||||||
specversion: '0.2',
|
specversion: "0.2",
|
||||||
id: uuid()
|
id: uuid()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -13,56 +13,56 @@ function Spec_0_2(){
|
||||||
*/
|
*/
|
||||||
Spec_0_2.prototype.check = function(){
|
Spec_0_2.prototype.check = function(){
|
||||||
|
|
||||||
if(empty(this.payload['type'])) {
|
if(empty(this.payload["type"])) {
|
||||||
throw {message: "'type' is invalid"};
|
throw {message: "'type' is invalid"};
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty(this.payload['specversion'])) {
|
if(empty(this.payload["specversion"])) {
|
||||||
throw {message: "'specversion' is invalid"};
|
throw {message: "'specversion' is invalid"};
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.payload['specversion'] !== '0.2') {
|
if(this.payload["specversion"] !== "0.2") {
|
||||||
throw {message: "'specversion' value is invalid: '"
|
throw {message: "'specversion' value is invalid: '"
|
||||||
+ this.payload['specversion'] + "'"};
|
+ this.payload["specversion"] + "'"};
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty(this.payload['id'])) {
|
if(empty(this.payload["id"])) {
|
||||||
throw {message: "'id' is invalid"};
|
throw {message: "'id' is invalid"};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spec_0_2.prototype.type = function(_type){
|
Spec_0_2.prototype.type = function(_type){
|
||||||
this.payload['type'] = _type;
|
this.payload["type"] = _type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Spec_0_2.prototype.source = function(_source){
|
Spec_0_2.prototype.source = function(_source){
|
||||||
this.payload['source'] = _source;
|
this.payload["source"] = _source;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Spec_0_2.prototype.id = function(_id){
|
Spec_0_2.prototype.id = function(_id){
|
||||||
this.payload['id'] = _id;
|
this.payload["id"] = _id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Spec_0_2.prototype.time = function(_time){
|
Spec_0_2.prototype.time = function(_time){
|
||||||
this.payload['time'] = _time.toISOString();
|
this.payload["time"] = _time.toISOString();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Spec_0_2.prototype.schemaurl = function(_schemaurl){
|
Spec_0_2.prototype.schemaurl = function(_schemaurl){
|
||||||
this.payload['schemaurl'] = _schemaurl;
|
this.payload["schemaurl"] = _schemaurl;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Spec_0_2.prototype.contenttype = function(_contenttype){
|
Spec_0_2.prototype.contenttype = function(_contenttype){
|
||||||
this.payload['contenttype'] = _contenttype;
|
this.payload["contenttype"] = _contenttype;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Spec_0_2.prototype.data = function(_data){
|
Spec_0_2.prototype.data = function(_data){
|
||||||
this.payload['data'] = _data;
|
this.payload["data"] = _data;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,4 +72,3 @@ Spec_0_2.prototype.addExtension = function(key, value){
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Spec_0_2;
|
module.exports = Spec_0_2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue