Leo Wandersleb on Nostr: JS doesn't care if the method would accept more parameters so it should be backwards ...
JS doesn't care if the method would accept more parameters so it should be backwards compatible or in other words, that extra parameter may be undefined in which case it would behave as before.
On the other hand as the client would need to be changed to take advantage of this, a new method could be introduced. It would just clutter the API if you had both `encrypt()` and `encryptWith()`.
Published at
2023-03-12 01:54:14Event JSON
{
"id": "b6d13e70bb6dd3f51aeeca1385ee4ed7607c98980ff6dbb38c08aa3af0ab4993",
"pubkey": "46fcbe3065eaf1ae7811465924e48923363ff3f526bd6f73d7c184b16bd8ce4d",
"created_at": 1678586054,
"kind": 1,
"tags": [
[
"e",
"aba3e8152d21160184ac1756f520b14ae4e86e62a904cf943d93520513c073f7",
"",
"root"
],
[
"e",
"8e82ab9c59c8f419098958a70c4f8f9c5af477e85440c9b55c8949b89c334600",
"",
"reply"
],
[
"p",
"fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"
]
],
"content": "JS doesn't care if the method would accept more parameters so it should be backwards compatible or in other words, that extra parameter may be undefined in which case it would behave as before.\n\nOn the other hand as the client would need to be changed to take advantage of this, a new method could be introduced. It would just clutter the API if you had both `encrypt()` and `encryptWith()`.",
"sig": "81aa05a57957b59c081b5a3143a791f3c61c157007a4f5fc9fbbc7a0524617fabd73d1cb7d88ec793fe722224001522c31b3bc57a57ffd5c6300189ce6e8af63"
}