Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
azf20 committed Jan 11, 2025
1 parent 77cb137 commit ad9f0d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/helia-http-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function httpGateway (opts: HeliaHTTPGatewayOptions): RouteOptions[] {

try {
let done = false
let value = undefined
let value

while (!done) {
({ done, value } = await raceSignal(reader.read(), options.signal))
Expand Down
9 changes: 5 additions & 4 deletions src/helia-rpc-api.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { createRequire } from 'module'
import { GC_TIMEOUT_MS, HEALTHCHECK_TIMEOUT_MS } from './constants.js'
import { getRequestAwareSignal } from './helia-server.js'
import type { VerifiedFetch } from '@helia/verified-fetch'
import type { FastifyReply, FastifyRequest, RouteOptions } from 'fastify'
import type { Helia } from 'helia'

const require = createRequire(import.meta.url)

const HELIA_RELEASE_INFO_API = (version: string): string => `https://api.github.com/repos/ipfs/helia/git/ref/tags/helia-v${version}`

export interface HeliaRPCAPIOptions {
Expand All @@ -22,9 +25,7 @@ export function rpcApi (opts: HeliaRPCAPIOptions): RouteOptions[] {
try {
if (heliaVersionInfo === undefined) {
log('fetching Helia version info')
const { default: packageJson } = await import('../../node_modules/helia/package.json', {
assert: { type: 'json' }
})
const packageJson = require('../../node_modules/helia/package.json')
const { version: heliaVersionString } = packageJson
log('helia version string:', heliaVersionString)

Expand All @@ -37,7 +38,7 @@ export function rpcApi (opts: HeliaRPCAPIOptions): RouteOptions[] {
}
} else {
// if this is not a next version, we will fetch the commit from github.
const ghResp = await (await fetch(HELIA_RELEASE_INFO_API(heliaVersionString))).json()
const ghResp = await (await fetch(HELIA_RELEASE_INFO_API(heliaVersionString as string))).json()
heliaVersionInfo = {
Version: heliaVersionString,
Commit: ghResp.object.sha.slice(0, 7)
Expand Down

0 comments on commit ad9f0d5

Please sign in to comment.