node-win32-api icon indicating copy to clipboard operation
node-win32-api copied to clipboard

way return '' => return;

Open LFF5644 opened this issue 2 years ago • 6 comments

https://github.com/waitingsong/node-win32-api/blob/22239e83db6f3725ce95677f3f23ae25a1991899/packages/win32-api/demo/create_window.ts#L165-L165 way you use return ''; you can also use return;

LFF5644 avatar May 29 '23 17:05 LFF5644

Because declare return type of changeTitle() is string

https://github.com/waitingsong/node-win32-api/blob/22239e83db6f3725ce95677f3f23ae25a1991899/packages/win32-api/demo/create_window.ts#L154

waitingsong avatar May 30 '23 03:05 waitingsong

What string is it returning? What is the meaning of the returned string?

L3P3 avatar May 30 '23 20:05 L3P3

It should return new title string , but not implemeted yet ....

    else {
      // const tt = getTitle(handle)
      return ''
    }

waitingsong avatar May 31 '23 08:05 waitingsong

What would be the point of returning the value of a setter? I think setters should always return nothing or maybe success/failure if applicable. Or are you referencing something?

L3P3 avatar May 31 '23 09:05 L3P3

The new title may not equal to the input value completely, due to length, case or some thing others. Then developer can validate action result strictly, not only title write.

waitingsong avatar Jun 01 '23 02:06 waitingsong

I see. If it was my library, I would offer a getTitle but its not, go for it. :sweat_smile:

L3P3 avatar Jun 01 '23 13:06 L3P3