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