Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
* Modified by: Daniel Calvo - ATOS Research & Innovation
*/

const LOCATION_TYPE = 'geo:point';
const LOCATION_DEFAULT = '0, 0';
const DATETIME_TYPE = 'DateTime';
const DATETIME_DEFAULT = '1970-01-01T00:00:00.000Z';
const ATTRIBUTE_DEFAULT = ' ';

Expand All @@ -36,10 +34,18 @@ const ATTRIBUTE_DEFAULT = ' ';
* @return {String} A default value to use in the entity
*/
function getInitialValueForType(type) {
switch (type) {
case LOCATION_TYPE:
switch (type.toLowerCase()) {
case 'geoproperty':
return LOCATION_DEFAULT;
case DATETIME_TYPE:
Comment on lines -40 to -42
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any other usage of LOCATION_TYPE and DATETIME_TYPE (removed in this PR) appart of the ones in this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like it, so those statements are now redundant and can be removed. Fixed 9d65c09

case 'point':
return LOCATION_DEFAULT;
case 'geo:point':
return LOCATION_DEFAULT;
case 'datetime':
return DATETIME_DEFAULT;
case 'date':
return DATETIME_DEFAULT;
case 'time':
return DATETIME_DEFAULT;
default:
return ATTRIBUTE_DEFAULT;
Expand Down