From 9d4e86229213ace8cec302d6275298f774fb93b2 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Thu, 16 Jul 2020 11:00:27 -0400 Subject: [PATCH] Fix `data` property definition in @feathersjs/errors `data` is described in TypeScript definitions as always defined property, while from [the actual implementation](https://github.com/feathersjs/feathers/blob/c838d8bc4b8a78cb90a2d299bfe4f7b6b8d8c2f8/packages/errors/lib/index.js#L8) it can be undefined. This PR fixes that definition to be according to actual code. --- packages/errors/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/errors/index.d.ts b/packages/errors/index.d.ts index ae1dff39e9..4c43f46427 100644 --- a/packages/errors/index.d.ts +++ b/packages/errors/index.d.ts @@ -3,14 +3,14 @@ export interface FeathersErrorJSON { readonly message: string; readonly code: number; readonly className: string; - readonly data: any; + readonly data?: any; readonly errors: any; } export class FeathersError extends Error { readonly code: number; readonly className: string; - readonly data: any; + readonly data?: unknown; readonly errors: any; constructor (msg: string | Error, name: string, code: number, className: string, data: any); toJSON (): FeathersErrorJSON;