-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logging): Added Storm logging package
- Loading branch information
1 parent
c069cda
commit 435748f
Showing
27 changed files
with
1,173 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
patreon: StormSoftware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from "./errors"; | ||
export * from "./is-storm-error"; | ||
export * from "./storm-error"; | ||
export * from "./utilities"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./is-storm-error"; |
16 changes: 8 additions & 8 deletions
16
packages/errors/src/is-storm-error.ts → ...es/errors/src/utilities/is-storm-error.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { isError } from "@storm-software/utilities/type-checks/is-error"; | ||
import { isSetString } from "@storm-software/utilities/type-checks/is-set-string"; | ||
import { StormError } from "./storm-error"; | ||
import { StormError } from "../storm-error"; | ||
|
||
/** | ||
* Type-check to determine if `obj` is a `StormError` object | ||
* | ||
* @param obj - the object to check | ||
* @param value - the object to check | ||
* @returns The function isStormError is returning a boolean value. | ||
*/ | ||
export function isStormError<TCode extends string = any>( | ||
obj: unknown | ||
): obj is StormError<TCode> { | ||
value: unknown | ||
): value is StormError<TCode> { | ||
return ( | ||
isError(obj) && | ||
isSetString((obj as unknown as StormError<TCode>)?.code) && | ||
isSetString((obj as unknown as StormError<TCode>)?.message) && | ||
isSetString((obj as unknown as StormError<TCode>)?.stack) | ||
isError(value) && | ||
isSetString((value as unknown as StormError<TCode>)?.code) && | ||
isSetString((value as unknown as StormError<TCode>)?.message) && | ||
isSetString((value as unknown as StormError<TCode>)?.stack) | ||
); | ||
} |
Oops, something went wrong.