Remove comment code and check for string type of data attribute

Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
Fabio José 2019-08-06 11:17:07 -03:00
parent c42bc654df
commit 2ad2249724
1 changed files with 1 additions and 9 deletions

View File

@ -87,15 +87,6 @@ Spec03.prototype.check = function(ce){
throw {message: "invalid payload", errors: isValidAgainstSchema.errors};
}
Array.of(toCheck)
.filter((tc) => (typeof tc.data) !== "string")
.filter((tc) => tc["datacontentencoding"])
.forEach((tc) => {
throw {message: "invalid payload", errors: [
"Use 'datacontentencoding' when 'data' is a string"
]};
});
Array.of(toCheck)
.filter((tc) => tc["datacontentencoding"])
.map((tc) => tc["datacontentencoding"].toLocaleLowerCase("en-US"))
@ -108,6 +99,7 @@ Spec03.prototype.check = function(ce){
Array.of(toCheck)
.filter((tc) => tc["datacontentencoding"])
.filter((tc) => (typeof tc.data) === "string")
.map((tc) => {
let newtc = clone(tc);
newtc.datacontentencoding =