Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/CreateDestroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ function ready(
} else if (descriptor.set != null) {
kind = 'set';
}
const f: Function = descriptor[kind];
type AnyFn = (...args: Array<unknown>) => unknown;
const f = descriptor[kind] as AnyFn;
if (typeof f !== 'function') {
throw new TypeError(`${key} is not a function`);
}
Expand Down
3 changes: 2 additions & 1 deletion src/CreateDestroyStartStop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ function ready(
} else if (descriptor.set != null) {
kind = 'set';
}
const f: Function = descriptor[kind];
type AnyFn = (...args: Array<unknown>) => unknown;
const f = descriptor[kind] as AnyFn;
if (typeof f !== 'function') {
throw new TypeError(`${key} is not a function`);
}
Expand Down
3 changes: 2 additions & 1 deletion src/StartStop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ function ready(
} else if (descriptor.set != null) {
kind = 'set';
}
const f: Function = descriptor[kind];
type AnyFn = (...args: Array<unknown>) => unknown;
const f = descriptor[kind] as AnyFn;
if (typeof f !== 'function') {
throw new TypeError(`${key} is not a function`);
}
Expand Down
5 changes: 4 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ function promise<T = void>(): PromiseDeconstructed<T> {
* This function rewrites the stack trace according to where the wrapped
* function is called, giving a more useful stack trace
*/
function resetStackTrace(error: Error, decorated?: Function): void {
function resetStackTrace(
error: Error,
decorated?: (...args: Array<unknown>) => unknown,
): void {
if (error.stack != null) {
const stackTitle = error.stack.slice(0, error.stack.indexOf('\n') + 1);
if (hasCaptureStackTrace) {
Expand Down