@jakubmazanec/error 2.0.1-593aae1 → 2.0.1-6cee770

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.
@@ -6,6 +6,6 @@ import { type CustomError, type CustomErrorOptions, type ErrorMessages } from '.
6
6
  *
7
7
  * @param errorName Error name.
8
8
  * @param errorMessages Object containing all possible error messages.
9
- * @return Class that implements {@linkcode CustomError}.
9
+ * @return Class that implements {@link CustomError}.
10
10
  */
11
11
  export declare function createCustomError<ErrorCode extends string>(errorName: string, errorMessages: ErrorMessages<ErrorCode>): new (code: ErrorCode, options?: CustomErrorOptions) => CustomError<ErrorCode | typeof UNKNOWN_ERROR>;
@@ -6,7 +6,7 @@ import { createErrorMessage } from './internals.js';
6
6
  *
7
7
  * @param errorName Error name.
8
8
  * @param errorMessages Object containing all possible error messages.
9
- * @return Class that implements {@linkcode CustomError}.
9
+ * @return Class that implements {@link CustomError}.
10
10
  */ export function createCustomError(errorName, errorMessages) {
11
11
  return class InternalCustomError extends Error {
12
12
  code;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/createCustomError.ts"],"sourcesContent":["import {INTERNAL_ERROR_MESSAGES, UNKNOWN_ERROR} from './constants.js';\nimport {createErrorMessage} from './internals.js';\nimport {type CustomError, type CustomErrorOptions, type ErrorMessages} from './types.js';\n\n/**\n * Function for creating custom error classes. Such custom error class properly subclasses built-in `Error` and simplifies\n * generating error messages via predefined error codes.\n *\n * @param errorName Error name.\n * @param errorMessages Object containing all possible error messages.\n * @return Class that implements {@linkcode CustomError}.\n */\nexport function createCustomError<ErrorCode extends string>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n): new (code: ErrorCode, options?: CustomErrorOptions) => CustomError<\n ErrorCode | typeof UNKNOWN_ERROR\n> {\n return class InternalCustomError extends Error implements CustomError<ErrorCode> {\n code: ErrorCode | typeof UNKNOWN_ERROR;\n\n constructor(errorCode: ErrorCode, options?: CustomErrorOptions) {\n let errorMessage = createErrorMessage(errorCode, errorMessages, options?.messageParameters);\n let errorOptions: ErrorOptions = {};\n\n if (typeof options?.cause !== 'undefined') {\n errorOptions.cause = options.cause;\n }\n\n super(errorMessage, errorOptions);\n\n this.code = errorCode;\n this.name = errorName;\n\n // if the message is empty, we are making this an unknown error\n if (!this.message) {\n this.code = UNKNOWN_ERROR;\n this.message = createErrorMessage(UNKNOWN_ERROR, INTERNAL_ERROR_MESSAGES);\n }\n }\n };\n}\n"],"names":["INTERNAL_ERROR_MESSAGES","UNKNOWN_ERROR","createErrorMessage","createCustomError","errorName","errorMessages","InternalCustomError","Error","code","constructor","errorCode","options","errorMessage","messageParameters","errorOptions","cause","name","message"],"mappings":"AAAA,SAAQA,uBAAuB,EAAEC,aAAa,QAAO,iBAAiB;AACtE,SAAQC,kBAAkB,QAAO,iBAAiB;AAGlD;;;;;;;CAOC,GACD,OAAO,SAASC,kBACdC,SAAiB,EACjBC,aAAuC;IAIvC,OAAO,MAAMC,4BAA4BC;QACvCC,KAAuC;QAEvCC,YAAYC,SAAoB,EAAEC,OAA4B,CAAE;gBACEA,UAGrDA;YAHX,IAAIC,eAAeV,mBAAmBQ,WAAWL,gBAAeM,WAAAA,qBAAAA,+BAAAA,SAASE,iBAAiB;YAC1F,IAAIC,eAA6B,CAAC;YAElC,IAAI,SAAOH,YAAAA,qBAAAA,gCAAAA,UAASI,KAAK,MAAK,aAAa;gBACzCD,aAAaC,KAAK,GAAGJ,QAAQI,KAAK;YACpC;YAEA,KAAK,CAACH,cAAcE;YAEpB,IAAI,CAACN,IAAI,GAAGE;YACZ,IAAI,CAACM,IAAI,GAAGZ;YAEZ,+DAA+D;YAC/D,IAAI,CAAC,IAAI,CAACa,OAAO,EAAE;gBACjB,IAAI,CAACT,IAAI,GAAGP;gBACZ,IAAI,CAACgB,OAAO,GAAGf,mBAAmBD,eAAeD;YACnD;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../src/createCustomError.ts"],"sourcesContent":["import {INTERNAL_ERROR_MESSAGES, UNKNOWN_ERROR} from './constants.js';\nimport {createErrorMessage} from './internals.js';\nimport {type CustomError, type CustomErrorOptions, type ErrorMessages} from './types.js';\n\n/**\n * Function for creating custom error classes. Such custom error class properly subclasses built-in `Error` and simplifies\n * generating error messages via predefined error codes.\n *\n * @param errorName Error name.\n * @param errorMessages Object containing all possible error messages.\n * @return Class that implements {@link CustomError}.\n */\nexport function createCustomError<ErrorCode extends string>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n): new (code: ErrorCode, options?: CustomErrorOptions) => CustomError<\n ErrorCode | typeof UNKNOWN_ERROR\n> {\n return class InternalCustomError extends Error implements CustomError<ErrorCode> {\n code: ErrorCode | typeof UNKNOWN_ERROR;\n\n constructor(errorCode: ErrorCode, options?: CustomErrorOptions) {\n let errorMessage = createErrorMessage(errorCode, errorMessages, options?.messageParameters);\n let errorOptions: ErrorOptions = {};\n\n if (typeof options?.cause !== 'undefined') {\n errorOptions.cause = options.cause;\n }\n\n super(errorMessage, errorOptions);\n\n this.code = errorCode;\n this.name = errorName;\n\n // if the message is empty, we are making this an unknown error\n if (!this.message) {\n this.code = UNKNOWN_ERROR;\n this.message = createErrorMessage(UNKNOWN_ERROR, INTERNAL_ERROR_MESSAGES);\n }\n }\n };\n}\n"],"names":["INTERNAL_ERROR_MESSAGES","UNKNOWN_ERROR","createErrorMessage","createCustomError","errorName","errorMessages","InternalCustomError","Error","code","constructor","errorCode","options","errorMessage","messageParameters","errorOptions","cause","name","message"],"mappings":"AAAA,SAAQA,uBAAuB,EAAEC,aAAa,QAAO,iBAAiB;AACtE,SAAQC,kBAAkB,QAAO,iBAAiB;AAGlD;;;;;;;CAOC,GACD,OAAO,SAASC,kBACdC,SAAiB,EACjBC,aAAuC;IAIvC,OAAO,MAAMC,4BAA4BC;QACvCC,KAAuC;QAEvCC,YAAYC,SAAoB,EAAEC,OAA4B,CAAE;gBACEA,UAGrDA;YAHX,IAAIC,eAAeV,mBAAmBQ,WAAWL,gBAAeM,WAAAA,qBAAAA,+BAAAA,SAASE,iBAAiB;YAC1F,IAAIC,eAA6B,CAAC;YAElC,IAAI,SAAOH,YAAAA,qBAAAA,gCAAAA,UAASI,KAAK,MAAK,aAAa;gBACzCD,aAAaC,KAAK,GAAGJ,QAAQI,KAAK;YACpC;YAEA,KAAK,CAACH,cAAcE;YAEpB,IAAI,CAACN,IAAI,GAAGE;YACZ,IAAI,CAACM,IAAI,GAAGZ;YAEZ,+DAA+D;YAC/D,IAAI,CAAC,IAAI,CAACa,OAAO,EAAE;gBACjB,IAAI,CAACT,IAAI,GAAGP;gBACZ,IAAI,CAACgB,OAAO,GAAGf,mBAAmBD,eAAeD;YACnD;QACF;IACF;AACF"}
@@ -8,7 +8,7 @@ import { type CustomErrorWithData, type CustomErrorWithDataOptions, type ErrorMe
8
8
  * @param errorName Error name.
9
9
  * @param errorMessages Object containing all possible error messages.
10
10
  * @param errorData Runtime representation of the `ErrorData` type parameter; can be either a class expression, or a Zod schema.
11
- * @return Class that implements {@linkcode CustomErrorWithData}.
11
+ * @return Class that implements {@link CustomErrorWithData}.
12
12
  */
13
13
  export declare function createCustomErrorWithData<ErrorCode extends string, ErrorData extends AnyZodObject>(errorName: string, errorMessages: ErrorMessages<ErrorCode>, errorData: ErrorData): new (code: ErrorCode, options?: CustomErrorWithDataOptions<z.infer<ErrorData>>) => CustomErrorWithData<ErrorCode | typeof UNKNOWN_ERROR, z.infer<ErrorData>>;
14
14
  export declare function createCustomErrorWithData<ErrorCode extends string, ErrorData extends abstract new (...args: any) => any>(errorName: string, errorMessages: ErrorMessages<ErrorCode>, errorData: ErrorData): new (code: ErrorCode, options?: CustomErrorWithDataOptions<InstanceType<ErrorData>>) => CustomErrorWithData<ErrorCode | typeof UNKNOWN_ERROR, InstanceType<ErrorData>>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/createCustomErrorWithData.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- needed */\nimport {type z, type AnyZodObject} from 'zod';\n\nimport {INTERNAL_ERROR_MESSAGES, UNKNOWN_ERROR} from './constants.js';\nimport {createErrorMessage} from './internals.js';\nimport {\n type CustomErrorWithData,\n type CustomErrorWithDataOptions,\n type ErrorMessages,\n} from './types.js';\n\n/**\n * Function for creating custom error classes. Such custom error class properly subclasses built-in `Error`, simplifies\n * generating error messages via predefined error codes and allows attaching custom data to the error instance.\n *\n * @param errorName Error name.\n * @param errorMessages Object containing all possible error messages.\n * @param errorData Runtime representation of the `ErrorData` type parameter; can be either a class expression, or a Zod schema.\n * @return Class that implements {@linkcode CustomErrorWithData}.\n */\nexport function createCustomErrorWithData<ErrorCode extends string, ErrorData extends AnyZodObject>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n errorData: ErrorData,\n): new (\n code: ErrorCode,\n options?: CustomErrorWithDataOptions<z.infer<ErrorData>>,\n) => CustomErrorWithData<ErrorCode | typeof UNKNOWN_ERROR, z.infer<ErrorData>>;\nexport function createCustomErrorWithData<\n ErrorCode extends string,\n ErrorData extends abstract new (...args: any) => any,\n>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n errorData: ErrorData,\n): new (\n code: ErrorCode,\n options?: CustomErrorWithDataOptions<InstanceType<ErrorData>>,\n) => CustomErrorWithData<ErrorCode | typeof UNKNOWN_ERROR, InstanceType<ErrorData>>;\nexport function createCustomErrorWithData<ErrorCode extends string, ErrorData>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n errorData: ErrorData,\n): new (code: ErrorCode, options?: CustomErrorWithDataOptions<ErrorData>) => CustomErrorWithData<\n ErrorCode | typeof UNKNOWN_ERROR,\n ErrorData\n> {\n return class InternalCustomError\n extends Error\n implements CustomErrorWithData<ErrorCode, ErrorData>\n {\n code: ErrorCode | typeof UNKNOWN_ERROR;\n data?: ErrorData;\n\n constructor(errorCode: ErrorCode, options?: CustomErrorWithDataOptions<ErrorData>) {\n let errorMessage = createErrorMessage(errorCode, errorMessages, options?.messageParameters);\n let errorOptions: ErrorOptions = {};\n\n if (typeof options?.cause !== 'undefined') {\n errorOptions.cause = options.cause;\n }\n\n super(errorMessage, errorOptions);\n\n this.code = errorCode;\n this.name = errorName;\n\n if (typeof options?.data !== 'undefined') {\n this.data = options.data;\n }\n\n // if the message is empty, we are making this an unknown error\n if (!this.message) {\n this.code = UNKNOWN_ERROR;\n this.message = createErrorMessage(UNKNOWN_ERROR, INTERNAL_ERROR_MESSAGES);\n }\n }\n };\n}\n"],"names":["INTERNAL_ERROR_MESSAGES","UNKNOWN_ERROR","createErrorMessage","createCustomErrorWithData","errorName","errorMessages","errorData","InternalCustomError","Error","code","data","constructor","errorCode","options","errorMessage","messageParameters","errorOptions","cause","name","message"],"mappings":"AAAA,+DAA+D,GAG/D,SAAQA,uBAAuB,EAAEC,aAAa,QAAO,iBAAiB;AACtE,SAAQC,kBAAkB,QAAO,iBAAiB;AAmClD,OAAO,SAASC,0BACdC,SAAiB,EACjBC,aAAuC,EACvCC,SAAoB;IAKpB,OAAO,MAAMC,4BACHC;QAGRC,KAAuC;QACvCC,KAAiB;QAEjBC,YAAYC,SAAoB,EAAEC,OAA+C,CAAE;gBACjBA,UAGrDA,WASAA;YAZX,IAAIC,eAAeZ,mBAAmBU,WAAWP,gBAAeQ,WAAAA,qBAAAA,+BAAAA,SAASE,iBAAiB;YAC1F,IAAIC,eAA6B,CAAC;YAElC,IAAI,SAAOH,YAAAA,qBAAAA,gCAAAA,UAASI,KAAK,MAAK,aAAa;gBACzCD,aAAaC,KAAK,GAAGJ,QAAQI,KAAK;YACpC;YAEA,KAAK,CAACH,cAAcE;YAEpB,IAAI,CAACP,IAAI,GAAGG;YACZ,IAAI,CAACM,IAAI,GAAGd;YAEZ,IAAI,SAAOS,YAAAA,qBAAAA,gCAAAA,UAASH,IAAI,MAAK,aAAa;gBACxC,IAAI,CAACA,IAAI,GAAGG,QAAQH,IAAI;YAC1B;YAEA,+DAA+D;YAC/D,IAAI,CAAC,IAAI,CAACS,OAAO,EAAE;gBACjB,IAAI,CAACV,IAAI,GAAGR;gBACZ,IAAI,CAACkB,OAAO,GAAGjB,mBAAmBD,eAAeD;YACnD;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../src/createCustomErrorWithData.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any -- needed */\nimport {type z, type AnyZodObject} from 'zod';\n\nimport {INTERNAL_ERROR_MESSAGES, UNKNOWN_ERROR} from './constants.js';\nimport {createErrorMessage} from './internals.js';\nimport {\n type CustomErrorWithData,\n type CustomErrorWithDataOptions,\n type ErrorMessages,\n} from './types.js';\n\n/**\n * Function for creating custom error classes. Such custom error class properly subclasses built-in `Error`, simplifies\n * generating error messages via predefined error codes and allows attaching custom data to the error instance.\n *\n * @param errorName Error name.\n * @param errorMessages Object containing all possible error messages.\n * @param errorData Runtime representation of the `ErrorData` type parameter; can be either a class expression, or a Zod schema.\n * @return Class that implements {@link CustomErrorWithData}.\n */\nexport function createCustomErrorWithData<ErrorCode extends string, ErrorData extends AnyZodObject>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n errorData: ErrorData,\n): new (\n code: ErrorCode,\n options?: CustomErrorWithDataOptions<z.infer<ErrorData>>,\n) => CustomErrorWithData<ErrorCode | typeof UNKNOWN_ERROR, z.infer<ErrorData>>;\nexport function createCustomErrorWithData<\n ErrorCode extends string,\n ErrorData extends abstract new (...args: any) => any,\n>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n errorData: ErrorData,\n): new (\n code: ErrorCode,\n options?: CustomErrorWithDataOptions<InstanceType<ErrorData>>,\n) => CustomErrorWithData<ErrorCode | typeof UNKNOWN_ERROR, InstanceType<ErrorData>>;\nexport function createCustomErrorWithData<ErrorCode extends string, ErrorData>(\n errorName: string,\n errorMessages: ErrorMessages<ErrorCode>,\n errorData: ErrorData,\n): new (code: ErrorCode, options?: CustomErrorWithDataOptions<ErrorData>) => CustomErrorWithData<\n ErrorCode | typeof UNKNOWN_ERROR,\n ErrorData\n> {\n return class InternalCustomError\n extends Error\n implements CustomErrorWithData<ErrorCode, ErrorData>\n {\n code: ErrorCode | typeof UNKNOWN_ERROR;\n data?: ErrorData;\n\n constructor(errorCode: ErrorCode, options?: CustomErrorWithDataOptions<ErrorData>) {\n let errorMessage = createErrorMessage(errorCode, errorMessages, options?.messageParameters);\n let errorOptions: ErrorOptions = {};\n\n if (typeof options?.cause !== 'undefined') {\n errorOptions.cause = options.cause;\n }\n\n super(errorMessage, errorOptions);\n\n this.code = errorCode;\n this.name = errorName;\n\n if (typeof options?.data !== 'undefined') {\n this.data = options.data;\n }\n\n // if the message is empty, we are making this an unknown error\n if (!this.message) {\n this.code = UNKNOWN_ERROR;\n this.message = createErrorMessage(UNKNOWN_ERROR, INTERNAL_ERROR_MESSAGES);\n }\n }\n };\n}\n"],"names":["INTERNAL_ERROR_MESSAGES","UNKNOWN_ERROR","createErrorMessage","createCustomErrorWithData","errorName","errorMessages","errorData","InternalCustomError","Error","code","data","constructor","errorCode","options","errorMessage","messageParameters","errorOptions","cause","name","message"],"mappings":"AAAA,+DAA+D,GAG/D,SAAQA,uBAAuB,EAAEC,aAAa,QAAO,iBAAiB;AACtE,SAAQC,kBAAkB,QAAO,iBAAiB;AAmClD,OAAO,SAASC,0BACdC,SAAiB,EACjBC,aAAuC,EACvCC,SAAoB;IAKpB,OAAO,MAAMC,4BACHC;QAGRC,KAAuC;QACvCC,KAAiB;QAEjBC,YAAYC,SAAoB,EAAEC,OAA+C,CAAE;gBACjBA,UAGrDA,WASAA;YAZX,IAAIC,eAAeZ,mBAAmBU,WAAWP,gBAAeQ,WAAAA,qBAAAA,+BAAAA,SAASE,iBAAiB;YAC1F,IAAIC,eAA6B,CAAC;YAElC,IAAI,SAAOH,YAAAA,qBAAAA,gCAAAA,UAASI,KAAK,MAAK,aAAa;gBACzCD,aAAaC,KAAK,GAAGJ,QAAQI,KAAK;YACpC;YAEA,KAAK,CAACH,cAAcE;YAEpB,IAAI,CAACP,IAAI,GAAGG;YACZ,IAAI,CAACM,IAAI,GAAGd;YAEZ,IAAI,SAAOS,YAAAA,qBAAAA,gCAAAA,UAASH,IAAI,MAAK,aAAa;gBACxC,IAAI,CAACA,IAAI,GAAGG,QAAQH,IAAI;YAC1B;YAEA,+DAA+D;YAC/D,IAAI,CAAC,IAAI,CAACS,OAAO,EAAE;gBACjB,IAAI,CAACV,IAAI,GAAGR;gBACZ,IAAI,CAACkB,OAAO,GAAGjB,mBAAmBD,eAAeD;YACnD;QACF;IACF;AACF"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type representing options object used when instantianting class returned from {@linkcode createCustomError}.
2
+ * Type representing options object used when instantianting class returned from {@link createCustomError}.
3
3
  */
4
4
  export type CustomErrorOptions = {
5
5
  /** Array of values that are used as parameters to generate the error message. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type representing options object used when instantianting class returned from {@linkcode createCustomError}.
2
+ * Type representing options object used when instantianting class returned from {@link createCustomError}.
3
3
  */ export { };
4
4
 
5
5
  //# sourceMappingURL=CustomErrorOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/CustomErrorOptions.ts"],"sourcesContent":["/**\n * Type representing options object used when instantianting class returned from {@linkcode createCustomError}.\n */\nexport type CustomErrorOptions = {\n /** Array of values that are used as parameters to generate the error message. */\n messageParameters?: unknown[];\n\n /** Used for setting `cause` property of an error instance that indicates the specific original cause of the error. */\n cause?: unknown;\n};\n"],"names":[],"mappings":"AAAA;;CAEC,GACD,WAME"}
1
+ {"version":3,"sources":["../../src/types/CustomErrorOptions.ts"],"sourcesContent":["/**\n * Type representing options object used when instantianting class returned from {@link createCustomError}.\n */\nexport type CustomErrorOptions = {\n /** Array of values that are used as parameters to generate the error message. */\n messageParameters?: unknown[];\n\n /** Used for setting `cause` property of an error instance that indicates the specific original cause of the error. */\n cause?: unknown;\n};\n"],"names":[],"mappings":"AAAA;;CAEC,GACD,WAME"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type representing options object used when instantianting class returned from {@linkcode createCustomErrorWithData}.
2
+ * Type representing options object used when instantianting class returned from {@link createCustomErrorWithData}.
3
3
  */
4
4
  export type CustomErrorWithDataOptions<ErrorData> = {
5
5
  /** Array of values that are used as parameters to generate the error message. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type representing options object used when instantianting class returned from {@linkcode createCustomErrorWithData}.
2
+ * Type representing options object used when instantianting class returned from {@link createCustomErrorWithData}.
3
3
  */ export { };
4
4
 
5
5
  //# sourceMappingURL=CustomErrorWithDataOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/CustomErrorWithDataOptions.ts"],"sourcesContent":["/**\n * Type representing options object used when instantianting class returned from {@linkcode createCustomErrorWithData}.\n */\nexport type CustomErrorWithDataOptions<ErrorData> = {\n /** Array of values that are used as parameters to generate the error message. */\n messageParameters?: unknown[];\n\n /** Used for setting `cause` property of an error instance that indicates the specific original cause of the error. */\n cause?: unknown;\n\n /** Custom data that will be attached to the error instance. */\n data?: ErrorData;\n};\n"],"names":[],"mappings":"AAAA;;CAEC,GACD,WASE"}
1
+ {"version":3,"sources":["../../src/types/CustomErrorWithDataOptions.ts"],"sourcesContent":["/**\n * Type representing options object used when instantianting class returned from {@link createCustomErrorWithData}.\n */\nexport type CustomErrorWithDataOptions<ErrorData> = {\n /** Array of values that are used as parameters to generate the error message. */\n messageParameters?: unknown[];\n\n /** Used for setting `cause` property of an error instance that indicates the specific original cause of the error. */\n cause?: unknown;\n\n /** Custom data that will be attached to the error instance. */\n data?: ErrorData;\n};\n"],"names":[],"mappings":"AAAA;;CAEC,GACD,WASE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jakubmazanec/error",
3
- "version": "2.0.1-593aae1",
3
+ "version": "2.0.1-6cee770",
4
4
  "description": "Collection of utilities for creating and handling errors.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@ import {type CustomError, type CustomErrorOptions, type ErrorMessages} from './t
8
8
  *
9
9
  * @param errorName Error name.
10
10
  * @param errorMessages Object containing all possible error messages.
11
- * @return Class that implements {@linkcode CustomError}.
11
+ * @return Class that implements {@link CustomError}.
12
12
  */
13
13
  export function createCustomError<ErrorCode extends string>(
14
14
  errorName: string,
@@ -16,7 +16,7 @@ import {
16
16
  * @param errorName Error name.
17
17
  * @param errorMessages Object containing all possible error messages.
18
18
  * @param errorData Runtime representation of the `ErrorData` type parameter; can be either a class expression, or a Zod schema.
19
- * @return Class that implements {@linkcode CustomErrorWithData}.
19
+ * @return Class that implements {@link CustomErrorWithData}.
20
20
  */
21
21
  export function createCustomErrorWithData<ErrorCode extends string, ErrorData extends AnyZodObject>(
22
22
  errorName: string,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type representing options object used when instantianting class returned from {@linkcode createCustomError}.
2
+ * Type representing options object used when instantianting class returned from {@link createCustomError}.
3
3
  */
4
4
  export type CustomErrorOptions = {
5
5
  /** Array of values that are used as parameters to generate the error message. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Type representing options object used when instantianting class returned from {@linkcode createCustomErrorWithData}.
2
+ * Type representing options object used when instantianting class returned from {@link createCustomErrorWithData}.
3
3
  */
4
4
  export type CustomErrorWithDataOptions<ErrorData> = {
5
5
  /** Array of values that are used as parameters to generate the error message. */