Skip to content

Commit

Permalink
Merge pull request #167 from Secreto31126/enumerable-bug
Browse files Browse the repository at this point in the history
Bug fix for defineProperty
  • Loading branch information
Secreto31126 authored Jun 14, 2023
2 parents 76e6caf + b082d5f commit 9948876
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whatsapp-api-js",
"version": "1.0.1",
"version": "1.0.2",
"author": "Secreto31126",
"description": "A TypeScript server agnostic Whatsapp's Official API framework",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion src/messages/contacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class Contacts extends ClientMessage {
if (component._many) {
if (!(name in contact)) {
Object.defineProperty(contact, name, {
value: [] as Address[] | Email[] | Phone[] | Url[]
value: [] as Address[] | Email[] | Phone[] | Url[],
enumerable: true
});
}

Expand Down
6 changes: 4 additions & 2 deletions src/messages/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ export class HeaderParameter {
}

Object.defineProperty(this, this.type, {
value: parameter
value: parameter,
enumerable: true
});
}
}
Expand Down Expand Up @@ -480,7 +481,8 @@ export class BodyParameter {
}

Object.defineProperty(this, this.type, {
value: parameter
value: parameter,
enumerable: true
});
}
}

0 comments on commit 9948876

Please sign in to comment.