ts-data-forge 11.0.0 → 11.0.1

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 (171) hide show
  1. package/dist/number/branded-types/finite-number.d.mts +47 -61
  2. package/dist/number/branded-types/finite-number.d.mts.map +1 -1
  3. package/dist/number/branded-types/finite-number.mjs +37 -41
  4. package/dist/number/branded-types/finite-number.mjs.map +1 -1
  5. package/dist/number/branded-types/int.d.mts +40 -46
  6. package/dist/number/branded-types/int.d.mts.map +1 -1
  7. package/dist/number/branded-types/int.mjs +29 -31
  8. package/dist/number/branded-types/int.mjs.map +1 -1
  9. package/dist/number/branded-types/int16.d.mts +65 -58
  10. package/dist/number/branded-types/int16.d.mts.map +1 -1
  11. package/dist/number/branded-types/int16.mjs +49 -45
  12. package/dist/number/branded-types/int16.mjs.map +1 -1
  13. package/dist/number/branded-types/int32.d.mts +65 -58
  14. package/dist/number/branded-types/int32.d.mts.map +1 -1
  15. package/dist/number/branded-types/int32.mjs +49 -45
  16. package/dist/number/branded-types/int32.mjs.map +1 -1
  17. package/dist/number/branded-types/negative-finite-number.d.mts +68 -59
  18. package/dist/number/branded-types/negative-finite-number.d.mts.map +1 -1
  19. package/dist/number/branded-types/negative-finite-number.mjs +52 -46
  20. package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
  21. package/dist/number/branded-types/negative-int.d.mts +60 -48
  22. package/dist/number/branded-types/negative-int.d.mts.map +1 -1
  23. package/dist/number/branded-types/negative-int.mjs +40 -36
  24. package/dist/number/branded-types/negative-int.mjs.map +1 -1
  25. package/dist/number/branded-types/negative-safe-int.d.mts +57 -56
  26. package/dist/number/branded-types/negative-safe-int.d.mts.map +1 -1
  27. package/dist/number/branded-types/negative-safe-int.mjs +40 -41
  28. package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
  29. package/dist/number/branded-types/non-negative-finite-number.d.mts +74 -64
  30. package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -1
  31. package/dist/number/branded-types/non-negative-finite-number.mjs +58 -51
  32. package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
  33. package/dist/number/branded-types/non-negative-int16.d.mts +64 -57
  34. package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -1
  35. package/dist/number/branded-types/non-negative-int16.mjs +47 -43
  36. package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
  37. package/dist/number/branded-types/non-negative-int32.d.mts +64 -58
  38. package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -1
  39. package/dist/number/branded-types/non-negative-int32.mjs +47 -44
  40. package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
  41. package/dist/number/branded-types/non-positive-finite-number.d.mts +64 -54
  42. package/dist/number/branded-types/non-positive-finite-number.d.mts.map +1 -1
  43. package/dist/number/branded-types/non-positive-finite-number.mjs +48 -41
  44. package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
  45. package/dist/number/branded-types/non-positive-int.d.mts +41 -146
  46. package/dist/number/branded-types/non-positive-int.d.mts.map +1 -1
  47. package/dist/number/branded-types/non-positive-int.mjs +27 -107
  48. package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
  49. package/dist/number/branded-types/non-positive-safe-int.d.mts +54 -53
  50. package/dist/number/branded-types/non-positive-safe-int.d.mts.map +1 -1
  51. package/dist/number/branded-types/non-positive-safe-int.mjs +37 -39
  52. package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
  53. package/dist/number/branded-types/non-zero-finite-number.d.mts +62 -49
  54. package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -1
  55. package/dist/number/branded-types/non-zero-finite-number.mjs +46 -37
  56. package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
  57. package/dist/number/branded-types/non-zero-int.d.mts +51 -38
  58. package/dist/number/branded-types/non-zero-int.d.mts.map +1 -1
  59. package/dist/number/branded-types/non-zero-int.mjs +31 -27
  60. package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
  61. package/dist/number/branded-types/non-zero-int16.d.mts +52 -53
  62. package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -1
  63. package/dist/number/branded-types/non-zero-int16.mjs +36 -39
  64. package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
  65. package/dist/number/branded-types/non-zero-int32.d.mts +52 -54
  66. package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -1
  67. package/dist/number/branded-types/non-zero-int32.mjs +36 -40
  68. package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
  69. package/dist/number/branded-types/non-zero-safe-int.d.mts +53 -54
  70. package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -1
  71. package/dist/number/branded-types/non-zero-safe-int.mjs +36 -40
  72. package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
  73. package/dist/number/branded-types/non-zero-uint16.d.mts +52 -53
  74. package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -1
  75. package/dist/number/branded-types/non-zero-uint16.mjs +35 -39
  76. package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
  77. package/dist/number/branded-types/non-zero-uint32.d.mts +52 -53
  78. package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -1
  79. package/dist/number/branded-types/non-zero-uint32.mjs +35 -39
  80. package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
  81. package/dist/number/branded-types/positive-finite-number.d.mts +74 -63
  82. package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -1
  83. package/dist/number/branded-types/positive-finite-number.mjs +58 -50
  84. package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
  85. package/dist/number/branded-types/positive-int.d.mts +46 -68
  86. package/dist/number/branded-types/positive-int.d.mts.map +1 -1
  87. package/dist/number/branded-types/positive-int.mjs +34 -49
  88. package/dist/number/branded-types/positive-int.mjs.map +1 -1
  89. package/dist/number/branded-types/positive-int16.d.mts +61 -57
  90. package/dist/number/branded-types/positive-int16.d.mts.map +1 -1
  91. package/dist/number/branded-types/positive-int16.mjs +44 -43
  92. package/dist/number/branded-types/positive-int16.mjs.map +1 -1
  93. package/dist/number/branded-types/positive-int32.d.mts +61 -57
  94. package/dist/number/branded-types/positive-int32.d.mts.map +1 -1
  95. package/dist/number/branded-types/positive-int32.mjs +44 -43
  96. package/dist/number/branded-types/positive-int32.mjs.map +1 -1
  97. package/dist/number/branded-types/positive-safe-int.d.mts +62 -57
  98. package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
  99. package/dist/number/branded-types/positive-safe-int.mjs +45 -43
  100. package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
  101. package/dist/number/branded-types/positive-uint16.d.mts +61 -57
  102. package/dist/number/branded-types/positive-uint16.d.mts.map +1 -1
  103. package/dist/number/branded-types/positive-uint16.mjs +44 -43
  104. package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
  105. package/dist/number/branded-types/positive-uint32.d.mts +61 -58
  106. package/dist/number/branded-types/positive-uint32.d.mts.map +1 -1
  107. package/dist/number/branded-types/positive-uint32.mjs +44 -44
  108. package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
  109. package/dist/number/branded-types/safe-int.d.mts +43 -62
  110. package/dist/number/branded-types/safe-int.d.mts.map +1 -1
  111. package/dist/number/branded-types/safe-int.mjs +35 -42
  112. package/dist/number/branded-types/safe-int.mjs.map +1 -1
  113. package/dist/number/branded-types/safe-uint.d.mts +62 -57
  114. package/dist/number/branded-types/safe-uint.d.mts.map +1 -1
  115. package/dist/number/branded-types/safe-uint.mjs +46 -44
  116. package/dist/number/branded-types/safe-uint.mjs.map +1 -1
  117. package/dist/number/branded-types/uint.d.mts +63 -50
  118. package/dist/number/branded-types/uint.d.mts.map +1 -1
  119. package/dist/number/branded-types/uint.mjs +42 -39
  120. package/dist/number/branded-types/uint.mjs.map +1 -1
  121. package/dist/number/branded-types/uint16.d.mts +60 -58
  122. package/dist/number/branded-types/uint16.d.mts.map +1 -1
  123. package/dist/number/branded-types/uint16.mjs +44 -43
  124. package/dist/number/branded-types/uint16.mjs.map +1 -1
  125. package/dist/number/branded-types/uint32.d.mts +59 -55
  126. package/dist/number/branded-types/uint32.d.mts.map +1 -1
  127. package/dist/number/branded-types/uint32.mjs +42 -42
  128. package/dist/number/branded-types/uint32.mjs.map +1 -1
  129. package/dist/number/enum/int8.d.mts +56 -65
  130. package/dist/number/enum/int8.d.mts.map +1 -1
  131. package/dist/number/enum/int8.mjs +44 -43
  132. package/dist/number/enum/int8.mjs.map +1 -1
  133. package/dist/number/enum/uint8.d.mts +60 -58
  134. package/dist/number/enum/uint8.d.mts.map +1 -1
  135. package/dist/number/enum/uint8.mjs +44 -43
  136. package/dist/number/enum/uint8.mjs.map +1 -1
  137. package/package.json +2 -1
  138. package/src/number/branded-types/finite-number.mts +47 -61
  139. package/src/number/branded-types/int.mts +40 -46
  140. package/src/number/branded-types/int16.mts +65 -58
  141. package/src/number/branded-types/int32.mts +65 -58
  142. package/src/number/branded-types/negative-finite-number.mts +68 -68
  143. package/src/number/branded-types/negative-int.mts +60 -57
  144. package/src/number/branded-types/negative-safe-int.mts +57 -65
  145. package/src/number/branded-types/non-negative-finite-number.mts +74 -64
  146. package/src/number/branded-types/non-negative-int16.mts +64 -57
  147. package/src/number/branded-types/non-negative-int32.mts +64 -58
  148. package/src/number/branded-types/non-positive-finite-number.mts +64 -54
  149. package/src/number/branded-types/non-positive-int.mts +41 -146
  150. package/src/number/branded-types/non-positive-safe-int.mts +54 -53
  151. package/src/number/branded-types/non-zero-finite-number.mts +62 -51
  152. package/src/number/branded-types/non-zero-int.mts +51 -38
  153. package/src/number/branded-types/non-zero-int16.mts +52 -53
  154. package/src/number/branded-types/non-zero-int32.mts +52 -54
  155. package/src/number/branded-types/non-zero-safe-int.mts +53 -54
  156. package/src/number/branded-types/non-zero-uint16.mts +52 -53
  157. package/src/number/branded-types/non-zero-uint32.mts +52 -53
  158. package/src/number/branded-types/positive-finite-number.mts +74 -63
  159. package/src/number/branded-types/positive-int.mts +46 -68
  160. package/src/number/branded-types/positive-int16.mts +61 -57
  161. package/src/number/branded-types/positive-int32.mts +61 -57
  162. package/src/number/branded-types/positive-safe-int.mts +62 -57
  163. package/src/number/branded-types/positive-uint16.mts +61 -57
  164. package/src/number/branded-types/positive-uint32.mts +61 -58
  165. package/src/number/branded-types/safe-int.mts +43 -62
  166. package/src/number/branded-types/safe-uint.mts +62 -57
  167. package/src/number/branded-types/uint.mts +63 -50
  168. package/src/number/branded-types/uint16.mts +60 -58
  169. package/src/number/branded-types/uint32.mts +59 -55
  170. package/src/number/enum/int8.mts +56 -65
  171. package/src/number/enum/uint8.mts +60 -58
@@ -1 +1 @@
1
- {"version":3,"file":"safe-int.mjs","sources":["../../../src/number/branded-types/safe-int.mts"],"sourcesContent":["import {\n type SafeUint,\n type SafeInt as TtfImported_SafeInt,\n} from 'ts-type-forge';\nimport { expectType } from '../../expect-type.mjs';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type SafeInt = TtfImported_SafeInt;\n\ntype ElementType = SafeInt;\n\nconst typeNameInMessage = 'a safe integer';\n\nconst {\n MAX_VALUE,\n MIN_VALUE,\n abs,\n add,\n castType,\n clamp,\n div,\n is,\n max: max_,\n min: min_,\n mul,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n SafeInt,\n SafeUint\n>({\n integerOrSafeInteger: 'SafeInteger',\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-min-safe-integer\n MIN_VALUE: Number.MIN_SAFE_INTEGER as SafeInt,\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-max-safe-integer\n MAX_VALUE: Number.MAX_SAFE_INTEGER as SafeUint,\n typeNameInMessage,\n} as const);\n\n/**\n * Type guard that checks if a value is a safe integer.\n *\n * A safe integer is an integer that can be exactly represented in JavaScript\n * without precision loss. The range is [±(2^53 - 1)].\n *\n * @example\n *\n * ```ts\n * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));\n *\n * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));\n *\n * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));\n * ```\n *\n * @param value - The value to check\n * @returns `true` if the value is a safe integer, `false` otherwise\n */\nexport const isSafeInt = is;\n\n/**\n * Casts a number to a SafeInt branded type.\n *\n * This function validates that the input is a safe integer (within ±(2^53 - 1))\n * and returns it with the SafeInt brand. This ensures type safety for\n * operations that require precise integer arithmetic.\n *\n * @example\n *\n * ```ts\n * const branded = asSafeInt(123);\n *\n * assert.isTrue(branded === 123);\n *\n * assert.isTrue(SafeInt.is(branded));\n * ```\n *\n * @param value - The value to cast\n * @returns The value as a SafeInt branded type\n * @throws {TypeError} If the value is not a safe integer\n */\nexport const asSafeInt = castType;\n\n/**\n * Namespace providing type-safe operations for SafeInt branded types.\n *\n * SafeInt represents integers that can be exactly represented in JavaScript's\n * number type without precision loss. The range is [±(2^53 - 1)], which covers\n * approximately ±9 quadrillion.\n *\n * All operations automatically clamp results to stay within the safe range,\n * preventing precision loss that occurs with larger integers. This makes\n * SafeInt ideal for:\n *\n * - Financial calculations requiring exact cents\n * - Database IDs and counters\n * - Array indices and sizes\n * - Any integer arithmetic requiring precision guarantees\n */\nexport const SafeInt = {\n /**\n * Type guard that checks if a value is a safe integer.\n *\n * @example\n *\n * ```ts\n * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));\n *\n * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));\n *\n * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));\n * ```\n *\n * @param value - The value to check\n * @returns `true` if the value is a safe integer, `false` otherwise\n * @see {@link isSafeInt} for usage examples\n */\n is,\n\n /**\n * The minimum safe integer value (-(2^53 - 1)).\n *\n * @readonly\n */\n MIN_VALUE,\n\n /**\n * The maximum safe integer value (2^53 - 1).\n *\n * @readonly\n */\n MAX_VALUE,\n\n /**\n * Returns the absolute value of a safe integer.\n *\n * Note: `Math.abs(MIN_SAFE_INTEGER)` would exceed `MAX_SAFE_INTEGER`, so this\n * function clamps the result to maintain the safe integer guarantee.\n *\n * @example\n *\n * ```ts\n * const negative = asSafeInt(-900);\n *\n * const absolute = SafeInt.abs(negative);\n *\n * assert.isTrue(absolute === 900);\n *\n * assert.isTrue(SafeInt.is(absolute));\n * ```\n *\n * @param a - The safe integer value\n * @returns The absolute value as a SafeInt, clamped if necessary\n */\n abs,\n\n /**\n * Returns the minimum value from a list of safe integers.\n *\n * @example\n *\n * ```ts\n * const smallest = SafeInt.min(asSafeInt(25), asSafeInt(-14), asSafeInt(99));\n *\n * assert.isTrue(smallest === -14);\n * ```\n *\n * @param values - The safe integers to compare (at least one required)\n * @returns The smallest value as a SafeInt\n */\n min: min_,\n\n /**\n * Returns the maximum value from a list of safe integers.\n *\n * @example\n *\n * ```ts\n * const largest = SafeInt.max(asSafeInt(25), asSafeInt(-14), asSafeInt(99));\n *\n * assert.isTrue(largest === 99);\n * ```\n *\n * @param values - The safe integers to compare (at least one required)\n * @returns The largest value as a SafeInt\n */\n max: max_,\n\n /**\n * Clamps a number to the safe integer range.\n *\n * @example\n *\n * ```ts\n * const aboveRange = SafeInt.clamp(1e20);\n *\n * const withinRange = SafeInt.clamp(123);\n *\n * const belowRange = SafeInt.clamp(-1e20);\n *\n * assert.isTrue(aboveRange === Number.MAX_SAFE_INTEGER);\n *\n * assert.isTrue(withinRange === 123);\n *\n * assert.isTrue(belowRange === Number.MIN_SAFE_INTEGER);\n * ```\n *\n * @param value The number to clamp.\n * @returns The value clamped to [MIN_SAFE_INTEGER, MAX_SAFE_INTEGER] as a\n * SafeInt.\n */\n clamp,\n\n /**\n * Generates a random safe integer within the specified range (inclusive).\n *\n * The range is inclusive on both ends. If min > max, they are automatically\n * swapped.\n *\n * @example\n *\n * ```ts\n * const min = asSafeInt(-10);\n *\n * const max = asSafeInt(10);\n *\n * const randomValue = SafeInt.random(min, max);\n *\n * assert.isTrue(SafeInt.is(randomValue));\n *\n * assert.isTrue(randomValue >= -10 && randomValue <= 10);\n * ```\n *\n * @param min - The minimum value (inclusive)\n * @param max - The maximum value (inclusive)\n * @returns A random SafeInt in the range [min, max]\n */\n random,\n\n /**\n * Raises a SafeInt to the power of another SafeInt.\n *\n * @example\n *\n * ```ts\n * const base = asSafeInt(3);\n *\n * const exponent = asSafeInt(5);\n *\n * const power = SafeInt.pow(base, exponent);\n *\n * assert.isTrue(power === 243);\n *\n * assert.isTrue(SafeInt.is(power));\n * ```\n *\n * @param a The base SafeInt.\n * @param b The exponent SafeInt.\n * @returns `a ** b` clamped to safe integer range as a SafeInt.\n */\n pow,\n\n /**\n * Adds two SafeInt values.\n *\n * @example\n *\n * ```ts\n * const sum = SafeInt.add(asSafeInt(9), asSafeInt(4));\n *\n * assert.isTrue(sum === 13);\n *\n * assert.isTrue(SafeInt.is(sum));\n * ```\n *\n * @param a The first SafeInt.\n * @param b The second SafeInt.\n * @returns `a + b` clamped to safe integer range as a SafeInt.\n */\n add,\n\n /**\n * Subtracts one SafeInt from another.\n *\n * @example\n *\n * ```ts\n * const difference = SafeInt.sub(asSafeInt(9), asSafeInt(14));\n *\n * assert.isTrue(difference === -5);\n *\n * assert.isTrue(SafeInt.is(difference));\n * ```\n *\n * @param a The minuend SafeInt.\n * @param b The subtrahend SafeInt.\n * @returns `a - b` clamped to safe integer range as a SafeInt.\n */\n sub,\n\n /**\n * Multiplies two SafeInt values.\n *\n * @example\n *\n * ```ts\n * const product = SafeInt.mul(asSafeInt(-8), asSafeInt(7));\n *\n * assert.isTrue(product === -56);\n *\n * assert.isTrue(SafeInt.is(product));\n * ```\n *\n * @param a The first SafeInt.\n * @param b The second SafeInt.\n * @returns `a * b` clamped to safe integer range as a SafeInt.\n */\n mul,\n\n /**\n * Divides one SafeInt by another using floor division.\n *\n * Performs mathematical floor division: `⌊a / b⌋`. The divisor must be\n * non-zero (enforced by type constraints).\n *\n * @example\n *\n * ```ts\n * const quotient = SafeInt.div(asSafeInt(-17), asSafeInt(5));\n *\n * assert.isTrue(quotient === -4);\n *\n * assert.isTrue(SafeInt.is(quotient));\n * ```\n *\n * @param a - The dividend\n * @param b - The divisor (must be non-zero)\n * @returns The integer quotient as a SafeInt\n */\n div,\n} as const;\n\nexpectType<\n keyof typeof SafeInt,\n keyof TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int' | 'range'\n >\n>('=');\n\nexpectType<\n typeof SafeInt,\n TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int' | 'range'\n >\n>('<=');\n"],"names":[],"mappings":";;AAWA,MAAM,iBAAA,GAAoB,gBAAA;AAE1B,MAAM;AAAA,EACJ,SAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,GAAI,oBAAA,CAAqB,mBAAmB,mBAAA,CAI1C;AAAA,EACA,oBAAA,EAAsB,aAAA;AAAA;AAAA,EAEtB,WAAW,MAAA,CAAO,gBAAA;AAAA;AAAA,EAElB,WAAW,MAAA,CAAO,gBAAA;AAAA,EAClB;AACF,CAAU,CAAA;AAqBH,MAAM,SAAA,GAAY;AAuBlB,MAAM,SAAA,GAAY;AAkBlB,MAAM,OAAA,GAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBrB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBA;AACF;;;;"}
1
+ {"version":3,"file":"safe-int.mjs","sources":["../../../src/number/branded-types/safe-int.mts"],"sourcesContent":["import {\n type SafeUint,\n type SafeInt as TtfImported_SafeInt,\n} from 'ts-type-forge';\nimport { expectType } from '../../expect-type.mjs';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type SafeInt = TtfImported_SafeInt;\n\ntype ElementType = SafeInt;\n\nconst typeNameInMessage = 'a safe integer';\n\nconst {\n MAX_VALUE,\n MIN_VALUE,\n abs,\n add,\n castType,\n clamp,\n div,\n is,\n max: max_,\n min: min_,\n mul,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n SafeInt,\n SafeUint\n>({\n integerOrSafeInteger: 'SafeInteger',\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-min-safe-integer\n MIN_VALUE: Number.MIN_SAFE_INTEGER as SafeInt,\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-max-safe-integer\n MAX_VALUE: Number.MAX_SAFE_INTEGER as SafeUint,\n typeNameInMessage,\n} as const);\n\n/**\n * Type guard that checks if a value is a safe integer.\n *\n * Returns `true` for a safe integer — a value with no fractional component.\n *\n * @example\n *\n * ```ts\n * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));\n *\n * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));\n *\n * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));\n * ```\n *\n * @param value - The value to check\n * @returns `true` if the value is a safe integer, `false` otherwise\n */\nexport const isSafeInt = is;\n\n/**\n * Casts a `number` to the `SafeInt` branded type.\n *\n * Validates that the value is a safe integer and returns it with the `SafeInt`\n * brand. Throws a `TypeError` otherwise.\n *\n * @example\n *\n * ```ts\n * const branded = asSafeInt(123);\n *\n * assert.isTrue(branded === 123);\n *\n * assert.isTrue(SafeInt.is(branded));\n * ```\n *\n * @param value - The value to cast\n * @returns The value as a `SafeInt`\n * @throws {TypeError} If the value is not a safe integer\n */\nexport const asSafeInt = castType;\n\n/**\n * Namespace providing type-safe operations for the `SafeInt` branded type.\n *\n * The `SafeInt` type represents a safe integer. Division (`div`) uses floor\n * division.\n */\nexport const SafeInt = {\n /**\n * Type guard that checks if a value is a safe integer.\n *\n * @example\n *\n * ```ts\n * assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));\n *\n * assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));\n *\n * assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));\n * ```\n *\n * @param value - The value to check\n * @returns `true` if the value is a safe integer, `false` otherwise\n * @see {@link isSafeInt} for usage examples\n */\n is,\n\n /**\n * The smallest value representable as `SafeInt`.\n */\n MIN_VALUE,\n\n /**\n * The largest value representable as `SafeInt`.\n */\n MAX_VALUE,\n\n /**\n * Returns the absolute value of a safe integer.\n *\n * The result is non-negative and keeps the `SafeInt` brand.\n *\n * @example\n *\n * ```ts\n * const negative = asSafeInt(-900);\n *\n * const absolute = SafeInt.abs(negative);\n *\n * assert.isTrue(absolute === 900);\n *\n * assert.isTrue(SafeInt.is(absolute));\n * ```\n *\n * @param a - The safe integer value\n * @returns The absolute value as a non-negative `SafeInt`\n */\n abs,\n\n /**\n * Returns the smallest of the given safe integers.\n *\n * @example\n *\n * ```ts\n * const smallest = SafeInt.min(asSafeInt(25), asSafeInt(-14), asSafeInt(99));\n *\n * assert.isTrue(smallest === -14);\n * ```\n *\n * @param values - The safe integers to compare (at least one required)\n * @returns The smallest value as a `SafeInt`\n */\n min: min_,\n\n /**\n * Returns the largest of the given safe integers.\n *\n * @example\n *\n * ```ts\n * const largest = SafeInt.max(asSafeInt(25), asSafeInt(-14), asSafeInt(99));\n *\n * assert.isTrue(largest === 99);\n * ```\n *\n * @param values - The safe integers to compare (at least one required)\n * @returns The largest value as a `SafeInt`\n */\n max: max_,\n\n /**\n * Clamps a `number` into the `SafeInt` range, rounding to the nearest integer\n * and constraining the result to `[MIN_VALUE, MAX_VALUE]`.\n *\n * @example\n *\n * ```ts\n * const aboveRange = SafeInt.clamp(1e20);\n *\n * const withinRange = SafeInt.clamp(123);\n *\n * const belowRange = SafeInt.clamp(-1e20);\n *\n * assert.isTrue(aboveRange === Number.MAX_SAFE_INTEGER);\n *\n * assert.isTrue(withinRange === 123);\n *\n * assert.isTrue(belowRange === Number.MIN_SAFE_INTEGER);\n * ```\n *\n * @param value - The value to clamp\n * @returns The clamped value as a `SafeInt`\n */\n clamp,\n\n /**\n * Generates a random `SafeInt` within the given range.\n *\n * The range is inclusive on both ends.\n *\n * @example\n *\n * ```ts\n * const min = asSafeInt(-10);\n *\n * const max = asSafeInt(10);\n *\n * const randomValue = SafeInt.random(min, max);\n *\n * assert.isTrue(SafeInt.is(randomValue));\n *\n * assert.isTrue(randomValue >= -10 && randomValue <= 10);\n * ```\n *\n * @param min - The minimum value (inclusive)\n * @param max - The maximum value (inclusive)\n * @returns A random `SafeInt` in `[min, max]`\n */\n random,\n\n /**\n * Raises `a` to the power `b`, returning `a ** b` as a `SafeInt` (floored to\n * an integer).\n *\n * @example\n *\n * ```ts\n * const base = asSafeInt(3);\n *\n * const exponent = asSafeInt(5);\n *\n * const power = SafeInt.pow(base, exponent);\n *\n * assert.isTrue(power === 243);\n *\n * assert.isTrue(SafeInt.is(power));\n * ```\n *\n * @param a - The base safe integer\n * @param b - The exponent safe integer\n * @returns `a ** b` as a `SafeInt`\n */\n pow,\n\n /**\n * Adds two safe integers, returning `a + b` as a `SafeInt`.\n *\n * @example\n *\n * ```ts\n * const sum = SafeInt.add(asSafeInt(9), asSafeInt(4));\n *\n * assert.isTrue(sum === 13);\n *\n * assert.isTrue(SafeInt.is(sum));\n * ```\n *\n * @param a - The first safe integer\n * @param b - The second safe integer\n * @returns The sum of `a` and `b` as a `SafeInt`\n */\n add,\n\n /**\n * Subtracts two safe integers, returning `a - b` as a `SafeInt`.\n *\n * @example\n *\n * ```ts\n * const difference = SafeInt.sub(asSafeInt(9), asSafeInt(14));\n *\n * assert.isTrue(difference === -5);\n *\n * assert.isTrue(SafeInt.is(difference));\n * ```\n *\n * @param a - The first safe integer\n * @param b - The second safe integer\n * @returns The difference of `a` and `b` as a `SafeInt`\n */\n sub,\n\n /**\n * Multiplies two safe integers, returning `a * b` as a `SafeInt`.\n *\n * @example\n *\n * ```ts\n * const product = SafeInt.mul(asSafeInt(-8), asSafeInt(7));\n *\n * assert.isTrue(product === -56);\n *\n * assert.isTrue(SafeInt.is(product));\n * ```\n *\n * @param a - The first safe integer\n * @param b - The second safe integer\n * @returns The product of `a` and `b` as a `SafeInt`\n */\n mul,\n\n /**\n * Divides two safe integers using floor division (`⌊a / b⌋`): the result is\n * `a / b` rounded toward negative infinity, as a `SafeInt`.\n *\n * @example\n *\n * ```ts\n * const quotient = SafeInt.div(asSafeInt(-17), asSafeInt(5));\n *\n * assert.isTrue(quotient === -4);\n *\n * assert.isTrue(SafeInt.is(quotient));\n * ```\n *\n * @param a - The dividend\n * @param b - The divisor (must be non-zero)\n * @returns The floored quotient as a `SafeInt`\n */\n div,\n} as const;\n\nexpectType<\n keyof typeof SafeInt,\n keyof TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int' | 'range'\n >\n>('=');\n\nexpectType<\n typeof SafeInt,\n TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int' | 'range'\n >\n>('<=');\n"],"names":[],"mappings":";;AAWA,MAAM,iBAAA,GAAoB,gBAAA;AAE1B,MAAM;AAAA,EACJ,SAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,GAAA;AAAA,EAC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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBA;AACF;;;;"}
@@ -1,18 +1,24 @@
1
1
  import { type SafeUint as TtfImported_SafeUint } from 'ts-type-forge';
2
2
  export type SafeUint = TtfImported_SafeUint;
3
3
  /**
4
- * Checks if a number is a SafeUint.
4
+ * Type guard that checks if a value is a non-negative safe integer.
5
5
  *
6
- * @param value The value to check.
7
- * @returns `true` if the value is a SafeUint, `false` otherwise.
6
+ * Returns `true` for a non-negative safe integer — a value with no fractional
7
+ * component.
8
+ *
9
+ * @param value - The value to check
10
+ * @returns `true` if the value is a non-negative safe integer, `false` otherwise
8
11
  */
9
12
  export declare const isSafeUint: (a: number) => a is TtfImported_SafeUint;
10
13
  /**
11
- * Casts a number to a SafeUint type.
14
+ * Casts a `number` to the `SafeUint` branded type.
15
+ *
16
+ * Validates that the value is a non-negative safe integer and returns it with
17
+ * the `SafeUint` brand. Throws a `TypeError` otherwise.
12
18
  *
13
- * @param value The value to cast.
14
- * @returns The value as a SafeUint type.
15
- * @throws {TypeError} If the value is not a non-negative safe integer.
19
+ * @param value - The value to cast
20
+ * @returns The value as a `SafeUint`
21
+ * @throws {TypeError} If the value is not a non-negative safe integer
16
22
  */
17
23
  export declare const asSafeUint: <N extends number>(x: N) => number & {
18
24
  readonly "> -2^16": true;
@@ -28,103 +34,102 @@ export declare const asSafeUint: <N extends number>(x: N) => number & {
28
34
  'TSTypeForgeInternals--edd2f9ce-7ca5-45b0-9d1a-bd61b9b5d9c3': unknown;
29
35
  }> & N;
30
36
  /**
31
- * Namespace providing type-safe arithmetic operations for safe unsigned
32
- * integers.
37
+ * Namespace providing type-safe operations for the `SafeUint` branded type.
33
38
  *
34
- * All operations automatically clamp results to the safe unsigned integer range
35
- * [0, MAX_SAFE_INTEGER]. This ensures that all arithmetic maintains both the
36
- * non-negative constraint and IEEE 754 precision guarantees, preventing
37
- * precision loss while ensuring results are never negative.
39
+ * The `SafeUint` type represents a non-negative safe integer. Division (`div`)
40
+ * uses floor division.
38
41
  */
39
42
  export declare const SafeUint: {
40
43
  /**
41
- * Type guard to check if a value is a SafeUint.
44
+ * Type guard that checks if a value is a non-negative safe integer.
42
45
  *
43
- * @param value The value to check.
44
- * @returns `true` if the value is a non-negative safe integer, `false`
45
- * otherwise.
46
+ * @param value - The value to check
47
+ * @returns `true` if the value is a non-negative safe integer, `false` otherwise
48
+ * @see {@link isSafeUint} for usage examples
46
49
  */
47
50
  readonly is: (a: number) => a is TtfImported_SafeUint;
48
51
  /**
49
- * The minimum value for a safe unsigned integer.
50
- *
51
- * @readonly
52
+ * The smallest value representable as `SafeUint`.
52
53
  */
53
54
  readonly MIN_VALUE: 0;
54
55
  /**
55
- * The maximum safe integer value (2^53 - 1).
56
- *
57
- * @readonly
56
+ * The largest value representable as `SafeUint`.
58
57
  */
59
58
  readonly MAX_VALUE: TtfImported_SafeUint;
60
59
  /**
61
- * Returns the smaller of two SafeUint values.
60
+ * Returns the smallest of the given non-negative safe integers.
62
61
  *
63
- * @param a The first SafeUint.
64
- * @param b The second SafeUint.
65
- * @returns The minimum value as a SafeUint.
62
+ * @param values - The non-negative safe integers to compare (at least one required)
63
+ * @returns The smallest value as a `SafeUint`
66
64
  */
67
65
  readonly min: (...values: readonly import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>[]) => TtfImported_SafeUint;
68
66
  /**
69
- * Returns the larger of two SafeUint values.
67
+ * Returns the largest of the given non-negative safe integers.
70
68
  *
71
- * @param a The first SafeUint.
72
- * @param b The second SafeUint.
73
- * @returns The maximum value as a SafeUint.
69
+ * @param values - The non-negative safe integers to compare (at least one required)
70
+ * @returns The largest value as a `SafeUint`
74
71
  */
75
72
  readonly max: (...values: readonly import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>[]) => TtfImported_SafeUint;
76
73
  /**
77
- * Clamps a number to the safe unsigned integer range.
74
+ * Clamps a `number` into the `SafeUint` range, rounding to the nearest
75
+ * integer and constraining the result to `[MIN_VALUE, MAX_VALUE]`.
78
76
  *
79
- * @param value The number to clamp.
80
- * @returns The value clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
77
+ * @param value - The value to clamp
78
+ * @returns The clamped value as a `SafeUint`
81
79
  */
82
80
  readonly clamp: (x: number) => TtfImported_SafeUint;
83
81
  /**
84
- * Generates a random SafeUint value within the valid range.
82
+ * Generates a random `SafeUint` within the given range.
83
+ *
84
+ * The range is inclusive on both ends.
85
85
  *
86
- * @returns A random SafeUint between 0 and MAX_SAFE_INTEGER.
86
+ * @param min - The minimum value (inclusive)
87
+ * @param max - The maximum value (inclusive)
88
+ * @returns A random `SafeUint` in `[min, max]`
87
89
  */
88
90
  readonly random: (min?: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint> | undefined, max?: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint> | undefined) => TtfImported_SafeUint;
89
91
  /**
90
- * Raises a SafeUint to the power of another SafeUint.
92
+ * Raises `a` to the power `b`, returning `a ** b` as a `SafeUint` (floored to
93
+ * an integer).
91
94
  *
92
- * @param a The base SafeUint.
93
- * @param b The exponent SafeUint.
94
- * @returns `a ** b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
95
+ * @param a - The base non-negative safe integer
96
+ * @param b - The exponent non-negative safe integer
97
+ * @returns `a ** b` as a `SafeUint`
95
98
  */
96
99
  readonly pow: (x: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>, y: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>) => TtfImported_SafeUint;
97
100
  /**
98
- * Adds two SafeUint values.
101
+ * Adds two non-negative safe integers, returning `a + b` as a `SafeUint`.
99
102
  *
100
- * @param a The first SafeUint.
101
- * @param b The second SafeUint.
102
- * @returns `a + b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
103
+ * @param a - The first non-negative safe integer
104
+ * @param b - The second non-negative safe integer
105
+ * @returns The sum of `a` and `b` as a `SafeUint`
103
106
  */
104
107
  readonly add: (x: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>, y: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>) => TtfImported_SafeUint;
105
108
  /**
106
- * Subtracts one SafeUint from another.
109
+ * Subtracts two non-negative safe integers, returning `a - b` as a
110
+ * `SafeUint`.
107
111
  *
108
- * @param a The minuend SafeUint.
109
- * @param b The subtrahend SafeUint.
110
- * @returns `a - b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint (minimum
111
- * 0).
112
+ * @param a - The first non-negative safe integer
113
+ * @param b - The second non-negative safe integer
114
+ * @returns The difference of `a` and `b` as a `SafeUint`
112
115
  */
113
116
  readonly sub: (x: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>, y: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>) => TtfImported_SafeUint;
114
117
  /**
115
- * Multiplies two SafeUint values.
118
+ * Multiplies two non-negative safe integers, returning `a * b` as a
119
+ * `SafeUint`.
116
120
  *
117
- * @param a The first SafeUint.
118
- * @param b The second SafeUint.
119
- * @returns `a * b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
121
+ * @param a - The first non-negative safe integer
122
+ * @param b - The second non-negative safe integer
123
+ * @returns The product of `a` and `b` as a `SafeUint`
120
124
  */
121
125
  readonly mul: (x: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>, y: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>) => TtfImported_SafeUint;
122
126
  /**
123
- * Divides one SafeUint by another using floor division.
127
+ * Divides two non-negative safe integers using floor division (`⌊a / b⌋`):
128
+ * the result is `a / b` rounded toward negative infinity, as a `SafeUint`.
124
129
  *
125
- * @param a The dividend SafeUint.
126
- * @param b The divisor SafeUint.
127
- * @returns `⌊a / b⌋` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
130
+ * @param a - The dividend
131
+ * @param b - The divisor (must be non-zero)
132
+ * @returns The floored quotient as a `SafeUint`
128
133
  */
129
134
  readonly div: (x: import("ts-type-forge").WithSmallInt<TtfImported_SafeUint>, y: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | import("ts-type-forge").NormalizeBrandUnion<number & {
130
135
  readonly "!=0": true;
@@ -1 +1 @@
1
- {"version":3,"file":"safe-uint.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/safe-uint.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAItE,MAAM,MAAM,QAAQ,GAAG,oBAAoB,CAAC;AAgC5C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,0CAAK,CAAC;AAE7B;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;MAAW,CAAC;AAEnC;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;;OAMG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;;;OAMG;;IAGH;;;;;;OAMG;;IAGH;;;;;OAKG;;IAGH;;;;OAIG;;IAGH;;;;;;OAMG;;IAGH;;;;;;OAMG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;OAMG;;IAGH;;;;;;OAMG;;;;;;;;;;;;;;;CAEK,CAAC"}
1
+ {"version":3,"file":"safe-uint.d.mts","sourceRoot":"","sources":["../../../src/number/branded-types/safe-uint.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAItE,MAAM,MAAM,QAAQ,GAAG,oBAAoB,CAAC;AAgC5C;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,0CAAK,CAAC;AAE7B;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;MAAW,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;;OAMG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;;OAMG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;OAMG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;;;;;;;;;;;;;;CAEK,CAAC"}
@@ -26,93 +26,95 @@ const isSafeUint = is;
26
26
  const asSafeUint = castType;
27
27
  const SafeUint = {
28
28
  /**
29
- * Type guard to check if a value is a SafeUint.
29
+ * Type guard that checks if a value is a non-negative safe integer.
30
30
  *
31
- * @param value The value to check.
32
- * @returns `true` if the value is a non-negative safe integer, `false`
33
- * otherwise.
31
+ * @param value - The value to check
32
+ * @returns `true` if the value is a non-negative safe integer, `false` otherwise
33
+ * @see {@link isSafeUint} for usage examples
34
34
  */
35
35
  is,
36
36
  /**
37
- * The minimum value for a safe unsigned integer.
38
- *
39
- * @readonly
37
+ * The smallest value representable as `SafeUint`.
40
38
  */
41
39
  MIN_VALUE,
42
40
  /**
43
- * The maximum safe integer value (2^53 - 1).
44
- *
45
- * @readonly
41
+ * The largest value representable as `SafeUint`.
46
42
  */
47
43
  MAX_VALUE,
48
44
  /**
49
- * Returns the smaller of two SafeUint values.
45
+ * Returns the smallest of the given non-negative safe integers.
50
46
  *
51
- * @param a The first SafeUint.
52
- * @param b The second SafeUint.
53
- * @returns The minimum value as a SafeUint.
47
+ * @param values - The non-negative safe integers to compare (at least one required)
48
+ * @returns The smallest value as a `SafeUint`
54
49
  */
55
50
  min: min_,
56
51
  /**
57
- * Returns the larger of two SafeUint values.
52
+ * Returns the largest of the given non-negative safe integers.
58
53
  *
59
- * @param a The first SafeUint.
60
- * @param b The second SafeUint.
61
- * @returns The maximum value as a SafeUint.
54
+ * @param values - The non-negative safe integers to compare (at least one required)
55
+ * @returns The largest value as a `SafeUint`
62
56
  */
63
57
  max: max_,
64
58
  /**
65
- * Clamps a number to the safe unsigned integer range.
59
+ * Clamps a `number` into the `SafeUint` range, rounding to the nearest
60
+ * integer and constraining the result to `[MIN_VALUE, MAX_VALUE]`.
66
61
  *
67
- * @param value The number to clamp.
68
- * @returns The value clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
62
+ * @param value - The value to clamp
63
+ * @returns The clamped value as a `SafeUint`
69
64
  */
70
65
  clamp,
71
66
  /**
72
- * Generates a random SafeUint value within the valid range.
67
+ * Generates a random `SafeUint` within the given range.
68
+ *
69
+ * The range is inclusive on both ends.
73
70
  *
74
- * @returns A random SafeUint between 0 and MAX_SAFE_INTEGER.
71
+ * @param min - The minimum value (inclusive)
72
+ * @param max - The maximum value (inclusive)
73
+ * @returns A random `SafeUint` in `[min, max]`
75
74
  */
76
75
  random,
77
76
  /**
78
- * Raises a SafeUint to the power of another SafeUint.
77
+ * Raises `a` to the power `b`, returning `a ** b` as a `SafeUint` (floored to
78
+ * an integer).
79
79
  *
80
- * @param a The base SafeUint.
81
- * @param b The exponent SafeUint.
82
- * @returns `a ** b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
80
+ * @param a - The base non-negative safe integer
81
+ * @param b - The exponent non-negative safe integer
82
+ * @returns `a ** b` as a `SafeUint`
83
83
  */
84
84
  pow,
85
85
  /**
86
- * Adds two SafeUint values.
86
+ * Adds two non-negative safe integers, returning `a + b` as a `SafeUint`.
87
87
  *
88
- * @param a The first SafeUint.
89
- * @param b The second SafeUint.
90
- * @returns `a + b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
88
+ * @param a - The first non-negative safe integer
89
+ * @param b - The second non-negative safe integer
90
+ * @returns The sum of `a` and `b` as a `SafeUint`
91
91
  */
92
92
  add,
93
93
  /**
94
- * Subtracts one SafeUint from another.
94
+ * Subtracts two non-negative safe integers, returning `a - b` as a
95
+ * `SafeUint`.
95
96
  *
96
- * @param a The minuend SafeUint.
97
- * @param b The subtrahend SafeUint.
98
- * @returns `a - b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint (minimum
99
- * 0).
97
+ * @param a - The first non-negative safe integer
98
+ * @param b - The second non-negative safe integer
99
+ * @returns The difference of `a` and `b` as a `SafeUint`
100
100
  */
101
101
  sub,
102
102
  /**
103
- * Multiplies two SafeUint values.
103
+ * Multiplies two non-negative safe integers, returning `a * b` as a
104
+ * `SafeUint`.
104
105
  *
105
- * @param a The first SafeUint.
106
- * @param b The second SafeUint.
107
- * @returns `a * b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
106
+ * @param a - The first non-negative safe integer
107
+ * @param b - The second non-negative safe integer
108
+ * @returns The product of `a` and `b` as a `SafeUint`
108
109
  */
109
110
  mul,
110
111
  /**
111
- * Divides one SafeUint by another using floor division.
112
+ * Divides two non-negative safe integers using floor division (`⌊a / b⌋`):
113
+ * the result is `a / b` rounded toward negative infinity, as a `SafeUint`.
112
114
  *
113
- * @param a The dividend SafeUint.
114
- * @param b The divisor SafeUint.
115
- * @returns `⌊a / b⌋` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.
115
+ * @param a - The dividend
116
+ * @param b - The divisor (must be non-zero)
117
+ * @returns The floored quotient as a `SafeUint`
116
118
  */
117
119
  div
118
120
  };
@@ -1 +1 @@
1
- {"version":3,"file":"safe-uint.mjs","sources":["../../../src/number/branded-types/safe-uint.mts"],"sourcesContent":["import { type SafeUint as TtfImported_SafeUint } from 'ts-type-forge';\nimport { expectType } from '../../expect-type.mjs';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type SafeUint = TtfImported_SafeUint;\n\ntype ElementType = SafeUint;\n\nconst typeNameInMessage = 'a non-negative safe integer';\n\nconst {\n MAX_VALUE,\n MIN_VALUE,\n add,\n castType,\n clamp,\n div,\n is,\n max: max_,\n min: min_,\n mul,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n 0,\n SafeUint\n>({\n integerOrSafeInteger: 'SafeInteger',\n MIN_VALUE: 0,\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-max-safe-integer\n MAX_VALUE: Number.MAX_SAFE_INTEGER as SafeUint,\n typeNameInMessage,\n} as const);\n\n/**\n * Checks if a number is a SafeUint.\n *\n * @param value The value to check.\n * @returns `true` if the value is a SafeUint, `false` otherwise.\n */\nexport const isSafeUint = is;\n\n/**\n * Casts a number to a SafeUint type.\n *\n * @param value The value to cast.\n * @returns The value as a SafeUint type.\n * @throws {TypeError} If the value is not a non-negative safe integer.\n */\nexport const asSafeUint = castType;\n\n/**\n * Namespace providing type-safe arithmetic operations for safe unsigned\n * integers.\n *\n * All operations automatically clamp results to the safe unsigned integer range\n * [0, MAX_SAFE_INTEGER]. This ensures that all arithmetic maintains both the\n * non-negative constraint and IEEE 754 precision guarantees, preventing\n * precision loss while ensuring results are never negative.\n */\nexport const SafeUint = {\n /**\n * Type guard to check if a value is a SafeUint.\n *\n * @param value The value to check.\n * @returns `true` if the value is a non-negative safe integer, `false`\n * otherwise.\n */\n is,\n\n /**\n * The minimum value for a safe unsigned integer.\n *\n * @readonly\n */\n MIN_VALUE,\n\n /**\n * The maximum safe integer value (2^53 - 1).\n *\n * @readonly\n */\n MAX_VALUE,\n\n /**\n * Returns the smaller of two SafeUint values.\n *\n * @param a The first SafeUint.\n * @param b The second SafeUint.\n * @returns The minimum value as a SafeUint.\n */\n min: min_,\n\n /**\n * Returns the larger of two SafeUint values.\n *\n * @param a The first SafeUint.\n * @param b The second SafeUint.\n * @returns The maximum value as a SafeUint.\n */\n max: max_,\n\n /**\n * Clamps a number to the safe unsigned integer range.\n *\n * @param value The number to clamp.\n * @returns The value clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.\n */\n clamp,\n\n /**\n * Generates a random SafeUint value within the valid range.\n *\n * @returns A random SafeUint between 0 and MAX_SAFE_INTEGER.\n */\n random,\n\n /**\n * Raises a SafeUint to the power of another SafeUint.\n *\n * @param a The base SafeUint.\n * @param b The exponent SafeUint.\n * @returns `a ** b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.\n */\n pow,\n\n /**\n * Adds two SafeUint values.\n *\n * @param a The first SafeUint.\n * @param b The second SafeUint.\n * @returns `a + b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.\n */\n add,\n\n /**\n * Subtracts one SafeUint from another.\n *\n * @param a The minuend SafeUint.\n * @param b The subtrahend SafeUint.\n * @returns `a - b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint (minimum\n * 0).\n */\n sub,\n\n /**\n * Multiplies two SafeUint values.\n *\n * @param a The first SafeUint.\n * @param b The second SafeUint.\n * @returns `a * b` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.\n */\n mul,\n\n /**\n * Divides one SafeUint by another using floor division.\n *\n * @param a The dividend SafeUint.\n * @param b The divisor SafeUint.\n * @returns `⌊a / b⌋` clamped to [0, MAX_SAFE_INTEGER] as a SafeUint.\n */\n div,\n} as const;\n\nexpectType<\n keyof typeof SafeUint,\n keyof TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int' | 'non-negative' | 'range'\n >\n>('=');\n\nexpectType<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EAUA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA;AACF;;;;"}
1
+ {"version":3,"file":"safe-uint.mjs","sources":["../../../src/number/branded-types/safe-uint.mts"],"sourcesContent":["import { type SafeUint as TtfImported_SafeUint } from 'ts-type-forge';\nimport { expectType } from '../../expect-type.mjs';\nimport { TsDataForgeInternals } from '../refined-number-utils.mjs';\n\nexport type SafeUint = TtfImported_SafeUint;\n\ntype ElementType = SafeUint;\n\nconst typeNameInMessage = 'a non-negative safe integer';\n\nconst {\n MAX_VALUE,\n MIN_VALUE,\n add,\n castType,\n clamp,\n div,\n is,\n max: max_,\n min: min_,\n mul,\n pow,\n random,\n sub,\n} = TsDataForgeInternals.RefinedNumberUtils.operatorsForInteger<\n ElementType,\n 0,\n SafeUint\n>({\n integerOrSafeInteger: 'SafeInteger',\n MIN_VALUE: 0,\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion, math/prefer-number-max-safe-integer\n MAX_VALUE: Number.MAX_SAFE_INTEGER as SafeUint,\n typeNameInMessage,\n} as const);\n\n/**\n * Type guard that checks if a value is a non-negative safe integer.\n *\n * Returns `true` for a non-negative safe integer — a value with no fractional\n * component.\n *\n * @param value - The value to check\n * @returns `true` if the value is a non-negative safe integer, `false` otherwise\n */\nexport const isSafeUint = is;\n\n/**\n * Casts a `number` to the `SafeUint` branded type.\n *\n * Validates that the value is a non-negative safe integer and returns it with\n * the `SafeUint` brand. Throws a `TypeError` otherwise.\n *\n * @param value - The value to cast\n * @returns The value as a `SafeUint`\n * @throws {TypeError} If the value is not a non-negative safe integer\n */\nexport const asSafeUint = castType;\n\n/**\n * Namespace providing type-safe operations for the `SafeUint` branded type.\n *\n * The `SafeUint` type represents a non-negative safe integer. Division (`div`)\n * uses floor division.\n */\nexport const SafeUint = {\n /**\n * Type guard that checks if a value is a non-negative safe integer.\n *\n * @param value - The value to check\n * @returns `true` if the value is a non-negative safe integer, `false` otherwise\n * @see {@link isSafeUint} for usage examples\n */\n is,\n\n /**\n * The smallest value representable as `SafeUint`.\n */\n MIN_VALUE,\n\n /**\n * The largest value representable as `SafeUint`.\n */\n MAX_VALUE,\n\n /**\n * Returns the smallest of the given non-negative safe integers.\n *\n * @param values - The non-negative safe integers to compare (at least one required)\n * @returns The smallest value as a `SafeUint`\n */\n min: min_,\n\n /**\n * Returns the largest of the given non-negative safe integers.\n *\n * @param values - The non-negative safe integers to compare (at least one required)\n * @returns The largest value as a `SafeUint`\n */\n max: max_,\n\n /**\n * Clamps a `number` into the `SafeUint` range, rounding to the nearest\n * integer and constraining the result to `[MIN_VALUE, MAX_VALUE]`.\n *\n * @param value - The value to clamp\n * @returns The clamped value as a `SafeUint`\n */\n clamp,\n\n /**\n * Generates a random `SafeUint` 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 `SafeUint` in `[min, max]`\n */\n random,\n\n /**\n * Raises `a` to the power `b`, returning `a ** b` as a `SafeUint` (floored to\n * an integer).\n *\n * @param a - The base non-negative safe integer\n * @param b - The exponent non-negative safe integer\n * @returns `a ** b` as a `SafeUint`\n */\n pow,\n\n /**\n * Adds two non-negative safe integers, returning `a + b` as a `SafeUint`.\n *\n * @param a - The first non-negative safe integer\n * @param b - The second non-negative safe integer\n * @returns The sum of `a` and `b` as a `SafeUint`\n */\n add,\n\n /**\n * Subtracts two non-negative safe integers, returning `a - b` as a\n * `SafeUint`.\n *\n * @param a - The first non-negative safe integer\n * @param b - The second non-negative safe integer\n * @returns The difference of `a` and `b` as a `SafeUint`\n */\n sub,\n\n /**\n * Multiplies two non-negative safe integers, returning `a * b` as a\n * `SafeUint`.\n *\n * @param a - The first non-negative safe integer\n * @param b - The second non-negative safe integer\n * @returns The product of `a` and `b` as a `SafeUint`\n */\n mul,\n\n /**\n * Divides two non-negative safe integers using floor division (`⌊a / b⌋`):\n * the result is `a / b` rounded toward negative infinity, as a `SafeUint`.\n *\n * @param a - The dividend\n * @param b - The divisor (must be non-zero)\n * @returns The floored quotient as a `SafeUint`\n */\n div,\n} as const;\n\nexpectType<\n keyof typeof SafeUint,\n keyof TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int' | 'non-negative' | 'range'\n >\n>('=');\n\nexpectType<\n typeof SafeUint,\n TsDataForgeInternals.RefinedNumberUtils.NumberClass<\n ElementType,\n 'int' | 'non-negative' | 'range'\n >\n>('<=');\n"],"names":[],"mappings":";;AAQA,MAAM,iBAAA,GAAoB,6BAAA;AAE1B,MAAM;AAAA,EACJ,SAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA,EAAK,IAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,GAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,GAAI,oBAAA,CAAqB,mBAAmB,mBAAA,CAI1C;AAAA,EACA,oBAAA,EAAsB,aAAA;AAAA,EACtB,SAAA,EAAW,CAAA;AAAA;AAAA,EAEX,WAAW,MAAA,CAAO,gBAAA;AAAA,EAClB;AACF,CAAU,CAAA;AAWH,MAAM,UAAA,GAAa;AAYnB,MAAM,UAAA,GAAa;AAQnB,MAAM,QAAA,GAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQtB,EAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQL,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASL,KAAA;AAAA;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