Skip to content

Commit

Permalink
Comments only - avoid warning for node-specific imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemaccana committed Nov 6, 2024
1 parent e9f4bc9 commit 3f6e3e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/keypair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export const keypairToSecretKeyJSON = (keypair: Keypair): string => {
};

export const getKeypairFromFile = async (filepath?: string) => {
// Node-specific imports
// @ts-expect-error TODO: fix the warning rather than disabling it when we have time
const path = await import("node:path");
// Work out correct file name
if (!filepath) {
Expand All @@ -24,6 +26,8 @@ export const getKeypairFromFile = async (filepath?: string) => {
// Get contents of file
let fileContents: string;
try {
// Node-specific imports
// @ts-expect-error TODO: fix the warning rather than disabling it when we have time
const { readFile } = await import("node:fs/promises");
const fileContentsBuffer = await readFile(filepath);
fileContents = fileContentsBuffer.toString();
Expand Down Expand Up @@ -81,6 +85,8 @@ export const addKeypairToEnvFile = async (
variableName: string,
envFileName?: string,
) => {
// Node-specific imports
// @ts-expect-error TODO: fix the warning rather than disabling it when we have time
const { appendFile } = await import("node:fs/promises");
if (!envFileName) {
envFileName = ".env";
Expand Down

0 comments on commit 3f6e3e1

Please sign in to comment.