generated from tpl/purs
refactor: bun run fmt
This commit is contained in:
@@ -74,7 +74,8 @@ instance
|
||||
( MonadAff m
|
||||
, MonadSession (SessionT m)
|
||||
, MonadCursor (CursorT t (SessionT m)) t
|
||||
) => MonadPostgres
|
||||
) =>
|
||||
MonadPostgres
|
||||
(PostgresT m)
|
||||
(SessionT m)
|
||||
(CursorT ct (SessionT m))
|
||||
@@ -117,6 +118,7 @@ runPostgres cfg m =
|
||||
let
|
||||
acq :: RE Unit m Pool
|
||||
acq = liftEffect $ Pool.make @r @missing @trash cfg
|
||||
|
||||
rel :: _ -> Pool -> RE Unit m Unit
|
||||
rel _ p = RE.liftExcept $ hoist liftAff $ Pool.end p
|
||||
in
|
||||
|
||||
@@ -8,15 +8,16 @@ export const isInstanceOfBuffer = a => a instanceof Buffer
|
||||
|
||||
/** @type {(a: unknown) => boolean} */
|
||||
export const isInstanceOfInterval = a => {
|
||||
return typeof a === 'object'
|
||||
&& a !== null
|
||||
&& ('years' in a
|
||||
|| 'months' in a
|
||||
|| 'days' in a
|
||||
|| 'hours' in a
|
||||
|| 'minutes' in a
|
||||
|| 'seconds' in a
|
||||
|| 'milliseconds' in a
|
||||
return (
|
||||
typeof a === 'object' &&
|
||||
a !== null &&
|
||||
('years' in a ||
|
||||
'months' in a ||
|
||||
'days' in a ||
|
||||
'hours' in a ||
|
||||
'minutes' in a ||
|
||||
'seconds' in a ||
|
||||
'milliseconds' in a)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ spec =
|
||||
let
|
||||
durationFromGenInterval :: forall d. Semigroup d => Duration d => Newtype d Number => GenIntervalSubMonth -> d
|
||||
durationFromGenInterval = fromMaybe (wrap 0.0) <<< Interval.toDuration <<< unwrap
|
||||
|
||||
durationEq :: forall d. Duration d => Newtype d Number => d -> d -> Boolean
|
||||
durationEq a b = Number.abs (unwrap a - unwrap b) <= 0.001
|
||||
check @Milliseconds @GenIntervalSubMonth { purs: "Milliseconds", sql: "interval", fromArb: durationFromGenInterval, isEq: durationEq }
|
||||
|
||||
@@ -121,7 +121,8 @@ spec =
|
||||
either <-
|
||||
flip RE.toEither unit
|
||||
$ parSequence
|
||||
$ [ liftAff $ throwError $ Exn.error "a"
|
||||
$
|
||||
[ liftAff $ throwError $ Exn.error "a"
|
||||
, pure "a"
|
||||
]
|
||||
isLeft either `shouldEqual` true
|
||||
@@ -129,7 +130,8 @@ spec =
|
||||
either <-
|
||||
flip RE.toEither unit
|
||||
$ parOneOf
|
||||
$ [ liftAff $ throwError $ Exn.error "a"
|
||||
$
|
||||
[ liftAff $ throwError $ Exn.error "a"
|
||||
, liftAff $ throwError $ Exn.error "b"
|
||||
]
|
||||
isLeft either `shouldEqual` true
|
||||
|
||||
Reference in New Issue
Block a user