fix: remove debug statements
This commit is contained in:
@@ -120,70 +120,50 @@ export function createRESTNetworkRequestStream(
|
|||||||
TE.Do,
|
TE.Do,
|
||||||
|
|
||||||
// Get a deep clone of the request
|
// Get a deep clone of the request
|
||||||
TE.bind("req", () => {
|
TE.bind("req", () => TE.of(cloneDeep(request))),
|
||||||
debugger
|
|
||||||
return TE.of(cloneDeep(request))
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Assembling headers object
|
// Assembling headers object
|
||||||
TE.bind("headers", ({ req }) => {
|
TE.bind("headers", ({ req }) =>
|
||||||
debugger
|
TE.of(
|
||||||
return TE.of(
|
|
||||||
req.effectiveFinalHeaders.reduce((acc, { key, value }) => {
|
req.effectiveFinalHeaders.reduce((acc, { key, value }) => {
|
||||||
return Object.assign(acc, { [key]: value })
|
return Object.assign(acc, { [key]: value })
|
||||||
}, {})
|
}, {})
|
||||||
)
|
)
|
||||||
}),
|
),
|
||||||
|
|
||||||
// Assembling params object
|
// Assembling params object
|
||||||
TE.bind("params", ({ req }) => {
|
TE.bind("params", ({ req }) =>
|
||||||
debugger
|
TE.of(
|
||||||
return TE.of(
|
|
||||||
req.effectiveFinalParams.reduce((acc, { key, value }) => {
|
req.effectiveFinalParams.reduce((acc, { key, value }) => {
|
||||||
return Object.assign(acc, { [key]: value })
|
return Object.assign(acc, { [key]: value })
|
||||||
}, {})
|
}, {})
|
||||||
)
|
)
|
||||||
}),
|
),
|
||||||
|
|
||||||
// Keeping the backup start time
|
// Keeping the backup start time
|
||||||
TE.bind("backupTimeStart", () => {
|
TE.bind("backupTimeStart", () => TE.of(Date.now())),
|
||||||
debugger
|
|
||||||
return TE.of(Date.now())
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Running the request and getting the response
|
// Running the request and getting the response
|
||||||
TE.bind("res", ({ req, headers, params }) => {
|
TE.bind("res", ({ req, headers, params }) =>
|
||||||
debugger
|
runAppropriateStrategy({
|
||||||
return runAppropriateStrategy({
|
|
||||||
method: req.method as any,
|
method: req.method as any,
|
||||||
url: req.effectiveFinalURL,
|
url: req.effectiveFinalURL,
|
||||||
headers,
|
headers,
|
||||||
params,
|
params,
|
||||||
data: req.effectiveFinalBody,
|
data: req.effectiveFinalBody,
|
||||||
})
|
})
|
||||||
}),
|
),
|
||||||
|
|
||||||
// Getting the backup end time
|
// Getting the backup end time
|
||||||
TE.bind("backupTimeEnd", () => {
|
TE.bind("backupTimeEnd", () => TE.of(Date.now())),
|
||||||
debugger
|
|
||||||
return TE.of(Date.now())
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Assemble the final response object
|
// Assemble the final response object
|
||||||
TE.chainW(({ req, res, backupTimeEnd, backupTimeStart }) => {
|
TE.chainW(({ req, res, backupTimeEnd, backupTimeStart }) =>
|
||||||
debugger
|
processResponse(res, req, backupTimeStart, backupTimeEnd, "success")
|
||||||
return processResponse(
|
),
|
||||||
res,
|
|
||||||
req,
|
|
||||||
backupTimeStart,
|
|
||||||
backupTimeEnd,
|
|
||||||
"success"
|
|
||||||
)
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Writing success state to the stream
|
// Writing success state to the stream
|
||||||
TE.chain((res) => {
|
TE.chain((res) => {
|
||||||
debugger
|
|
||||||
response.next(res)
|
response.next(res)
|
||||||
response.complete()
|
response.complete()
|
||||||
|
|
||||||
@@ -192,7 +172,6 @@ export function createRESTNetworkRequestStream(
|
|||||||
|
|
||||||
// Package the error type
|
// Package the error type
|
||||||
TE.getOrElseW((e) => {
|
TE.getOrElseW((e) => {
|
||||||
debugger
|
|
||||||
const obj: HoppRESTResponse = {
|
const obj: HoppRESTResponse = {
|
||||||
type: "network_fail",
|
type: "network_fail",
|
||||||
error: e,
|
error: e,
|
||||||
|
|||||||
Reference in New Issue
Block a user