Skip to content

Commit

Permalink
Merge pull request #57 from dxc-technology/fix-55
Browse files Browse the repository at this point in the history
Validation property value when 0 or empty string
  • Loading branch information
jsardid authored Aug 2, 2022
2 parents 42469f7 + e6dab07 commit 67df4e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/hal-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const HalResource = (existingRepresentation) => {
const addProperty = (property) => {
if (property.key !== "_links" && property.key !== "_options" && property.key !== "_embedded") {
property.key || requiredParam("key");
property.value || requiredParam("value");
property.value || property.value === 0 || property.value === "" || requiredParam("value");
resourceRepresentation[property.key] = property.value;
}
};
Expand Down Expand Up @@ -156,7 +156,7 @@ const HalResource = (existingRepresentation) => {
const addInteraction = (interaction) => {
createInteractionsSection();
interaction.rel || requiredParam("rel");
interaction.href || requiredParam("href")
interaction.href || requiredParam("href");
resourceRepresentation._options.links.push(interaction);
};

Expand Down

0 comments on commit 67df4e3

Please sign in to comment.