chore: Add in some more types and tools

This commit is contained in:
BluJ
2022-10-24 10:29:40 -06:00
parent bc78461423
commit 0c36649e5a
3 changed files with 61 additions and 56 deletions

View File

@@ -15,3 +15,9 @@ export const exists = (
effects: T.Effects,
props: { path: string; volumeId: string },
) => effects.metadata(props).then((_) => true, (_) => false);
export const errorCode = (code: number, error: string) => ({
"error-code": [code, error] as const,
});
export const error = (error: string) => ({ error });
export const ok = { result: null };