main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
606 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { IterationOf } from '../Iteration/IterationOf';
|
---|
| 2 | import { Iteration } from '../Iteration/Iteration';
|
---|
| 3 | /**
|
---|
| 4 | * @hidden
|
---|
| 5 | */
|
---|
| 6 | export declare type _IsNegative<N extends Iteration> = {
|
---|
| 7 | '-': 1;
|
---|
| 8 | '+': 0;
|
---|
| 9 | '0': 0;
|
---|
| 10 | }[N[1]];
|
---|
| 11 | /**
|
---|
| 12 | * Check whether a [[Number]] is negative or not
|
---|
| 13 | * @param N to check
|
---|
| 14 | * @returns [[Boolean]]
|
---|
| 15 | * @example
|
---|
| 16 | * ```ts
|
---|
| 17 | * import {N} from 'ts-toolbelt'
|
---|
| 18 | *
|
---|
| 19 | * type test0 = N.IsNegative<'0'> // False
|
---|
| 20 | * type test1 = N.IsNegative<'-7'> // True
|
---|
| 21 | * type test2 = N.IsNegative<'7'> // False
|
---|
| 22 | * ```
|
---|
| 23 | */
|
---|
| 24 | export declare type IsNegative<N extends number> = _IsNegative<IterationOf<N>>;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.