Skip to content

Commit

Permalink
fix type validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Gonzalez committed Dec 11, 2019
1 parent dbb0b61 commit 865ed08
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/sls-api-file-relation.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SlsApiFileRelation extends API {

validate() {
if(this.customFields.length) {
if(!this.customFields.every(field => field === 'string'))
if(!this.customFields.every(field => typeof field === 'string'))
throw new SlsApiFileRelationError(SlsApiFileRelationError.messages.CUSTOM_FIELDS_NOT_ARRAY_OF_STRINGS);
}

Expand Down Expand Up @@ -96,10 +96,8 @@ class SlsApiFileRelation extends API {
name,
path,
mimeType: ContentType,
type: ContentType,
// type: ContentType,
size: ContentLength,
dateCreated: 0,
userCreated: 0,
...data
});

Expand Down

0 comments on commit 865ed08

Please sign in to comment.