Skip to content

Commit

Permalink
Modernize codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Dec 16, 2024
1 parent 691e058 commit 6868f00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { join } from 'node:path';
import { promisify } from 'node:util';
import fs from 'node:fs';
import { readFile, stat } from 'node:fs/promises';
import * as core from '@actions/core';

const stat = promisify(fs.stat);
const readFile = promisify(fs.readFile);

interface IPackage {
name?: string;
version?: string;
Expand All @@ -19,7 +15,7 @@ interface IPackage {
};
}

async function exists(path: fs.PathLike): Promise<boolean> {
async function exists(path: Parameters<typeof stat>[0]): Promise<boolean> {
try {
await stat(path);
return true;
Expand Down
4 changes: 2 additions & 2 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ExecSyncOptions, execSync } from 'child_process';
import { join, normalize } from 'path';
import { ExecSyncOptions, execSync } from 'node:child_process';
import { join, normalize } from 'node:path';

describe('Test Run', () => {
const runner = (options: ExecSyncOptions): void => {
Expand Down

0 comments on commit 6868f00

Please sign in to comment.