Skip to content

Commit

Permalink
fixup! chore(binding-http): enable eslint/strict-boolean-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Oct 3, 2023
1 parent 4f77d90 commit b0ee532
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/binding-http/src/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,15 @@ export default class HttpServer implements ProtocolServer {
form,
(tdTemplate.properties?.[propertyName] ?? {}) as PropertyElement
);
if (property.readOnly ?? false) {

const readOnly: boolean = property.readOnly ?? false;
const writeOnly: boolean = property.writeOnly ?? false;

if (readOnly) {
form.op = ["readproperty"];
const hform: HttpForm = form;
hform["htv:methodName"] ??= "GET";
} else if (property.writeOnly ?? false) {
} else if (writeOnly) {
form.op = ["writeproperty"];
const hform: HttpForm = form;
hform["htv:methodName"] ??= "PUT";
Expand Down

0 comments on commit b0ee532

Please sign in to comment.