-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
e7da94f
commit 3632179
Showing
7 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @file Type Tests - Float | ||
* @module tutils/types/tests/unit-d/Float | ||
*/ | ||
|
||
import type TestSubject from '../float' | ||
import type { tag } from '../opaque' | ||
|
||
describe('unit-d:types/Float', () => { | ||
it('should extend number', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<number>() | ||
}) | ||
|
||
it('should match [readonly [tag]: "float"]', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<{ readonly [tag]: 'float' }>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @file Type Tests - Integer | ||
* @module tutils/types/tests/unit-d/Integer | ||
*/ | ||
|
||
import type TestSubject from '../integer' | ||
import type { tag } from '../opaque' | ||
|
||
describe('unit-d:types/Integer', () => { | ||
it('should extend number', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<number>() | ||
}) | ||
|
||
it('should match [readonly [tag]: "integer"]', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<{ readonly [tag]: 'integer' }>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @file Type Definitions - Float | ||
* @module tutils/types/Float | ||
*/ | ||
|
||
import type Opaque from './opaque' | ||
|
||
/** | ||
* A floating point number. | ||
* | ||
* @see https://computersciencewiki.org/index.php/float | ||
*/ | ||
type Float = Opaque<number, 'float'> | ||
|
||
export type { Float as default } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @file Type Definitions - Integer | ||
* @module tutils/types/Integer | ||
*/ | ||
|
||
import type Opaque from './opaque' | ||
|
||
/** | ||
* A number that can be negative, positive, or zero, but not a fraction (i.e. | ||
* cannot have a decimal point). | ||
* | ||
* @see https://computersciencewiki.org/index.php/int | ||
*/ | ||
type Integer = Opaque<number, 'integer'> | ||
|
||
export type { Integer as default } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters