Skip to content

Commit

Permalink
feat: Add assertWithError
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre committed Dec 28, 2021
1 parent a2de7ce commit 0e121c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/assert-with-error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export function assertWithError(
condition: unknown,
error: unknown,
): asserts condition {
if (!condition) {
throw error;
}
}
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './assert-with-error';
export * from './parse-resource-name';
export * from './not-empty';
export * from './not-empty';

0 comments on commit 0e121c6

Please sign in to comment.