Skip to content

Commit

Permalink
refactor(types)!: remove ANY
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed May 12, 2023
1 parent 7ebb707 commit 1a41ed2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 43 deletions.
12 changes: 0 additions & 12 deletions src/types/__tests__/any.spec-d.ts

This file was deleted.

5 changes: 2 additions & 3 deletions src/types/__tests__/fixme.spec-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
* @module tutils/types/tests/unit-d/FIXME
*/

import type ANY from '../any'
import type TestSubject from '../fixme'

describe('unit-d:types/FIXME', () => {
it('should equal type of ANY', () => {
expectTypeOf<TestSubject>().toEqualTypeOf<ANY>()
it('should equal any', () => {
expectTypeOf<TestSubject>().toBeAny()
})
})
11 changes: 5 additions & 6 deletions src/types/__tests__/fn.spec-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
* @module tutils/types/tests/unit-d/Fn
*/

import type ANY from '../any'
import type TestSubject from '../fn'

describe('unit-d:types/Fn', () => {
it('should be callable with Args', () => {
expectTypeOf<TestSubject>().parameters.toEqualTypeOf<ANY[]>()
it('should be callable with A', () => {
expectTypeOf<TestSubject>().parameters.toEqualTypeOf<any[]>()
expectTypeOf<TestSubject<[string]>>().parameters.toEqualTypeOf<[string]>()
})

it('should return Ret', () => {
expectTypeOf<TestSubject>().returns.toEqualTypeOf<ANY>()
expectTypeOf<TestSubject<ANY, string>>().returns.toBeString()
it('should return R', () => {
expectTypeOf<TestSubject>().returns.toBeAny()
expectTypeOf<TestSubject<any, string>>().returns.toBeString()
})
})
11 changes: 0 additions & 11 deletions src/types/any.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/types/fixme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
* @module tutils/types/FIXME
*/

import type ANY from './any'

/**
* Helper type indicating a type that needs a better type definition.
*/
type FIXME = ANY
type FIXME = any

export type { FIXME as default }
10 changes: 3 additions & 7 deletions src/types/fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
* @module tutils/types/Fn
*/

import type ANY from './any'

/**
* A function.
*
* @template Args - Arguments type
* @template Ret - Return type
* @template A - Arguments type
* @template R - Return type
*/
type Fn<Args extends ANY[] = ANY[], Ret extends ANY = ANY> = (
...args: Args
) => Ret
type Fn<A extends any[] = any[], R = any> = (...args: A) => R

export type { Fn as default }
1 change: 0 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* @module tutils/types
*/

export type { default as ANY } from './any'
export type { default as Booleanish } from './booleanish'
export type { default as BuiltIn } from './built-in'
export type { default as Class } from './class'
Expand Down

0 comments on commit 1a41ed2

Please sign in to comment.