From 6daeaa971fd5d170fb29082a8e86dc77e4c20c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Jos=C3=A9?= Date: Sat, 15 Dec 2018 11:55:39 -0200 Subject: [PATCH] Camel case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio José --- lib/specs/spec_0_1.js | 24 ++++++++++++------------ lib/specs/spec_0_2.js | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/specs/spec_0_1.js b/lib/specs/spec_0_1.js index 142530c..83a909f 100644 --- a/lib/specs/spec_0_1.js +++ b/lib/specs/spec_0_1.js @@ -1,6 +1,6 @@ var uuid = require("uuid/v4"); -function Spec_0_1(_caller){ +function Spec01(_caller){ this.payload = { cloudEventsVersion: "0.1", eventID: uuid() @@ -24,7 +24,7 @@ function Spec_0_1(_caller){ * * throw an error if do not pass. */ -Spec_0_1.prototype.check = function() { +Spec01.prototype.check = function() { if(!this.payload["eventType"]){ throw {message: "'eventType' is invalid"}; @@ -32,47 +32,47 @@ Spec_0_1.prototype.check = function() { }; -Spec_0_1.prototype.type = function(_type){ +Spec01.prototype.type = function(_type){ this.payload["eventType"] = _type; return this; }; -Spec_0_1.prototype.eventTypeVersion = function(version){ +Spec01.prototype.eventTypeVersion = function(version){ this.payload["eventTypeVersion"] = version; return this; }; -Spec_0_1.prototype.source = function(_source){ +Spec01.prototype.source = function(_source){ this.payload["source"] = _source; return this; }; -Spec_0_1.prototype.id = function(_id){ +Spec01.prototype.id = function(_id){ this.payload["eventID"] = _id; return this; }; -Spec_0_1.prototype.time = function(_time){ +Spec01.prototype.time = function(_time){ this.payload["eventTime"] = _time.toISOString(); return this; }; -Spec_0_1.prototype.schemaurl = function(_schemaurl){ +Spec01.prototype.schemaurl = function(_schemaurl){ this.payload["schemaURL"] = _schemaurl; return this; }; -Spec_0_1.prototype.contenttype = function(_contenttype){ +Spec01.prototype.contenttype = function(_contenttype){ this.payload["contentType"] = _contenttype; return this; }; -Spec_0_1.prototype.data = function(_data){ +Spec01.prototype.data = function(_data){ this.payload["data"] = _data; return this; }; -Spec_0_1.prototype.addExtension = function(key, value){ +Spec01.prototype.addExtension = function(key, value){ if(!this.payload["extensions"]){ this.payload["extensions"] = {}; } @@ -80,4 +80,4 @@ Spec_0_1.prototype.addExtension = function(key, value){ return this; }; -module.exports = Spec_0_1; +module.exports = Spec01; diff --git a/lib/specs/spec_0_2.js b/lib/specs/spec_0_2.js index 257ae90..7f1c443 100644 --- a/lib/specs/spec_0_2.js +++ b/lib/specs/spec_0_2.js @@ -1,7 +1,7 @@ var uuid = require("uuid/v4"); var empty = require("is-empty") -function Spec_0_2(){ +function Spec02(){ this.payload = { specversion: "0.2", id: uuid() @@ -11,7 +11,7 @@ function Spec_0_2(){ /* * Check the spec constraints. */ -Spec_0_2.prototype.check = function(){ +Spec02.prototype.check = function(){ if(empty(this.payload["type"])) { throw {message: "'type' is invalid"}; @@ -31,44 +31,44 @@ Spec_0_2.prototype.check = function(){ } } -Spec_0_2.prototype.type = function(_type){ +Spec02.prototype.type = function(_type){ this.payload["type"] = _type; return this; } -Spec_0_2.prototype.source = function(_source){ +Spec02.prototype.source = function(_source){ this.payload["source"] = _source; return this; } -Spec_0_2.prototype.id = function(_id){ +Spec02.prototype.id = function(_id){ this.payload["id"] = _id; return this; } -Spec_0_2.prototype.time = function(_time){ +Spec02.prototype.time = function(_time){ this.payload["time"] = _time.toISOString(); return this; } -Spec_0_2.prototype.schemaurl = function(_schemaurl){ +Spec02.prototype.schemaurl = function(_schemaurl){ this.payload["schemaurl"] = _schemaurl; return this; } -Spec_0_2.prototype.contenttype = function(_contenttype){ +Spec02.prototype.contenttype = function(_contenttype){ this.payload["contenttype"] = _contenttype; return this; } -Spec_0_2.prototype.data = function(_data){ +Spec02.prototype.data = function(_data){ this.payload["data"] = _data; return this; } -Spec_0_2.prototype.addExtension = function(key, value){ +Spec02.prototype.addExtension = function(key, value){ this.payload[key] = value; return this; } -module.exports = Spec_0_2; +module.exports = Spec02;