mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
cleanup
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
type OptionError<T> := {
|
||||
option: T | null,
|
||||
message: String,
|
||||
type: "OptionError"
|
||||
}
|
||||
|
||||
type TypedError<T> := {
|
||||
message: String,
|
||||
type: T
|
||||
}
|
||||
|
||||
type ValidationError := {
|
||||
errors: Array<Error>,
|
||||
message: String,
|
||||
type: "ValidationError"
|
||||
}
|
||||
|
||||
error/option := (String, T) => OptionError<T>
|
||||
|
||||
error/typed := (args: {
|
||||
message: String,
|
||||
type: String,
|
||||
name?: String
|
||||
}) => (opts: Object) => TypedError<String>
|
||||
|
||||
error/validation := (Array<Error>) => ValidationError
|
||||
Reference in New Issue
Block a user