ts-data-forge 11.0.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/README.md +2 -2
  2. package/dist/number/branded-types/finite-number.d.mts +47 -61
  3. package/dist/number/branded-types/finite-number.d.mts.map +1 -1
  4. package/dist/number/branded-types/finite-number.mjs +37 -41
  5. package/dist/number/branded-types/finite-number.mjs.map +1 -1
  6. package/dist/number/branded-types/int.d.mts +40 -46
  7. package/dist/number/branded-types/int.d.mts.map +1 -1
  8. package/dist/number/branded-types/int.mjs +29 -31
  9. package/dist/number/branded-types/int.mjs.map +1 -1
  10. package/dist/number/branded-types/int16.d.mts +71 -59
  11. package/dist/number/branded-types/int16.d.mts.map +1 -1
  12. package/dist/number/branded-types/int16.mjs +56 -47
  13. package/dist/number/branded-types/int16.mjs.map +1 -1
  14. package/dist/number/branded-types/int32.d.mts +71 -59
  15. package/dist/number/branded-types/int32.d.mts.map +1 -1
  16. package/dist/number/branded-types/int32.mjs +56 -47
  17. package/dist/number/branded-types/int32.mjs.map +1 -1
  18. package/dist/number/branded-types/negative-finite-number.d.mts +76 -60
  19. package/dist/number/branded-types/negative-finite-number.d.mts.map +1 -1
  20. package/dist/number/branded-types/negative-finite-number.mjs +62 -49
  21. package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
  22. package/dist/number/branded-types/negative-int.d.mts +66 -49
  23. package/dist/number/branded-types/negative-int.d.mts.map +1 -1
  24. package/dist/number/branded-types/negative-int.mjs +48 -39
  25. package/dist/number/branded-types/negative-int.mjs.map +1 -1
  26. package/dist/number/branded-types/negative-safe-int.d.mts +64 -57
  27. package/dist/number/branded-types/negative-safe-int.d.mts.map +1 -1
  28. package/dist/number/branded-types/negative-safe-int.mjs +49 -44
  29. package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
  30. package/dist/number/branded-types/non-negative-finite-number.d.mts +80 -65
  31. package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -1
  32. package/dist/number/branded-types/non-negative-finite-number.mjs +65 -53
  33. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
  34. package/dist/number/branded-types/non-negative-int16.d.mts +71 -58
  35. package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -1
  36. package/dist/number/branded-types/non-negative-int16.mjs +55 -45
  37. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
  38. package/dist/number/branded-types/non-negative-int32.d.mts +71 -59
  39. package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -1
  40. package/dist/number/branded-types/non-negative-int32.mjs +55 -46
  41. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
  42. package/dist/number/branded-types/non-positive-finite-number.d.mts +70 -55
  43. package/dist/number/branded-types/non-positive-finite-number.d.mts.map +1 -1
  44. package/dist/number/branded-types/non-positive-finite-number.mjs +55 -43
  45. package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
  46. package/dist/number/branded-types/non-positive-int.d.mts +46 -146
  47. package/dist/number/branded-types/non-positive-int.d.mts.map +1 -1
  48. package/dist/number/branded-types/non-positive-int.mjs +33 -108
  49. package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
  50. package/dist/number/branded-types/non-positive-safe-int.d.mts +62 -54
  51. package/dist/number/branded-types/non-positive-safe-int.d.mts.map +1 -1
  52. package/dist/number/branded-types/non-positive-safe-int.mjs +46 -41
  53. package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
  54. package/dist/number/branded-types/non-zero-finite-number.d.mts +62 -49
  55. package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -1
  56. package/dist/number/branded-types/non-zero-finite-number.mjs +46 -37
  57. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
  58. package/dist/number/branded-types/non-zero-int.d.mts +51 -38
  59. package/dist/number/branded-types/non-zero-int.d.mts.map +1 -1
  60. package/dist/number/branded-types/non-zero-int.mjs +31 -27
  61. package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
  62. package/dist/number/branded-types/non-zero-int16.d.mts +59 -54
  63. package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -1
  64. package/dist/number/branded-types/non-zero-int16.mjs +44 -41
  65. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
  66. package/dist/number/branded-types/non-zero-int32.d.mts +59 -55
  67. package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -1
  68. package/dist/number/branded-types/non-zero-int32.mjs +44 -42
  69. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
  70. package/dist/number/branded-types/non-zero-safe-int.d.mts +60 -55
  71. package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -1
  72. package/dist/number/branded-types/non-zero-safe-int.mjs +44 -42
  73. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
  74. package/dist/number/branded-types/non-zero-uint16.d.mts +59 -54
  75. package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -1
  76. package/dist/number/branded-types/non-zero-uint16.mjs +43 -41
  77. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
  78. package/dist/number/branded-types/non-zero-uint32.d.mts +59 -54
  79. package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -1
  80. package/dist/number/branded-types/non-zero-uint32.mjs +43 -41
  81. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
  82. package/dist/number/branded-types/positive-finite-number.d.mts +82 -64
  83. package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -1
  84. package/dist/number/branded-types/positive-finite-number.mjs +67 -52
  85. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
  86. package/dist/number/branded-types/positive-int.d.mts +53 -70
  87. package/dist/number/branded-types/positive-int.d.mts.map +1 -1
  88. package/dist/number/branded-types/positive-int.mjs +42 -52
  89. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  90. package/dist/number/branded-types/positive-int16.d.mts +68 -58
  91. package/dist/number/branded-types/positive-int16.d.mts.map +1 -1
  92. package/dist/number/branded-types/positive-int16.mjs +52 -45
  93. package/dist/number/branded-types/positive-int16.mjs.map +1 -1
  94. package/dist/number/branded-types/positive-int32.d.mts +68 -58
  95. package/dist/number/branded-types/positive-int32.d.mts.map +1 -1
  96. package/dist/number/branded-types/positive-int32.mjs +52 -45
  97. package/dist/number/branded-types/positive-int32.mjs.map +1 -1
  98. package/dist/number/branded-types/positive-safe-int.d.mts +72 -61
  99. package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
  100. package/dist/number/branded-types/positive-safe-int.mjs +56 -48
  101. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  102. package/dist/number/branded-types/positive-uint16.d.mts +68 -58
  103. package/dist/number/branded-types/positive-uint16.d.mts.map +1 -1
  104. package/dist/number/branded-types/positive-uint16.mjs +52 -45
  105. package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
  106. package/dist/number/branded-types/positive-uint32.d.mts +68 -59
  107. package/dist/number/branded-types/positive-uint32.d.mts.map +1 -1
  108. package/dist/number/branded-types/positive-uint32.mjs +52 -46
  109. package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
  110. package/dist/number/branded-types/safe-int.d.mts +52 -66
  111. package/dist/number/branded-types/safe-int.d.mts.map +1 -1
  112. package/dist/number/branded-types/safe-int.mjs +45 -47
  113. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  114. package/dist/number/branded-types/safe-uint.d.mts +68 -58
  115. package/dist/number/branded-types/safe-uint.d.mts.map +1 -1
  116. package/dist/number/branded-types/safe-uint.mjs +53 -46
  117. package/dist/number/branded-types/safe-uint.mjs.map +1 -1
  118. package/dist/number/branded-types/uint.d.mts +72 -55
  119. package/dist/number/branded-types/uint.d.mts.map +1 -1
  120. package/dist/number/branded-types/uint.mjs +52 -45
  121. package/dist/number/branded-types/uint.mjs.map +1 -1
  122. package/dist/number/branded-types/uint16.d.mts +66 -59
  123. package/dist/number/branded-types/uint16.d.mts.map +1 -1
  124. package/dist/number/branded-types/uint16.mjs +51 -45
  125. package/dist/number/branded-types/uint16.mjs.map +1 -1
  126. package/dist/number/branded-types/uint32.d.mts +66 -57
  127. package/dist/number/branded-types/uint32.d.mts.map +1 -1
  128. package/dist/number/branded-types/uint32.mjs +50 -45
  129. package/dist/number/branded-types/uint32.mjs.map +1 -1
  130. package/dist/number/enum/int8.d.mts +62 -66
  131. package/dist/number/enum/int8.d.mts.map +1 -1
  132. package/dist/number/enum/int8.mjs +57 -51
  133. package/dist/number/enum/int8.mjs.map +1 -1
  134. package/dist/number/enum/uint8.d.mts +66 -59
  135. package/dist/number/enum/uint8.d.mts.map +1 -1
  136. package/dist/number/enum/uint8.mjs +57 -51
  137. package/dist/number/enum/uint8.mjs.map +1 -1
  138. package/dist/number/refined-number-utils.d.mts +9 -9
  139. package/dist/number/refined-number-utils.d.mts.map +1 -1
  140. package/dist/number/refined-number-utils.mjs +7 -7
  141. package/dist/number/refined-number-utils.mjs.map +1 -1
  142. package/package.json +2 -1
  143. package/src/number/branded-types/finite-number.mts +47 -61
  144. package/src/number/branded-types/int.mts +40 -46
  145. package/src/number/branded-types/int16.mts +72 -60
  146. package/src/number/branded-types/int32.mts +72 -60
  147. package/src/number/branded-types/negative-finite-number.mts +78 -71
  148. package/src/number/branded-types/negative-finite-number.test.mts +4 -4
  149. package/src/number/branded-types/negative-int.mts +68 -60
  150. package/src/number/branded-types/negative-int.test.mts +5 -5
  151. package/src/number/branded-types/negative-safe-int.mts +66 -68
  152. package/src/number/branded-types/negative-safe-int.test.mts +4 -4
  153. package/src/number/branded-types/non-negative-finite-number.mts +81 -66
  154. package/src/number/branded-types/non-negative-int16.mts +72 -59
  155. package/src/number/branded-types/non-negative-int32.mts +72 -60
  156. package/src/number/branded-types/non-positive-finite-number.mts +71 -56
  157. package/src/number/branded-types/non-positive-finite-number.test.mts +7 -7
  158. package/src/number/branded-types/non-positive-int.mts +47 -147
  159. package/src/number/branded-types/non-positive-int.test.mts +7 -7
  160. package/src/number/branded-types/non-positive-safe-int.mts +63 -55
  161. package/src/number/branded-types/non-positive-safe-int.test.mts +7 -7
  162. package/src/number/branded-types/non-zero-finite-number.mts +62 -51
  163. package/src/number/branded-types/non-zero-int.mts +51 -38
  164. package/src/number/branded-types/non-zero-int16.mts +60 -55
  165. package/src/number/branded-types/non-zero-int32.mts +60 -56
  166. package/src/number/branded-types/non-zero-safe-int.mts +61 -56
  167. package/src/number/branded-types/non-zero-uint16.mts +60 -55
  168. package/src/number/branded-types/non-zero-uint32.mts +60 -55
  169. package/src/number/branded-types/positive-finite-number.mts +83 -65
  170. package/src/number/branded-types/positive-int.mts +54 -71
  171. package/src/number/branded-types/positive-int16.mts +69 -59
  172. package/src/number/branded-types/positive-int32.mts +69 -59
  173. package/src/number/branded-types/positive-safe-int.mts +73 -62
  174. package/src/number/branded-types/positive-uint16.mts +69 -59
  175. package/src/number/branded-types/positive-uint32.mts +69 -60
  176. package/src/number/branded-types/safe-int.mts +53 -67
  177. package/src/number/branded-types/safe-uint.mts +69 -59
  178. package/src/number/branded-types/uint.mts +73 -56
  179. package/src/number/branded-types/uint16.mts +67 -60
  180. package/src/number/branded-types/uint32.mts +67 -58
  181. package/src/number/enum/int8.mts +70 -73
  182. package/src/number/enum/int8.test.mts +7 -4
  183. package/src/number/enum/uint8.mts +74 -66
  184. package/src/number/enum/uint8.test.mts +7 -4
  185. package/src/number/refined-number-utils.mts +22 -19
@@ -6,7 +6,7 @@ const {
6
6
  MAX_VALUE,
7
7
  add,
8
8
  castType,
9
- clamp,
9
+ fromNumber,
10
10
  is,
11
11
  max: max_,
12
12
  min: min_,
@@ -19,7 +19,7 @@ const {
19
19
  MAX_VALUE: -Number.MIN_VALUE,
20
20
  typeNameInMessage
21
21
  });
22
- const abs = (x) => PositiveFiniteNumber.clamp(Math.abs(x));
22
+ const abs = (x) => PositiveFiniteNumber.fromNumber(Math.abs(x));
23
23
  const floor = (x) => (
24
24
  // eslint-disable-next-line total-functions/no-unsafe-type-assertion
25
25
  Math.floor(x)
@@ -38,101 +38,114 @@ const isNegativeFiniteNumber = is;
38
38
  const asNegativeFiniteNumber = castType;
39
39
  const NegativeFiniteNumber = {
40
40
  /**
41
- * Type guard to check if a value is a NegativeFiniteNumber.
41
+ * Type guard that checks if a value is a negative finite number.
42
42
  *
43
- * @param value The value to check.
44
- * @returns `true` if the value is a negative finite number, `false`
45
- * otherwise.
43
+ * @param value - The value to check
44
+ * @returns `true` if the value is a negative finite number, `false` otherwise
45
+ * @see {@link isNegativeFiniteNumber} for usage examples
46
46
  */
47
47
  is,
48
48
  /**
49
- * The maximum value for a negative finite number.
50
- *
51
- * @readonly
49
+ * The largest value representable as `NegativeFiniteNumber` (the upper
50
+ * saturation target of `fromNumber`). The domain is open at `0` (excluded),
51
+ * so this is `-Number.MIN_VALUE` — the negative double closest to `0` —
52
+ * rather than `0`.
52
53
  */
53
54
  MAX_VALUE,
54
55
  /**
55
56
  * Returns the absolute value of a negative finite number.
56
57
  *
57
- * @param a The negative finite number.
58
- * @returns The absolute value as a PositiveFiniteNumber.
58
+ * The result is non-negative and keeps the `NegativeFiniteNumber` brand.
59
+ *
60
+ * @param a - The negative finite number value
61
+ * @returns The absolute value as a non-negative `NegativeFiniteNumber`
59
62
  */
60
63
  abs,
61
64
  /**
62
- * Returns the smaller of two NegativeFiniteNumber values.
65
+ * Returns the smallest of the given negative finite numbers.
63
66
  *
64
- * @param a The first NegativeFiniteNumber.
65
- * @param b The second NegativeFiniteNumber.
66
- * @returns The minimum value as a NegativeFiniteNumber.
67
+ * @param values - The negative finite numbers to compare (at least one required)
68
+ * @returns The smallest value as a `NegativeFiniteNumber`
67
69
  */
68
70
  min: min_,
69
71
  /**
70
- * Returns the larger of two NegativeFiniteNumber values.
72
+ * Returns the largest of the given negative finite numbers.
71
73
  *
72
- * @param a The first NegativeFiniteNumber.
73
- * @param b The second NegativeFiniteNumber.
74
- * @returns The maximum value as a NegativeFiniteNumber.
74
+ * @param values - The negative finite numbers to compare (at least one required)
75
+ * @returns The largest value as a `NegativeFiniteNumber`
75
76
  */
76
77
  max: max_,
77
78
  /**
78
- * Clamps a number to the negative finite range.
79
+ * Converts an arbitrary `number` into a `NegativeFiniteNumber`, saturating it
80
+ * into the range `[MIN_VALUE, MAX_VALUE]`.
81
+ *
82
+ * Unlike `asNegativeFiniteNumber`, this is total: out-of-range inputs are
83
+ * clamped to the nearest representable `NegativeFiniteNumber` instead of
84
+ * throwing.
79
85
  *
80
- * @param value The number to clamp.
81
- * @returns The value clamped to `(-∞, 0)` as a NegativeFiniteNumber.
86
+ * @param value - The value to convert
87
+ * @returns The value as a `NegativeFiniteNumber`
82
88
  */
83
- clamp,
89
+ fromNumber,
84
90
  /**
85
- * Rounds down a NegativeFiniteNumber to the nearest integer.
91
+ * Returns the greatest integer less than or equal to a negative finite
92
+ * number.
86
93
  *
87
- * @param x The NegativeFiniteNumber to round down.
88
- * @returns The floor value as a NegativeInt (always `<= -1`).
94
+ * @param a - The negative finite number value
95
+ * @returns The floored value as an integer
89
96
  */
90
97
  floor,
91
98
  /**
92
- * Rounds up a NegativeFiniteNumber to the nearest integer.
99
+ * Returns the smallest integer greater than or equal to a negative finite
100
+ * number.
93
101
  *
94
- * @param x The NegativeFiniteNumber to round up.
95
- * @returns The ceiling value as a NonPositiveInt (can be 0).
102
+ * @param a - The negative finite number value
103
+ * @returns The ceiled value as an integer
96
104
  */
97
105
  ceil,
98
106
  /**
99
- * Rounds a NegativeFiniteNumber to the nearest integer.
107
+ * Returns the value of a negative finite number rounded to the nearest
108
+ * integer.
100
109
  *
101
- * @param x The NegativeFiniteNumber to round.
102
- * @returns The rounded value as a NonPositiveInt (can be 0 if x > -0.5).
110
+ * @param a - The negative finite number value
111
+ * @returns The rounded value as an integer
103
112
  */
104
113
  round,
105
114
  /**
106
- * Generates a random NegativeFiniteNumber value.
115
+ * Generates a random `NegativeFiniteNumber` within the given range.
107
116
  *
108
- * @returns A random negative finite number.
117
+ * The range is inclusive on both ends.
118
+ *
119
+ * @param min - The minimum value (inclusive)
120
+ * @param max - The maximum value (inclusive)
121
+ * @returns A random `NegativeFiniteNumber` in `[min, max]`
109
122
  */
110
123
  random,
111
124
  /**
112
- * Raises a NegativeFiniteNumber to the power of another NegativeFiniteNumber.
125
+ * Raises `a` to the power `b`, returning `a ** b` as a
126
+ * `NegativeFiniteNumber`.
113
127
  *
114
- * @param a The base NegativeFiniteNumber.
115
- * @param b The exponent NegativeFiniteNumber.
116
- * @returns `a ** b` clamped to `(-∞, 0)` as a NegativeFiniteNumber.
128
+ * @param a - The base negative finite number
129
+ * @param b - The exponent negative finite number
130
+ * @returns `a ** b` as a `NegativeFiniteNumber`
117
131
  */
118
132
  pow,
119
133
  /**
120
- * Adds two NegativeFiniteNumber values.
134
+ * Adds two negative finite numbers, returning `a + b` as a
135
+ * `NegativeFiniteNumber`.
121
136
  *
122
- * @param a The first NegativeFiniteNumber.
123
- * @param b The second NegativeFiniteNumber.
124
- * @returns `a + b` as a NegativeFiniteNumber.
137
+ * @param a - The first negative finite number
138
+ * @param b - The second negative finite number
139
+ * @returns The sum of `a` and `b` as a `NegativeFiniteNumber`
125
140
  */
126
141
  add,
127
142
  /**
128
- * Subtracts one NegativeFiniteNumber from another.
129
- *
130
- * The mathematical result can be positive, so it is clamped to the negative
131
- * finite range (maximum `-Number.MIN_VALUE`).
143
+ * Subtracts two negative finite numbers, returning `a - b` as a
144
+ * `NegativeFiniteNumber`.
132
145
  *
133
- * @param a The minuend NegativeFiniteNumber.
134
- * @param b The subtrahend NegativeFiniteNumber.
135
- * @returns `a - b` clamped to `(-∞, 0)` as a NegativeFiniteNumber.
146
+ * @param a - The first negative finite number
147
+ * @param b - The second negative finite number
148
+ * @returns The difference of `a` and `b` as a `NegativeFiniteNumber`
136
149
  */
137
150
  sub
138
151
  };
@@ -1 +1 @@
1
- {"version":3,"file":"negative-finite-number.mjs","sources":["../../../src/number/branded-types/negative-finite-number.mts"],"sourcesContent":["import { type NegativeFiniteNumber as TtfImported_NegativeFiniteNumber } from 'ts-type-forge';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\nimport { PositiveFiniteNumber } from './positive-finite-number.mjs';\n\nexport type NegativeFiniteNumber = TtfImported_NegativeFiniteNumber;\n\ntype ElementType = NegativeFiniteNumber;\n\nconst typeNameInMessage = 'a negative finite number';\n\nconst {\n MAX_VALUE,\n add,\n castType,\n clamp,\n is,\n max: max_,\n min: min_,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForFloat<\n ElementType,\n number,\n number\n>({\n nonZero: true,\n MIN_VALUE: -Number.MAX_VALUE,\n MAX_VALUE: -Number.MIN_VALUE,\n typeNameInMessage,\n} as const);\n\n/**\n * Returns the absolute value of a negative finite number.\n *\n * The absolute value of a negative finite number is always a positive finite\n * number, so the result is typed as a {@link PositiveFiniteNumber}.\n *\n * @param x - The negative finite number.\n * @returns `|x|` as a PositiveFiniteNumber.\n */\nconst abs = (x: ElementType): PositiveFiniteNumber =>\n PositiveFiniteNumber.clamp(Math.abs(x));\n\nconst floor = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.floor(x) as TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;\n\nconst ceil = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.ceil(x) as TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n >;\n\nconst round = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.round(\n x,\n ) as TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n >;\n\n/**\n * Checks if a number is a NegativeFiniteNumber (a finite number `< 0`).\n *\n * @param value The value to check.\n * @returns `true` if the value is a NegativeFiniteNumber, `false` otherwise.\n */\nexport const isNegativeFiniteNumber = is;\n\n/**\n * Casts a number to a NegativeFiniteNumber type.\n *\n * @param value The value to cast.\n * @returns The value as a NegativeFiniteNumber type.\n * @throws {TypeError} If the value is not a negative finite number.\n */\nexport const asNegativeFiniteNumber = castType;\n\n/**\n * Namespace providing type-safe arithmetic operations for negative finite\n * numbers.\n *\n * All operations keep results finite (excluding NaN and Infinity). Operations\n * that stay within the negative finite numbers clamp their results to the valid\n * range, while operations whose result leaves the set (`mul`, `div`, `abs`) are\n * typed to reflect the actual sign of the result.\n */\nexport const NegativeFiniteNumber = {\n /**\n * Type guard to check if a value is a NegativeFiniteNumber.\n *\n * @param value The value to check.\n * @returns `true` if the value is a negative finite number, `false`\n * otherwise.\n */\n is,\n\n /**\n * The maximum value for a negative finite number.\n *\n * @readonly\n */\n MAX_VALUE,\n\n /**\n * Returns the absolute value of a negative finite number.\n *\n * @param a The negative finite number.\n * @returns The absolute value as a PositiveFiniteNumber.\n */\n abs,\n\n /**\n * Returns the smaller of two NegativeFiniteNumber values.\n *\n * @param a The first NegativeFiniteNumber.\n * @param b The second NegativeFiniteNumber.\n * @returns The minimum value as a NegativeFiniteNumber.\n */\n min: min_,\n\n /**\n * Returns the larger of two NegativeFiniteNumber values.\n *\n * @param a The first NegativeFiniteNumber.\n * @param b The second NegativeFiniteNumber.\n * @returns The maximum value as a NegativeFiniteNumber.\n */\n max: max_,\n\n /**\n * Clamps a number to the negative finite range.\n *\n * @param value The number to clamp.\n * @returns The value clamped to `(-∞, 0)` as a NegativeFiniteNumber.\n */\n clamp,\n\n /**\n * Rounds down a NegativeFiniteNumber to the nearest integer.\n *\n * @param x The NegativeFiniteNumber to round down.\n * @returns The floor value as a NegativeInt (always `<= -1`).\n */\n floor,\n\n /**\n * Rounds up a NegativeFiniteNumber to the nearest integer.\n *\n * @param x The NegativeFiniteNumber to round up.\n * @returns The ceiling value as a NonPositiveInt (can be 0).\n */\n ceil,\n\n /**\n * Rounds a NegativeFiniteNumber to the nearest integer.\n *\n * @param x The NegativeFiniteNumber to round.\n * @returns The rounded value as a NonPositiveInt (can be 0 if x > -0.5).\n */\n round,\n\n /**\n * Generates a random NegativeFiniteNumber value.\n *\n * @returns A random negative finite number.\n */\n random,\n\n /**\n * Raises a NegativeFiniteNumber to the power of another NegativeFiniteNumber.\n *\n * @param a The base NegativeFiniteNumber.\n * @param b The exponent NegativeFiniteNumber.\n * @returns `a ** b` clamped to `(-∞, 0)` as a NegativeFiniteNumber.\n */\n pow,\n\n /**\n * Adds two NegativeFiniteNumber values.\n *\n * @param a The first NegativeFiniteNumber.\n * @param b The second NegativeFiniteNumber.\n * @returns `a + b` as a NegativeFiniteNumber.\n */\n add,\n\n /**\n * Subtracts one NegativeFiniteNumber from another.\n *\n * The mathematical result can be positive, so it is clamped to the negative\n * finite range (maximum `-Number.MIN_VALUE`).\n *\n * @param a The minuend NegativeFiniteNumber.\n * @param b The subtrahend NegativeFiniteNumber.\n * @returns `a - b` clamped to `(-∞, 0)` as a NegativeFiniteNumber.\n */\n sub,\n} as const;\n"],"names":[],"mappings":";;;AAQA,MAAM,iBAAA,GAAoB,0BAAA;AAE1B,MAAM;AAAA,EACJ,SAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,GAAI,oBAAA,CAAqB,mBAAmB,iBAAA,CAI1C;AAAA,EACA,OAAA,EAAS,IAAA;AAAA,EACT,SAAA,EAAW,CAAC,MAAA,CAAO,SAAA;AAAA,EACnB,SAAA,EAAW,CAAC,MAA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A;AAAA;AAAA,EAYA;AACF;;;;"}
1
+ {"version":3,"file":"negative-finite-number.mjs","sources":["../../../src/number/branded-types/negative-finite-number.mts"],"sourcesContent":["import { type NegativeFiniteNumber as TtfImported_NegativeFiniteNumber } from 'ts-type-forge';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\nimport { PositiveFiniteNumber } from './positive-finite-number.mjs';\n\nexport type NegativeFiniteNumber = TtfImported_NegativeFiniteNumber;\n\ntype ElementType = NegativeFiniteNumber;\n\nconst typeNameInMessage = 'a negative finite number';\n\nconst {\n MAX_VALUE,\n add,\n castType,\n fromNumber,\n is,\n max: max_,\n min: min_,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForFloat<\n ElementType,\n number,\n number\n>({\n nonZero: true,\n MIN_VALUE: -Number.MAX_VALUE,\n MAX_VALUE: -Number.MIN_VALUE,\n typeNameInMessage,\n} as const);\n\nconst abs = (x: ElementType): PositiveFiniteNumber =>\n PositiveFiniteNumber.fromNumber(Math.abs(x));\n\nconst floor = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.floor(x) as TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>;\n\nconst ceil = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.ceil(x) as TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n >;\n\nconst round = (\n x: ElementType,\n): TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n> =>\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n Math.round(\n x,\n ) as TsDataForgeInternals.RefinedNumberUtils.RemoveNonZeroBrandKey<\n TsDataForgeInternals.RefinedNumberUtils.ToInt<ElementType>\n >;\n\n/**\n * Type guard that checks if a value is a negative finite number.\n *\n * Returns `true` only for a finite value — never `NaN`, `Infinity`, or\n * `-Infinity`.\n *\n * @param value - The value to check\n * @returns `true` if the value is a negative finite number, `false` otherwise\n */\nexport const isNegativeFiniteNumber = is;\n\n/**\n * Casts a `number` to the `NegativeFiniteNumber` branded type.\n *\n * Validates that the value is a negative finite number and returns it with the\n * `NegativeFiniteNumber` brand. Throws a `TypeError` otherwise.\n *\n * @param value - The value to cast\n * @returns The value as a `NegativeFiniteNumber`\n * @throws {TypeError} If the value is not a negative finite number\n */\nexport const asNegativeFiniteNumber = castType;\n\n/**\n * Namespace providing type-safe operations for the `NegativeFiniteNumber`\n * branded type.\n *\n * The `NegativeFiniteNumber` type represents a negative finite number.\n */\nexport const NegativeFiniteNumber = {\n /**\n * Type guard that checks if a value is a negative finite number.\n *\n * @param value - The value to check\n * @returns `true` if the value is a negative finite number, `false` otherwise\n * @see {@link isNegativeFiniteNumber} for usage examples\n */\n is,\n\n /**\n * The largest value representable as `NegativeFiniteNumber` (the upper\n * saturation target of `fromNumber`). The domain is open at `0` (excluded),\n * so this is `-Number.MIN_VALUE` — the negative double closest to `0` —\n * rather than `0`.\n */\n MAX_VALUE,\n\n /**\n * Returns the absolute value of a negative finite number.\n *\n * The result is non-negative and keeps the `NegativeFiniteNumber` brand.\n *\n * @param a - The negative finite number value\n * @returns The absolute value as a non-negative `NegativeFiniteNumber`\n */\n abs,\n\n /**\n * Returns the smallest of the given negative finite numbers.\n *\n * @param values - The negative finite numbers to compare (at least one required)\n * @returns The smallest value as a `NegativeFiniteNumber`\n */\n min: min_,\n\n /**\n * Returns the largest of the given negative finite numbers.\n *\n * @param values - The negative finite numbers to compare (at least one required)\n * @returns The largest value as a `NegativeFiniteNumber`\n */\n max: max_,\n\n /**\n * Converts an arbitrary `number` into a `NegativeFiniteNumber`, saturating it\n * into the range `[MIN_VALUE, MAX_VALUE]`.\n *\n * Unlike `asNegativeFiniteNumber`, this is total: out-of-range inputs are\n * clamped to the nearest representable `NegativeFiniteNumber` instead of\n * throwing.\n *\n * @param value - The value to convert\n * @returns The value as a `NegativeFiniteNumber`\n */\n fromNumber,\n\n /**\n * Returns the greatest integer less than or equal to a negative finite\n * number.\n *\n * @param a - The negative finite number value\n * @returns The floored value as an integer\n */\n floor,\n\n /**\n * Returns the smallest integer greater than or equal to a negative finite\n * number.\n *\n * @param a - The negative finite number value\n * @returns The ceiled value as an integer\n */\n ceil,\n\n /**\n * Returns the value of a negative finite number rounded to the nearest\n * integer.\n *\n * @param a - The negative finite number value\n * @returns The rounded value as an integer\n */\n round,\n\n /**\n * Generates a random `NegativeFiniteNumber` within the given range.\n *\n * The range is inclusive on both ends.\n *\n * @param min - The minimum value (inclusive)\n * @param max - The maximum value (inclusive)\n * @returns A random `NegativeFiniteNumber` in `[min, max]`\n */\n random,\n\n /**\n * Raises `a` to the power `b`, returning `a ** b` as a\n * `NegativeFiniteNumber`.\n *\n * @param a - The base negative finite number\n * @param b - The exponent negative finite number\n * @returns `a ** b` as a `NegativeFiniteNumber`\n */\n pow,\n\n /**\n * Adds two negative finite numbers, returning `a + b` as a\n * `NegativeFiniteNumber`.\n *\n * @param a - The first negative finite number\n * @param b - The second negative finite number\n * @returns The sum of `a` and `b` as a `NegativeFiniteNumber`\n */\n add,\n\n /**\n * Subtracts two negative finite numbers, returning `a - b` as a\n * `NegativeFiniteNumber`.\n *\n * @param a - The first negative finite number\n * @param b - The second negative finite number\n * @returns The difference of `a` and `b` as a `NegativeFiniteNumber`\n */\n sub,\n} as const;\n"],"names":[],"mappings":";;;AAQA,MAAM,iBAAA,GAAoB,0BAAA;AAE1B,MAAM;AAAA,EACJ,SAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,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ASA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA;AACF;;;;"}
@@ -3,18 +3,24 @@ import { PositiveInt } from './positive-int.mjs';
3
3
  export type NegativeInt = TtfImported_NegativeInt;
4
4
  type ElementType = NegativeInt;
5
5
  /**
6
- * Checks if a number is a NegativeInt (a negative integer `<= -1`).
6
+ * Type guard that checks if a value is a negative integer.
7
7
  *
8
- * @param value The value to check.
9
- * @returns `true` if the value is a NegativeInt, `false` otherwise.
8
+ * Returns `true` for a negative integer — a value with no fractional component,
9
+ * including values outside the safe integer range (unlike `SafeInt`).
10
+ *
11
+ * @param value - The value to check
12
+ * @returns `true` if the value is a negative integer, `false` otherwise
10
13
  */
11
14
  export declare const isNegativeInt: (a: number) => a is TtfImported_NegativeInt;
12
15
  /**
13
- * Casts a number to a NegativeInt type.
16
+ * Casts a `number` to the `NegativeInt` branded type.
17
+ *
18
+ * Validates that the value is a negative integer and returns it with the
19
+ * `NegativeInt` brand. Throws a `TypeError` otherwise.
14
20
  *
15
- * @param value The value to cast.
16
- * @returns The value as a NegativeInt type.
17
- * @throws {TypeError} If the value is not a negative integer.
21
+ * @param value - The value to cast
22
+ * @returns The value as a `NegativeInt`
23
+ * @throws {TypeError} If the value is not a negative integer
18
24
  */
19
25
  export declare const asNegativeInt: <N extends number>(x: N) => number & {
20
26
  readonly "!=0": true;
@@ -31,88 +37,99 @@ export declare const asNegativeInt: <N extends number>(x: N) => number & {
31
37
  'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;
32
38
  }> & N;
33
39
  /**
34
- * Namespace providing type-safe arithmetic operations for negative integers.
40
+ * Namespace providing type-safe operations for the `NegativeInt` branded type.
35
41
  *
36
- * NegativeInt represents integers that are strictly less than zero (`<= -1`).
37
- * Operations that stay within the negative integers (such as `add`) clamp their
38
- * results to the valid range, while operations whose result leaves the set
39
- * (`mul`, `div`, `abs`) are typed to reflect the actual sign of the result.
42
+ * The `NegativeInt` type represents a negative integer. Division (`div`) uses
43
+ * floor division.
44
+ *
45
+ * Unlike `SafeInt`, `NegativeInt` allows values outside the safe integer range
46
+ * (±2^53 − 1), so very large magnitudes may lose precision in JavaScript's
47
+ * `number` type.
40
48
  */
41
49
  export declare const NegativeInt: {
42
50
  /**
43
- * Type guard to check if a value is a NegativeInt.
51
+ * Type guard that checks if a value is a negative integer.
44
52
  *
45
- * @param value The value to check.
46
- * @returns `true` if the value is a negative integer, `false` otherwise.
53
+ * @param value - The value to check
54
+ * @returns `true` if the value is a negative integer, `false` otherwise
55
+ * @see {@link isNegativeInt} for usage examples
47
56
  */
48
57
  readonly is: (a: number) => a is TtfImported_NegativeInt;
49
58
  /**
50
- * The maximum value for a negative integer.
51
- *
52
- * @readonly
59
+ * The largest value representable as `NegativeInt` (the upper saturation
60
+ * target of `fromNumber`).
53
61
  */
54
62
  readonly MAX_VALUE: -1;
55
63
  /**
56
64
  * Returns the absolute value of a negative integer.
57
65
  *
58
- * @param a The negative integer.
59
- * @returns The absolute value as a PositiveInt.
66
+ * The result is non-negative and keeps the `NegativeInt` brand. Note that
67
+ * `Math.abs(Number.MIN_SAFE_INTEGER)` exceeds `Number.MAX_SAFE_INTEGER`, so
68
+ * use `SafeInt` for guaranteed precision.
69
+ *
70
+ * @param a - The negative integer value
71
+ * @returns The absolute value as a non-negative `NegativeInt`
60
72
  */
61
73
  readonly abs: (x: WithSmallInt<ElementType>) => PositiveInt;
62
74
  /**
63
- * Returns the smaller of two negative integers.
75
+ * Returns the smallest of the given negative integers.
64
76
  *
65
- * @param a The first negative integer.
66
- * @param b The second negative integer.
67
- * @returns The minimum value as a NegativeInt.
77
+ * @param values - The negative integers to compare (at least one required)
78
+ * @returns The smallest value as a `NegativeInt`
68
79
  */
69
80
  readonly min: (...values: readonly WithSmallInt<TtfImported_NegativeInt>[]) => TtfImported_NegativeInt;
70
81
  /**
71
- * Returns the larger of two negative integers.
82
+ * Returns the largest of the given negative integers.
72
83
  *
73
- * @param a The first negative integer.
74
- * @param b The second negative integer.
75
- * @returns The maximum value as a NegativeInt.
84
+ * @param values - The negative integers to compare (at least one required)
85
+ * @returns The largest value as a `NegativeInt`
76
86
  */
77
87
  readonly max: (...values: readonly WithSmallInt<TtfImported_NegativeInt>[]) => TtfImported_NegativeInt;
78
88
  /**
79
- * Clamps a number to the negative integer range.
89
+ * Converts an arbitrary `number` into a `NegativeInt`, rounding to the
90
+ * nearest integer and saturating the result into the range `[MIN_VALUE,
91
+ * MAX_VALUE]`.
92
+ *
93
+ * Unlike `asNegativeInt`, this is total: out-of-range inputs are clamped to
94
+ * the nearest representable `NegativeInt` instead of throwing.
80
95
  *
81
- * @param value The number to clamp.
82
- * @returns The value clamped to `[-∞, -1]` as a NegativeInt.
96
+ * @param value - The value to convert
97
+ * @returns The value as a `NegativeInt`
83
98
  */
84
- readonly clamp: (x: number) => TtfImported_NegativeInt;
99
+ readonly fromNumber: (x: number) => TtfImported_NegativeInt;
85
100
  /**
86
- * Generates a random NegativeInt value within the valid range.
101
+ * Generates a random `NegativeInt` within the given range.
87
102
  *
88
- * @returns A random negative integer.
103
+ * The range is inclusive on both ends.
104
+ *
105
+ * @param min - The minimum value (inclusive)
106
+ * @param max - The maximum value (inclusive)
107
+ * @returns A random `NegativeInt` in `[min, max]`
89
108
  */
90
109
  readonly random: (min?: WithSmallInt<TtfImported_NegativeInt> | undefined, max?: WithSmallInt<TtfImported_NegativeInt> | undefined) => TtfImported_NegativeInt;
91
110
  /**
92
- * Raises a negative integer to the power of another negative integer.
111
+ * Raises `a` to the power `b`, returning `a ** b` as a `NegativeInt` (floored
112
+ * to an integer).
93
113
  *
94
- * @param a The base negative integer.
95
- * @param b The exponent negative integer.
96
- * @returns `a ** b` clamped to the negative integer range.
114
+ * @param a - The base negative integer
115
+ * @param b - The exponent negative integer
116
+ * @returns `a ** b` as a `NegativeInt`
97
117
  */
98
118
  readonly pow: (x: WithSmallInt<TtfImported_NegativeInt>, y: WithSmallInt<TtfImported_NegativeInt>) => TtfImported_NegativeInt;
99
119
  /**
100
- * Adds two negative integers.
120
+ * Adds two negative integers, returning `a + b` as a `NegativeInt`.
101
121
  *
102
- * @param a The first negative integer.
103
- * @param b The second negative integer.
104
- * @returns `a + b` as a NegativeInt.
122
+ * @param a - The first negative integer
123
+ * @param b - The second negative integer
124
+ * @returns The sum of `a` and `b` as a `NegativeInt`
105
125
  */
106
126
  readonly add: (x: WithSmallInt<TtfImported_NegativeInt>, y: WithSmallInt<TtfImported_NegativeInt>) => TtfImported_NegativeInt;
107
127
  /**
108
- * Subtracts one negative integer from another.
109
- *
110
- * The mathematical result can be positive, so it is clamped to the negative
111
- * integer range (maximum `-1`).
128
+ * Subtracts two negative integers, returning `a - b` as a `NegativeInt`.
112
129
  *
113
- * @param a The minuend negative integer.
114
- * @param b The subtrahend negative integer.
115
- * @returns `a - b` clamped to the negative integer range.
130
+ * @param a - The first negative integer
131
+ * @param b - The second negative integer
132
+ * @returns The difference of `a` and `b` as a `NegativeInt`
116
133
  */
117
134
  readonly sub: (x: WithSmallInt<TtfImported_NegativeInt>, y: WithSmallInt<TtfImported_NegativeInt>) => TtfImported_NegativeInt;
118
135
  };
@@ -1 +1 @@
1
- {"version":3,"file":"negative-int.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/negative-int.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,IAAI,uBAAuB,EAC3C,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CA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
@@ -6,7 +6,7 @@ const {
6
6
  MAX_VALUE,
7
7
  add,
8
8
  castType,
9
- clamp,
9
+ fromNumber,
10
10
  is,
11
11
  max: max_,
12
12
  min: min_,
@@ -20,84 +20,93 @@ const {
20
20
  MAX_VALUE: -1,
21
21
  typeNameInMessage
22
22
  });
23
- const abs = (x) => PositiveInt.clamp(Math.abs(x));
23
+ const abs = (x) => PositiveInt.fromNumber(Math.abs(x));
24
24
  const isNegativeInt = is;
25
25
  const asNegativeInt = castType;
26
26
  const NegativeInt = {
27
27
  /**
28
- * Type guard to check if a value is a NegativeInt.
28
+ * Type guard that checks if a value is a negative integer.
29
29
  *
30
- * @param value The value to check.
31
- * @returns `true` if the value is a negative integer, `false` otherwise.
30
+ * @param value - The value to check
31
+ * @returns `true` if the value is a negative integer, `false` otherwise
32
+ * @see {@link isNegativeInt} for usage examples
32
33
  */
33
34
  is,
34
35
  /**
35
- * The maximum value for a negative integer.
36
- *
37
- * @readonly
36
+ * The largest value representable as `NegativeInt` (the upper saturation
37
+ * target of `fromNumber`).
38
38
  */
39
39
  MAX_VALUE,
40
40
  /**
41
41
  * Returns the absolute value of a negative integer.
42
42
  *
43
- * @param a The negative integer.
44
- * @returns The absolute value as a PositiveInt.
43
+ * The result is non-negative and keeps the `NegativeInt` brand. Note that
44
+ * `Math.abs(Number.MIN_SAFE_INTEGER)` exceeds `Number.MAX_SAFE_INTEGER`, so
45
+ * use `SafeInt` for guaranteed precision.
46
+ *
47
+ * @param a - The negative integer value
48
+ * @returns The absolute value as a non-negative `NegativeInt`
45
49
  */
46
50
  abs,
47
51
  /**
48
- * Returns the smaller of two negative integers.
52
+ * Returns the smallest of the given negative integers.
49
53
  *
50
- * @param a The first negative integer.
51
- * @param b The second negative integer.
52
- * @returns The minimum value as a NegativeInt.
54
+ * @param values - The negative integers to compare (at least one required)
55
+ * @returns The smallest value as a `NegativeInt`
53
56
  */
54
57
  min: min_,
55
58
  /**
56
- * Returns the larger of two negative integers.
59
+ * Returns the largest of the given negative integers.
57
60
  *
58
- * @param a The first negative integer.
59
- * @param b The second negative integer.
60
- * @returns The maximum value as a NegativeInt.
61
+ * @param values - The negative integers to compare (at least one required)
62
+ * @returns The largest value as a `NegativeInt`
61
63
  */
62
64
  max: max_,
63
65
  /**
64
- * Clamps a number to the negative integer range.
66
+ * Converts an arbitrary `number` into a `NegativeInt`, rounding to the
67
+ * nearest integer and saturating the result into the range `[MIN_VALUE,
68
+ * MAX_VALUE]`.
69
+ *
70
+ * Unlike `asNegativeInt`, this is total: out-of-range inputs are clamped to
71
+ * the nearest representable `NegativeInt` instead of throwing.
65
72
  *
66
- * @param value The number to clamp.
67
- * @returns The value clamped to `[-∞, -1]` as a NegativeInt.
73
+ * @param value - The value to convert
74
+ * @returns The value as a `NegativeInt`
68
75
  */
69
- clamp,
76
+ fromNumber,
70
77
  /**
71
- * Generates a random NegativeInt value within the valid range.
78
+ * Generates a random `NegativeInt` within the given range.
72
79
  *
73
- * @returns A random negative integer.
80
+ * The range is inclusive on both ends.
81
+ *
82
+ * @param min - The minimum value (inclusive)
83
+ * @param max - The maximum value (inclusive)
84
+ * @returns A random `NegativeInt` in `[min, max]`
74
85
  */
75
86
  random,
76
87
  /**
77
- * Raises a negative integer to the power of another negative integer.
88
+ * Raises `a` to the power `b`, returning `a ** b` as a `NegativeInt` (floored
89
+ * to an integer).
78
90
  *
79
- * @param a The base negative integer.
80
- * @param b The exponent negative integer.
81
- * @returns `a ** b` clamped to the negative integer range.
91
+ * @param a - The base negative integer
92
+ * @param b - The exponent negative integer
93
+ * @returns `a ** b` as a `NegativeInt`
82
94
  */
83
95
  pow,
84
96
  /**
85
- * Adds two negative integers.
97
+ * Adds two negative integers, returning `a + b` as a `NegativeInt`.
86
98
  *
87
- * @param a The first negative integer.
88
- * @param b The second negative integer.
89
- * @returns `a + b` as a NegativeInt.
99
+ * @param a - The first negative integer
100
+ * @param b - The second negative integer
101
+ * @returns The sum of `a` and `b` as a `NegativeInt`
90
102
  */
91
103
  add,
92
104
  /**
93
- * Subtracts one negative integer from another.
94
- *
95
- * The mathematical result can be positive, so it is clamped to the negative
96
- * integer range (maximum `-1`).
105
+ * Subtracts two negative integers, returning `a - b` as a `NegativeInt`.
97
106
  *
98
- * @param a The minuend negative integer.
99
- * @param b The subtrahend negative integer.
100
- * @returns `a - b` clamped to the negative integer range.
107
+ * @param a - The first negative integer
108
+ * @param b - The second negative integer
109
+ * @returns The difference of `a` and `b` as a `NegativeInt`
101
110
  */
102
111
  sub
103
112
  };
@@ -1 +1 @@
1
- {"version":3,"file":"negative-int.mjs","sources":["../../../src/number/branded-types/negative-int.mts"],"sourcesContent":["import {\n type NegativeInt as TtfImported_NegativeInt,\n type WithSmallInt,\n} from 'ts-type-forge';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\nimport { PositiveInt } from './positive-int.mjs';\n\nexport type NegativeInt = TtfImported_NegativeInt;\n\ntype ElementType = NegativeInt;\n\nconst typeNameInMessage = 'a negative integer';\n\nconst {\n MAX_VALUE,\n add,\n castType,\n clamp,\n is,\n max: max_,\n min: min_,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n number,\n -1\n>({\n integerOrSafeInteger: 'Integer',\n nonZero: true,\n MIN_VALUE: -Number.MAX_VALUE,\n MAX_VALUE: -1,\n typeNameInMessage,\n} as const);\n\n/**\n * Returns the absolute value of a negative integer.\n *\n * The absolute value of a negative integer is always a positive integer\n * (`>= 1`), so the result is typed as a {@link PositiveInt}.\n *\n * @param x - The negative integer.\n * @returns `|x|` as a PositiveInt.\n */\nconst abs = (x: WithSmallInt<ElementType>): PositiveInt =>\n PositiveInt.clamp(Math.abs(x));\n\n/**\n * Checks if a number is a NegativeInt (a negative integer `<= -1`).\n *\n * @param value The value to check.\n * @returns `true` if the value is a NegativeInt, `false` otherwise.\n */\nexport const isNegativeInt = is;\n\n/**\n * Casts a number to a NegativeInt type.\n *\n * @param value The value to cast.\n * @returns The value as a NegativeInt type.\n * @throws {TypeError} If the value is not a negative integer.\n */\nexport const asNegativeInt = castType;\n\n/**\n * Namespace providing type-safe arithmetic operations for negative integers.\n *\n * NegativeInt represents integers that are strictly less than zero (`<= -1`).\n * Operations that stay within the negative integers (such as `add`) clamp their\n * results to the valid range, while operations whose result leaves the set\n * (`mul`, `div`, `abs`) are typed to reflect the actual sign of the result.\n */\nexport const NegativeInt = {\n /**\n * Type guard to check if a value is a NegativeInt.\n *\n * @param value The value to check.\n * @returns `true` if the value is a negative integer, `false` otherwise.\n */\n is,\n\n /**\n * The maximum value for a negative integer.\n *\n * @readonly\n */\n MAX_VALUE,\n\n /**\n * Returns the absolute value of a negative integer.\n *\n * @param a The negative integer.\n * @returns The absolute value as a PositiveInt.\n */\n abs,\n\n /**\n * Returns the smaller of two negative integers.\n *\n * @param a The first negative integer.\n * @param b The second negative integer.\n * @returns The minimum value as a NegativeInt.\n */\n min: min_,\n\n /**\n * Returns the larger of two negative integers.\n *\n * @param a The first negative integer.\n * @param b The second negative integer.\n * @returns The maximum value as a NegativeInt.\n */\n max: max_,\n\n /**\n * Clamps a number to the negative integer range.\n *\n * @param value The number to clamp.\n * @returns The value clamped to `[-∞, -1]` as a NegativeInt.\n */\n clamp,\n\n /**\n * Generates a random NegativeInt value within the valid range.\n *\n * @returns A random negative integer.\n */\n random,\n\n /**\n * Raises a negative integer to the power of another negative integer.\n *\n * @param a The base negative integer.\n * @param b The exponent negative integer.\n * @returns `a ** b` clamped to the negative integer range.\n */\n pow,\n\n /**\n * Adds two negative integers.\n *\n * @param a The first negative integer.\n * @param b The second negative integer.\n * @returns `a + b` as a NegativeInt.\n */\n add,\n\n /**\n * Subtracts one negative integer from another.\n *\n * The mathematical result can be positive, so it is clamped to the negative\n * integer range (maximum `-1`).\n *\n * @param a The minuend negative integer.\n * @param b The subtrahend negative integer.\n * @returns `a - b` clamped to the negative integer range.\n */\n sub,\n} as const;\n"],"names":[],"mappings":";;;AAWA,MAAM,iBAAA,GAAoB,o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mjs","sources":["../../../src/number/branded-types/negative-int.mts"],"sourcesContent":["import {\n type NegativeInt as TtfImported_NegativeInt,\n type WithSmallInt,\n} from 'ts-type-forge';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\nimport { PositiveInt } from './positive-int.mjs';\n\nexport type NegativeInt = TtfImported_NegativeInt;\n\ntype ElementType = NegativeInt;\n\nconst typeNameInMessage = 'a negative integer';\n\nconst {\n MAX_VALUE,\n add,\n castType,\n fromNumber,\n is,\n max: max_,\n min: min_,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n number,\n -1\n>({\n integerOrSafeInteger: 'Integer',\n nonZero: true,\n MIN_VALUE: -Number.MAX_VALUE,\n MAX_VALUE: -1,\n typeNameInMessage,\n} as const);\n\nconst abs = (x: WithSmallInt<ElementType>): PositiveInt =>\n PositiveInt.fromNumber(Math.abs(x));\n\n/**\n * Type guard that checks if a value is a negative integer.\n *\n * Returns `true` for a negative integer — a value with no fractional component,\n * including values outside the safe integer range (unlike `SafeInt`).\n *\n * @param value - The value to check\n * @returns `true` if the value is a negative integer, `false` otherwise\n */\nexport const isNegativeInt = is;\n\n/**\n * Casts a `number` to the `NegativeInt` branded type.\n *\n * Validates that the value is a negative integer and returns it with the\n * `NegativeInt` brand. Throws a `TypeError` otherwise.\n *\n * @param value - The value to cast\n * @returns The value as a `NegativeInt`\n * @throws {TypeError} If the value is not a negative integer\n */\nexport const asNegativeInt = castType;\n\n/**\n * Namespace providing type-safe operations for the `NegativeInt` branded type.\n *\n * The `NegativeInt` type represents a negative integer. Division (`div`) uses\n * floor division.\n *\n * Unlike `SafeInt`, `NegativeInt` allows values outside the safe integer range\n * (±2^53 − 1), so very large magnitudes may lose precision in JavaScript's\n * `number` type.\n */\nexport const NegativeInt = {\n /**\n * Type guard that checks if a value is a negative integer.\n *\n * @param value - The value to check\n * @returns `true` if the value is a negative integer, `false` otherwise\n * @see {@link isNegativeInt} for usage examples\n */\n is,\n\n /**\n * The largest value representable as `NegativeInt` (the upper saturation\n * target of `fromNumber`).\n */\n MAX_VALUE,\n\n /**\n * Returns the absolute value of a negative integer.\n *\n * The result is non-negative and keeps the `NegativeInt` brand. Note that\n * `Math.abs(Number.MIN_SAFE_INTEGER)` exceeds `Number.MAX_SAFE_INTEGER`, so\n * use `SafeInt` for guaranteed precision.\n *\n * @param a - The negative integer value\n * @returns The absolute value as a non-negative `NegativeInt`\n */\n abs,\n\n /**\n * Returns the smallest of the given negative integers.\n *\n * @param values - The negative integers to compare (at least one required)\n * @returns The smallest value as a `NegativeInt`\n */\n min: min_,\n\n /**\n * Returns the largest of the given negative integers.\n *\n * @param values - The negative integers to compare (at least one required)\n * @returns The largest value as a `NegativeInt`\n */\n max: max_,\n\n /**\n * Converts an arbitrary `number` into a `NegativeInt`, rounding to the\n * nearest integer and saturating the result into the range `[MIN_VALUE,\n * MAX_VALUE]`.\n *\n * Unlike `asNegativeInt`, this is total: out-of-range inputs are clamped to\n * the nearest representable `NegativeInt` instead of throwing.\n *\n * @param value - The value to convert\n * @returns The value as a `NegativeInt`\n */\n fromNumber,\n\n /**\n * Generates a random `NegativeInt` within the given range.\n *\n * The range is inclusive on both ends.\n *\n * @param min - The minimum value (inclusive)\n * @param max - The maximum value (inclusive)\n * @returns A random `NegativeInt` in `[min, max]`\n */\n random,\n\n /**\n * Raises `a` to the power `b`, returning `a ** b` as a `NegativeInt` (floored\n * to an integer).\n *\n * @param a - The base negative integer\n * @param b - The exponent negative integer\n * @returns `a ** b` as a `NegativeInt`\n */\n pow,\n\n /**\n * Adds two negative integers, returning `a + b` as a `NegativeInt`.\n *\n * @param a - The first negative integer\n * @param b - The second negative integer\n * @returns The sum of `a` and `b` as a `NegativeInt`\n */\n add,\n\n /**\n * Subtracts two negative integers, returning `a - b` as a `NegativeInt`.\n *\n * @param a - The first negative integer\n * @param b - The second negative integer\n * @returns The difference of `a` and `b` as a `NegativeInt`\n */\n sub,\n} as const;\n"],"names":[],"m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