File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed
Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 44 */
55
66export { default as determineSpecificType } from './determine-specific-type'
7+ export * from './types'
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Unit Tests - MessageFn
3+ * @module create-node-error/types/tests/unit-d/MessageFn
4+ */
5+
6+ import type TestSubject from '../fn-message'
7+
8+ describe ( 'unit-d:types/MessageFn' , ( ) => {
9+ it ( 'should extract parameters from type parameter' , ( ) => {
10+ expectTypeOf < TestSubject < [ string ] > > ( ) . parameter ( 0 ) . toBeString ( )
11+ expectTypeOf < TestSubject < [ string , boolean ] > > ( ) . parameter ( 1 ) . toBeBoolean ( )
12+ } )
13+
14+ it ( 'should return string' , ( ) => {
15+ expectTypeOf < TestSubject > ( ) . returns . toBeString ( )
16+ } )
17+ } )
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Type Definitions - MessageFn
3+ * @module create-node-error/types/MessageFn
4+ */
5+
6+ /**
7+ * Formats an error message.
8+ *
9+ * @template Args - Function parameters
10+ *
11+ * @param {Args } args - Function parameters
12+ * @return {string } Formatted error message
13+ */
14+ type MessageFn < Args extends any [ ] = any [ ] > = ( ...args : Args ) => string
15+
16+ export type { MessageFn as default }
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Entry Point - Type Definitions
3+ * @module create-node-error/types
4+ */
5+
6+ export type { default as MessageFn } from './fn-message'
You can’t perform that action at this time.
0 commit comments