File tree Expand file tree Collapse file tree 4 files changed +57
-0
lines changed
Expand file tree Collapse file tree 4 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -570,6 +570,7 @@ This package is fully typed with [TypeScript][12]. It exports the following defi
570570
571571### Interfaces
572572
573+ - [ ` ErrInvalidUrl ` ] ( src/interfaces/err-invalid-url.ts )
573574- [ ` ErrnoException ` ] ( src/interfaces/errno-exception.ts )
574575
575576### Type Definitions
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Type Tests - ErrInvalidUrl
3+ * @module errnode/interfaces/tests/unit-d/ErrInvalidUrl
4+ */
5+
6+ import type { ErrorCode } from '#src/enums'
7+ import type { NodeError } from '#src/types'
8+ import type TestSubject from '../err-invalid-url'
9+
10+ describe ( 'unit-d:interfaces/ErrInvalidUrl' , ( ) => {
11+ it ( 'should extend NodeError<TypeError>' , ( ) => {
12+ expectTypeOf < TestSubject > ( ) . toMatchTypeOf < NodeError < TypeError > > ( )
13+ } )
14+
15+ it ( 'should match [code: ErrorCode.ERR_INVALID_URL]' , ( ) => {
16+ expectTypeOf < TestSubject > ( )
17+ . toHaveProperty ( 'code' )
18+ . toEqualTypeOf < ErrorCode . ERR_INVALID_URL > ( )
19+ } )
20+
21+ it ( 'should match [input: string]' , ( ) => {
22+ expectTypeOf < TestSubject > ( ) . toHaveProperty ( 'input' ) . toBeString ( )
23+ } )
24+ } )
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Interfaces - ErrInvalidUrl
3+ * @module errnode/interfaces/ErrInvalidUrl
4+ */
5+
6+ import type { ErrorCode } from '#src/enums'
7+ import type { NodeError } from '#src/types'
8+
9+ /**
10+ * [`ERR_INVALID_URL`][1] schema.
11+ *
12+ * [1]: https://nodejs.org/api/errors.html#err_invalid_url
13+ *
14+ * @extends {NodeError<TypeError> }
15+ */
16+ interface ErrInvalidUrl extends NodeError < TypeError > {
17+ /**
18+ * Error code.
19+ */
20+ code : ErrorCode . ERR_INVALID_URL
21+
22+ /**
23+ * URL that failed to parse.
24+ *
25+ * @example
26+ * 'http://[127.0.0.1\x00c8763]:8000/'
27+ */
28+ input : string
29+ }
30+
31+ export type { ErrInvalidUrl as default }
Original file line number Diff line number Diff line change 33 * @module errnode/interfaces
44 */
55
6+ export type { default as ErrInvalidUrl } from './err-invalid-url'
67export type { default as ErrnoException } from './errno-exception'
You can’t perform that action at this time.
0 commit comments