Skip to content

Commit 8f31616

Browse files
fix: error cast and spelling stuff
1 parent 1f9424e commit 8f31616

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/js-lib/src/decorators/debounce.decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function _Throttle<T extends AnyFunction>(
2828
/**
2929
* Like `@_Debounce`, but for async methods. Guarantees every call returns a real Promise that
3030
* resolves (or rejects) with the coalesced invocation's result, so the declared `Promise<T>` return
31-
* type stays accurate. Unlike `@_Debounce`, await`-ing a decorated method never silently yields
31+
* type stays accurate. Unlike `@_Debounce`, `await`-ing a decorated method never silently yields
3232
* `undefined`.
3333
*
3434
* @experimental

packages/js-lib/src/decorators/debounce.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { _anyToError } from '../error/error.util.js'
12
import { pDefer } from '../promise/pDefer.js'
23
import type { DeferredPromise } from '../promise/pDefer.js'
34
import type { AnyAsyncFunction, AnyFunction } from '../types.js'
@@ -207,7 +208,7 @@ export function _asyncDebounce<T extends AnyAsyncFunction>(
207208
const result = await func.apply(thisArg, args!)
208209
d.resolve(result)
209210
} catch (err) {
210-
d.reject(err as Error)
211+
d.reject(_anyToError(err))
211212
}
212213
}
213214

packages/js-lib/src/decorators/decorator.util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { AnyObject, InstanceId } from '../types.js'
22

33
/**
4-
* Generic override of Typescript's built in legacy MethodDecorator, that
4+
* Generic override of TypeScript's built-in legacy MethodDecorator, that
55
* allows us to infer the parameters of the decorated method from the parameters
66
* of a decorator.
77
*/

0 commit comments

Comments
 (0)