@tstdl/base 0.92.10 → 0.92.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/index.d.ts +2 -0
- package/ai/index.js +2 -0
- package/api/response.d.ts +1 -1
- package/api/response.js +1 -1
- package/package.json +1 -1
package/ai/index.d.ts
CHANGED
package/ai/index.js
CHANGED
package/api/response.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CustomError, type CustomErrorStatic } from '../errors/index.js';
|
|
2
2
|
import type { UndefinableJson } from '../types.js';
|
|
3
3
|
export type ErrorHandlerData = undefined | UndefinableJson;
|
|
4
4
|
export type ErrorSerializer<T extends CustomError, TData extends ErrorHandlerData> = (error: T) => TData;
|
package/api/response.js
CHANGED
|
@@ -28,7 +28,7 @@ export function createErrorResponse(errorOrName, message = '', details) {
|
|
|
28
28
|
let response;
|
|
29
29
|
if (errorOrName instanceof Error) {
|
|
30
30
|
const handler = errorHandlers.get(errorOrName.name);
|
|
31
|
-
if (handler
|
|
31
|
+
if (isDefined(handler)) {
|
|
32
32
|
const data = handler.serializer(errorOrName);
|
|
33
33
|
response = {
|
|
34
34
|
error: {
|