operation["op"].casecmp("replace") as it was in the code will allways return a "truthy" value, so it is useless for checking if the operation param is actually "replace". Checking if casecpm returns 0 solves this issue.
What?
Just changes operation["op"].casecmp("replace") for operation["op"].casecmp("replace") == 0.
Why?
operation["op"].casecmp("replace")
as it was in the code will allways return a "truthy" value, so it is useless for checking if the operation param is actually "replace". Checking ifcasecpm
returns 0 solves this issue.What?
Just changes
operation["op"].casecmp("replace")
foroperation["op"].casecmp("replace") == 0
.Caveats
None
Testing Notes
I don't think any specific testing is required.