From 3b3eb119f05fbf7d4f7f3cd12ec8f76e598e5ea3 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 28 Mar 2024 11:45:08 +0700 Subject: [PATCH] fix: duplicate api definition (#2522) --- core/src/browser/fs.ts | 2 -- core/src/node/api/processors/fsExt.ts | 24 ------------------- core/src/types/api/index.ts | 2 -- .../tensorrt-llm-extension/src/node/index.ts | 2 -- 4 files changed, 30 deletions(-) diff --git a/core/src/browser/fs.ts b/core/src/browser/fs.ts index 92525c260e..164e3b6479 100644 --- a/core/src/browser/fs.ts +++ b/core/src/browser/fs.ts @@ -37,8 +37,6 @@ const readdirSync = (...args: any[]) => globalThis.core.api?.readdirSync(...args */ const mkdir = (...args: any[]) => globalThis.core.api?.mkdir(...args) -const mkdir = (...args: any[]) => global.core.api?.mkdir(...args) - /** * Removes a directory at the specified path. * @returns {Promise} A Promise that resolves when the directory is removed successfully. diff --git a/core/src/node/api/processors/fsExt.ts b/core/src/node/api/processors/fsExt.ts index 9b88cfef9f..4787da65b3 100644 --- a/core/src/node/api/processors/fsExt.ts +++ b/core/src/node/api/processors/fsExt.ts @@ -88,28 +88,4 @@ export class FSExt implements Processor { }) }) } - - mkdir(path: string): Promise { - return new Promise((resolve, reject) => { - fs.mkdir(path, { recursive: true }, (err) => { - if (err) { - reject(err) - } else { - resolve() - } - }) - }) - } - - rmdir(path: string): Promise { - return new Promise((resolve, reject) => { - fs.rm(path, { recursive: true }, (err) => { - if (err) { - reject(err) - } else { - resolve() - } - }) - }) - } } diff --git a/core/src/types/api/index.ts b/core/src/types/api/index.ts index 58bd860b7a..91d6ae755a 100644 --- a/core/src/types/api/index.ts +++ b/core/src/types/api/index.ts @@ -95,8 +95,6 @@ export enum FileManagerRoute { getUserHomePath = 'getUserHomePath', fileStat = 'fileStat', writeBlob = 'writeBlob', - mkdir = 'mkdir', - rm = 'rm', } export type ApiFunction = (...args: any[]) => any diff --git a/extensions/tensorrt-llm-extension/src/node/index.ts b/extensions/tensorrt-llm-extension/src/node/index.ts index 269250d199..4dad464da6 100644 --- a/extensions/tensorrt-llm-extension/src/node/index.ts +++ b/extensions/tensorrt-llm-extension/src/node/index.ts @@ -9,8 +9,6 @@ import { PromptTemplate, } from '@janhq/core/node' import decompress from 'decompress' -import { SystemInformation } from '@janhq/core' -import { PromptTemplate } from '@janhq/core' // Polyfill fetch with retry const fetchRetry = fetchRT(fetch)