summaryrefslogtreecommitdiff
path: root/std/node/_util/_util_promisify.ts
diff options
context:
space:
mode:
authorJarrett Helton <jaydhelton@gmail.com>2020-08-12 17:32:03 -0400
committerGitHub <noreply@github.com>2020-08-12 17:32:03 -0400
commit514cbc2808754369f52c9f4baef97c16345d654b (patch)
treeb44ccfa3a713a77b4703754a056c9f64299896ae /std/node/_util/_util_promisify.ts
parentad4af23aba39e904ba9e2c284b6d06436b7b4f77 (diff)
fix: remove @ts-expect-error directives (#7024)
Diffstat (limited to 'std/node/_util/_util_promisify.ts')
-rw-r--r--std/node/_util/_util_promisify.ts22
1 files changed, 10 insertions, 12 deletions
diff --git a/std/node/_util/_util_promisify.ts b/std/node/_util/_util_promisify.ts
index 4daba8b74..03ebeba04 100644
--- a/std/node/_util/_util_promisify.ts
+++ b/std/node/_util/_util_promisify.ts
@@ -60,11 +60,10 @@ export function promisify(original: Function): Function {
if (typeof original !== "function") {
throw new NodeInvalidArgTypeError("original", "Function", original);
}
-
- // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
- if (original[kCustomPromisifiedSymbol]) {
- // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
- const fn = original[kCustomPromisifiedSymbol];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ if ((original as any)[kCustomPromisifiedSymbol]) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const fn = (original as any)[kCustomPromisifiedSymbol];
if (typeof fn !== "function") {
throw new NodeInvalidArgTypeError(
"util.promisify.custom",
@@ -82,12 +81,11 @@ export function promisify(original: Function): Function {
// Names to create an object from in case the callback receives multiple
// arguments, e.g. ['bytesRead', 'buffer'] for fs.read.
- // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
- const argumentNames = original[kCustomPromisifyArgsSymbol];
-
- function fn(...args: unknown[]): Promise<unknown> {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const argumentNames = (original as any)[kCustomPromisifyArgsSymbol];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ function fn(this: any, ...args: unknown[]): Promise<unknown> {
return new Promise((resolve, reject) => {
- // @ts-expect-error: 'this' implicitly has type 'any' because it does not have a type annotation
original.call(this, ...args, (err: Error, ...values: unknown[]) => {
if (err) {
return reject(err);
@@ -95,8 +93,8 @@ export function promisify(original: Function): Function {
if (argumentNames !== undefined && values.length > 1) {
const obj = {};
for (let i = 0; i < argumentNames.length; i++) {
- // @ts-expect-error TypeScript
- obj[argumentNames[i]] = values[i];
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (obj as any)[argumentNames[i]] = values[i];
}
resolve(obj);
} else {