Refactor replace some HTTP related magic values by enums.

This commit is contained in:
baldo 2022-09-20 19:09:49 +02:00
parent c988227bc7
commit 15d3f45bae
9 changed files with 135 additions and 24 deletions
server/shared/types

View file

@ -68,6 +68,18 @@ export type Url = string & { readonly __tag: unique symbol };
*/
export const isUrl = toIsNewtype(isString, "" as Url);
/**
* Typesafe string representation of paths.
*/
export type Path = string & { readonly __tag: unique symbol };
/**
* Type guard for {@link Path}.
*
* @param arg - Value to check.
*/
export const isPath = toIsNewtype(isString, "" as Url);
/**
* Fastd VPN key of a Freifunk node. This is the key used by the node to open a VPN tunnel to Freifunk gateways.
*/