starhs-models
Advanced tools
Comparing version 4.4.0 to 4.4.1
@@ -71,7 +71,4 @@ 'use strict'; | ||
value: function toJSON() { | ||
return { | ||
var d = { | ||
$context: this.$context.toString(), | ||
$links: this.$links.map(function (link) { | ||
return link.toJSON(); | ||
}), | ||
items: this.items.map(function (item) { | ||
@@ -85,2 +82,6 @@ return item.toJSON(); | ||
}; | ||
if (this.$links.length) d.$links = this.$links.map(function (link) { | ||
return link.toJSON(); | ||
}); | ||
return d; | ||
} | ||
@@ -99,3 +100,3 @@ | ||
(0, _tcomb.Function)(transformer); | ||
return new List(data.items.map(transformer), data.total, data.itemsPerPage, data.$links.map(_link.Link.fromJSON)); | ||
return new List(data.items.map(transformer), data.total, data.itemsPerPage, data.$links ? data.$links.map(_link.Link.fromJSON) : []); | ||
} | ||
@@ -102,0 +103,0 @@ |
@@ -53,9 +53,12 @@ 'use strict'; | ||
value: function toJSON() { | ||
return { | ||
var d = { | ||
$context: this.$context.toString(), | ||
$createdAt: this.$createdAt ? this.$createdAt.toISOString() : undefined, | ||
$updatedAt: this.$updatedAt ? this.$updatedAt.toISOString() : undefined, | ||
$deletedAt: this.$deletedAt ? this.$deletedAt.toISOString() : undefined, | ||
$links: this.$links | ||
$deletedAt: this.$deletedAt ? this.$deletedAt.toISOString() : undefined | ||
}; | ||
if (this.$links.length) d.$links = this.$links.map(function (link) { | ||
return link.toJSON(); | ||
}); | ||
return d; | ||
} | ||
@@ -62,0 +65,0 @@ |
{ | ||
"name": "starhs-models", | ||
"version": "4.4.0", | ||
"version": "4.4.1", | ||
"description": "Shared models for the staRHs API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30891
593