siren-parser
Advanced tools
Comparing version 6.2.1 to 6.3.0
{ | ||
"name": "siren-parser", | ||
"version": "6.2.1", | ||
"version": "6.3.0", | ||
"description": "Pretty much the opposite of dominicbarnes/node-siren-writer", | ||
@@ -5,0 +5,0 @@ "main": "src/Entity.js", |
@@ -16,15 +16,15 @@ 'use strict'; | ||
assert('object' === typeof action, 'action must be an object'); | ||
assert('string' === typeof action.name, 'action.name must be a string'); | ||
assert('string' === typeof action.href, 'action.href must be a string'); | ||
assert('object' === typeof action, 'action must be an object, got ' + JSON.stringify(action)); | ||
assert('string' === typeof action.name, 'action.name must be a string, got ' + JSON.stringify(action.name)); | ||
assert('string' === typeof action.href, 'action.href must be a string, got ' + JSON.stringify(action.href)); | ||
assert('undefined' === typeof action.class || Array.isArray(action.class), | ||
'action.class must be an array or undefined'); | ||
'action.class must be an array or undefined, got ' + JSON.stringify(action.class)); | ||
assert('undefined' === typeof action.method || 'string' === typeof action.method, | ||
'action.method must be a string or undefined'); | ||
'action.method must be a string or undefined, got ' + JSON.stringify(action.method)); | ||
assert('undefined' === typeof action.title || 'string' === typeof action.title, | ||
'action.title must be a string or undefined'); | ||
'action.title must be a string or undefined, got ' + JSON.stringify(action.title)); | ||
assert('undefined' === typeof action.type || 'string' === typeof action.type, | ||
'action.type must be a string or undefined'); | ||
'action.type must be a string or undefined, got ' + JSON.stringify(action.type)); | ||
assert('undefined' === typeof action.fields || Array.isArray(action.fields), | ||
'action.fields must be an array or undefined'); | ||
'action.fields must be an array or undefined, got ' + JSON.stringify(action.fields)); | ||
@@ -31,0 +31,0 @@ this.name = action.name; |
@@ -26,17 +26,17 @@ 'use strict'; | ||
assert('undefined' === typeof entity.rel || Array.isArray(entity.rel), | ||
'entity.rel must be an array or undefined'); | ||
'entity.rel must be an array or undefined, got ' + JSON.stringify(entity.rel)); | ||
assert('undefined' === typeof entity.title || 'string' === typeof entity.title, | ||
'entity.title must be a string or undefined'); | ||
'entity.title must be a string or undefined, got ' + JSON.stringify(entity.title)); | ||
assert('undefined' === typeof entity.type || 'string' === typeof entity.type, | ||
'entity.type must be a string or undefined'); | ||
'entity.type must be a string or undefined, got ' + JSON.stringify(entity.type)); | ||
assert('undefined' === typeof entity.properties || 'object' === typeof entity.properties, | ||
'entity.properties must be an object or undefined'); | ||
'entity.properties must be an object or undefined, got ' + JSON.stringify(entity.properties)); | ||
assert('undefined' === typeof entity.class || Array.isArray(entity.class), | ||
'entity.class must be an array or undefined'); | ||
'entity.class must be an array or undefined, got ' + JSON.stringify(entity.class)); | ||
assert('undefined' === typeof entity.actions || Array.isArray(entity.actions), | ||
'entity.actions must be an array or undefined'); | ||
'entity.actions must be an array or undefined, got ' + JSON.stringify(entity.actions)); | ||
assert('undefined' === typeof entity.links || Array.isArray(entity.links), | ||
'entity.links must be an array or undefined'); | ||
'entity.links must be an array or undefined, got ' + JSON.stringify(entity.links)); | ||
assert('undefined' === typeof entity.entities || Array.isArray(entity.entities), | ||
'entity.entities must be an array or undefined'); | ||
'entity.entities must be an array or undefined, got ' + JSON.stringify(entity.entities)); | ||
@@ -129,3 +129,4 @@ if (entity.rel) { | ||
// Subentities must have a rel array | ||
assert(Array.isArray(subEntity.rel)); | ||
assert(Array.isArray(subEntity.rel), | ||
'sub-entities must have a rel array, got ' + JSON.stringify(subEntity.rel)); | ||
@@ -132,0 +133,0 @@ let subEntityInstance; |
@@ -37,11 +37,11 @@ 'use strict'; | ||
assert('object' === typeof field, 'field must be an object'); | ||
assert('string' === typeof field.name, 'field.name must be a string'); | ||
assert('object' === typeof field, 'field must be an object, got ' + JSON.stringify(field)); | ||
assert('string' === typeof field.name, 'field.name must be a string, got ' + JSON.stringify(field.name)); | ||
assert('undefined' === typeof field.class || Array.isArray(field.class), | ||
'field.class must be an array or undefined'); | ||
'field.class must be an array or undefined, got ' + JSON.stringify(field.class)); | ||
assert('undefined' === typeof field.type | ||
|| ('string' === typeof field.type && VALID_TYPES.indexOf(field.type.toLowerCase()) > -1), | ||
'field.type must be a valid field type string or undefined'); | ||
'field.type must be a valid field type string or undefined, got ' + JSON.stringify(field.type)); | ||
assert('undefined' === typeof field.title || 'string' === typeof field.title, | ||
'field.title must be a string or undefined'); | ||
'field.title must be a string or undefined, got ' + JSON.stringify(field.title)); | ||
@@ -48,0 +48,0 @@ this.name = field.name; |
@@ -15,11 +15,11 @@ 'use strict'; | ||
assert('object' === typeof link, 'link must be an object'); | ||
assert(Array.isArray(link.rel), 'link.rel must be an array'); | ||
assert('string' === typeof link.href, 'link.href must be a string'); | ||
assert('object' === typeof link, 'link must be an object, got ' + JSON.stringify(link)); | ||
assert(Array.isArray(link.rel), 'link.rel must be an array, got ' + JSON.stringify(link.rel)); | ||
assert('string' === typeof link.href, 'link.href must be a string, got ' + JSON.stringify(link.href)); | ||
assert('undefined' === typeof link.class || Array.isArray(link.class), | ||
'link.class must be an array or undefined'); | ||
'link.class must be an array or undefined, got ' + JSON.stringify(link.class)); | ||
assert('undefined' === typeof link.title || 'string' === typeof link.title, | ||
'link.title must be a string or undefined'); | ||
'link.title must be a string or undefined, got ' + JSON.stringify(link.title)); | ||
assert('undefined' === typeof link.type || 'string' === typeof link.type, | ||
'link.type must be a string or undefined'); | ||
'link.type must be a string or undefined, got ' + JSON.stringify(link.type)); | ||
@@ -26,0 +26,0 @@ this.rel = link.rel; |
52526
704