Page MenuHomePhabricator

[faucet] Help typescript to infer the type of an empty array
ClosedPublic

Authored by Fabien on Oct 9 2024, 19:02.

Details

Summary

In the config file the originWhitelist array is documented as possibly empty. This means that typescript has to infer the type from [] which causes a compilation failure.

Test Plan

Empty the array and run npm run build.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Oct 9 2024, 19:02
bytesofman added a subscriber: bytesofman.

possibly overkill for this app, but you can see how config.ts defines an interface in token-server to handle this

This revision is now accepted and ready to land.Oct 9 2024, 19:49