Skip to content

Commit 2d1072f

Browse files
committed
🏷️ Fix types and ts configuration
1 parent a1552df commit 2d1072f

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

packages/async/src/clearImmediate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { ImmediateId } from './ImmediateId.js';
22

33
const __clearImmediate: (id: any) => void =
4-
globalThis.clearImmediate == null
4+
(globalThis as any).clearImmediate == null
55
? (id: any) => globalThis.clearTimeout(id)
6-
: (id: any) => Number(globalThis.clearImmediate(id));
6+
: (id: any) => Number((globalThis as any).clearImmediate(id));
77

88
/**
99
* A polyfill for {@link clearImmediate}

packages/async/src/setImmediate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { ImmediateId } from './ImmediateId.js';
22

33
const __setImmediate =
4-
globalThis.setImmediate == null
4+
(globalThis as any).setImmediate == null
55
? (fn: () => void) => globalThis.setTimeout(fn, 0)
6-
: (fn: () => void) => Number(globalThis.setImmediate(fn));
6+
: (fn: () => void) => Number((globalThis as any).setImmediate(fn));
77

88
/**
99
* A polyfill for {@link setImmediate}

packages/core/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "https://json.schemastore.org/tsconfig.json",
33
"extends": "../../tsconfig.settings.json",
44
"compilerOptions": {
5-
"rootDir": "./src"
5+
"rootDir": "./src",
6+
"types": ["node"]
67
}
78
}

packages/env/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig.json",
33
"extends": "../../tsconfig.settings.json",
4-
"compilerOptions": {}
4+
"compilerOptions": {
5+
"types": ["node"]
6+
}
57
}

packages/error/src/CustomError.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export const CustomError: CustomErrorConstructor = (() => {
9393
const errorName = 'CustomError';
9494
const __assign = Object.assign;
9595
const __create = Object.create;
96+
// eslint-disable-next-line ts/no-unsafe-function-type
97+
const __captureStackTrace = (Error as any).captureStackTrace ?? ((_targetObject: object, _constructorOpt?: Function | undefined) => {});
9698

9799
function CustomError<Properties extends { name: string; message?: string; cause?: unknown }>(
98100
this: any,
@@ -113,9 +115,7 @@ export const CustomError: CustomErrorConstructor = (() => {
113115
__assign(returnValue, properties);
114116

115117
// Capture stack trace
116-
if (typeof Error.captureStackTrace === 'function') {
117-
Error.captureStackTrace(returnValue, returnValue.constructor);
118-
}
118+
__captureStackTrace(returnValue, returnValue.constructor);
119119

120120
return returnValue as CustomError<Properties>;
121121
}

packages/system/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig.json",
33
"extends": "../../tsconfig.settings.json",
4-
"compilerOptions": {}
4+
"compilerOptions": {
5+
"types": ["node"]
6+
}
57
}

0 commit comments

Comments
 (0)