Skip to content

Commit

Permalink
Remove debug statements (+f9fc1874e2c0b0b6c486ae6a13e52bf09cef588d)
Browse files Browse the repository at this point in the history
Addresses [GH#5](#5).

Signed-off-by: William So <polyipseity@gmail.com>
  • Loading branch information
polyipseity committed Sep 22, 2023
1 parent a279334 commit b496460
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-ties-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"obsidian-modules": patch
---

Remove debug statements. Addresses [GH#5](https://github.com/polyipseity/obsidian-modules/issues/5). (+f9fc1874e2c0b0b6c486ae6a13e52bf09cef588d)
2 changes: 1 addition & 1 deletion sources/require/require.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ function createAndSetRequire(
if (args2[1]) { args2[1] = Object.assign(() => { }, args2[1]) }
return next.apply(this, args)
} catch (error) {
self0.console.debug(error)
/* @__PURE__ */ self0.console.debug(error)
return req(...args)
}
}, req) as unknown as NodeRequire
Expand Down
18 changes: 10 additions & 8 deletions sources/require/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export abstract class AbstractFileResolve
id: id0,
}
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
return null
}
}
Expand Down Expand Up @@ -370,7 +370,7 @@ export class InternalModulesResolve
try {
value = dynamicRequireSync(new Map(), id)
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
return null
}
return { code: "", id, value }
Expand All @@ -387,7 +387,7 @@ export class InternalModulesResolve
try {
value = await dynamicRequire(new Map(), id)
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
return null
}
return { code: "", id, value }
Expand Down Expand Up @@ -745,7 +745,7 @@ export class ExternalLinkResolve
ret.code = code
}
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
}
const { code, requires } =
await (await this.workerPool).exec<typeof parseAndRewriteRequire>(
Expand All @@ -755,8 +755,10 @@ export class ExternalLinkResolve
// eslint-disable-next-line require-atomic-updates
ret.code = code
await Promise.all(requires.map(async req => this.aresolve0(req)))
} catch (error) { self.console.debug(error) }
try { await compile() } catch (error) { self.console.debug(error) }
} catch (error) { /* @__PURE__ */ self.console.debug(error) }
try { await compile() } catch (error) {
/* @__PURE__ */ self.console.debug(error)
}
return ret
})(),
)
Expand Down Expand Up @@ -799,14 +801,14 @@ export class ExternalLinkResolve
.then(async val2 => {
try {
await this.invalidate0(href)
} catch (error) { self.console.debug(error) }
} catch (error) { /* @__PURE__ */ self.console.debug(error) }
return val2
})).url
this.redirects.set(href, val)
return val
})()
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
}
}
return href
Expand Down
2 changes: 1 addition & 1 deletion sources/require/transpile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace ContentHeader {
try {
ret = JSON.parse(json ?? "{}")
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
}
return fix(ret).value
}
Expand Down
4 changes: 2 additions & 2 deletions sources/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export function normalizeURL(id: string, cwd?: string): string | null {
({ href } = new URL(id, cwd))
if (!filter.test(href)) { href = null }
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
}
}
if (href === null) {
try {
({ href } = new URL(id))
if (!filter.test(href)) { href = null }
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
}
}
return href
Expand Down
2 changes: 1 addition & 1 deletion sources/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export async function parseAndRewriteRequire(
// eslint-disable-next-line no-new
new URL(value)
} catch (error) {
self.console.debug(error)
/* @__PURE__ */ self.console.debug(error)
prefix = "/"
}
}
Expand Down

0 comments on commit b496460

Please sign in to comment.