o-p-n / serveit

MIT License
0 stars 1 forks source link

private => # #42

Open hildjj opened 1 day ago

hildjj commented 1 day ago

since you're using Deno and don't have to support old versions of node, you can safely use #get instead of private get. Typescript normally goes through some gyrations to make private fields/methods private, whereas it's built-in to the runtime with #.

https://github.com/o-p-n/serveit/blob/152c4566d68504350b2de8cac2037c98f20125e6/src/file-server.ts#L41

linuxwolf commented 1 day ago

Some of the "private" methods are actually mocked in tests, and # prevents that. I mostly used private to be consistent, realizing and accepting it's closer to hidden than actually inaccessible.

That said, could consider switching if viable replacement testing comes up.