aria-ng-gui-plugins-core
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,5 +1,8 @@ | ||
/// <reference types="node" /> | ||
import { PathLike } from "fs"; | ||
declare type fs = typeof import("fs").promises; | ||
export interface FsApiType extends fs { | ||
exists(path: PathLike): Promise<boolean>; | ||
} | ||
declare const FS: FsApiType; | ||
export default FS; |
@@ -5,3 +5,6 @@ "use strict"; | ||
try { | ||
return require("fs").promises; | ||
var fsPromises = require("fs").promises; | ||
var exists = require("fs").exists; | ||
fsPromises.exists = require("util").promisify(exists); | ||
return fsPromises; | ||
} | ||
@@ -8,0 +11,0 @@ catch (_) { |
@@ -20,3 +20,3 @@ import AsyncEventEmitter from "@xmader/async-event-emitter"; | ||
*/ | ||
"request-if-file-exists": (path: string) => boolean; | ||
"request-if-file-exists": (path: string) => boolean | Promise<boolean>; | ||
/** | ||
@@ -23,0 +23,0 @@ * 更新下载进度事件 |
{ | ||
"name": "aria-ng-gui-plugins-core", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "dist/main.js", | ||
@@ -5,0 +5,0 @@ "module": "src/main.ts", |
@@ -0,1 +1,2 @@ | ||
import { PathLike } from "fs" | ||
@@ -5,2 +6,3 @@ type fs = typeof import("fs").promises | ||
export interface FsApiType extends fs { | ||
exists(path: PathLike): Promise<boolean>; | ||
@@ -11,3 +13,8 @@ } | ||
try { | ||
return require("fs").promises | ||
const fsPromises: FsApiType = require("fs").promises | ||
const { exists } = require("fs") | ||
fsPromises.exists = require("util").promisify(exists) | ||
return fsPromises | ||
} catch (_) { | ||
@@ -14,0 +21,0 @@ throw new Error("unimplemented") |
@@ -32,3 +32,3 @@ | ||
*/ | ||
"request-if-file-exists": (path: string) => boolean, | ||
"request-if-file-exists": (path: string) => boolean | Promise<boolean>, | ||
@@ -35,0 +35,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11698
264
2