Refactor replace some HTTP related magic values by enums.
This commit is contained in:
parent
c988227bc7
commit
15d3f45bae
9 changed files with 135 additions and 24 deletions
server/shared/types
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue