ts-data-forge 10.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.
- package/dist/array/impl/array-utils-creation.d.mts +3 -3
- package/dist/array/impl/array-utils-creation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-creation.mjs.map +1 -1
- package/dist/array/impl/array-utils-element-access.d.mts +4 -4
- package/dist/array/impl/array-utils-element-access.mjs.map +1 -1
- package/dist/{guard/as-length-bounded-array.d.mts → array/impl/array-utils-length-bounded-array-cast.d.mts} +9 -9
- package/dist/array/impl/array-utils-length-bounded-array-cast.d.mts.map +1 -0
- package/dist/{guard/as-length-bounded-array.mjs → array/impl/array-utils-length-bounded-array-cast.mjs} +2 -2
- package/dist/array/impl/array-utils-length-bounded-array-cast.mjs.map +1 -0
- package/dist/{guard/is-length-bounded-array.d.mts → array/impl/array-utils-length-bounded-array-guard.d.mts} +13 -13
- package/dist/array/impl/array-utils-length-bounded-array-guard.d.mts.map +1 -0
- package/dist/{guard/is-length-bounded-array.mjs → array/impl/array-utils-length-bounded-array-guard.mjs} +1 -1
- package/dist/array/impl/array-utils-length-bounded-array-guard.mjs.map +1 -0
- package/dist/array/impl/array-utils-modification.d.mts +9 -9
- package/dist/array/impl/array-utils-modification.d.mts.map +1 -1
- package/dist/array/impl/array-utils-modification.mjs.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.d.mts +9 -9
- package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
- package/dist/array/impl/array-utils-size.d.mts +3 -3
- package/dist/array/impl/array-utils-size.mjs.map +1 -1
- package/dist/array/impl/array-utils-slicing.d.mts +9 -9
- package/dist/array/impl/array-utils-slicing.d.mts.map +1 -1
- package/dist/array/impl/array-utils-slicing.mjs.map +1 -1
- package/dist/array/impl/array-utils-transformation.d.mts +16 -10
- package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
- package/dist/array/impl/index.d.mts +2 -0
- package/dist/array/impl/index.d.mts.map +1 -1
- package/dist/array/impl/index.mjs +2 -0
- package/dist/array/impl/index.mjs.map +1 -1
- package/dist/entry-point.mjs +1 -3
- package/dist/entry-point.mjs.map +1 -1
- package/dist/guard/index.d.mts +0 -3
- package/dist/guard/index.d.mts.map +1 -1
- package/dist/guard/index.mjs +0 -3
- package/dist/guard/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -3
- package/dist/index.mjs.map +1 -1
- package/dist/number/branded-types/finite-number.d.mts +47 -61
- package/dist/number/branded-types/finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/finite-number.mjs +37 -41
- package/dist/number/branded-types/finite-number.mjs.map +1 -1
- package/dist/number/branded-types/int.d.mts +40 -46
- package/dist/number/branded-types/int.d.mts.map +1 -1
- package/dist/number/branded-types/int.mjs +29 -31
- package/dist/number/branded-types/int.mjs.map +1 -1
- package/dist/number/branded-types/int16.d.mts +65 -58
- package/dist/number/branded-types/int16.d.mts.map +1 -1
- package/dist/number/branded-types/int16.mjs +49 -45
- package/dist/number/branded-types/int16.mjs.map +1 -1
- package/dist/number/branded-types/int32.d.mts +65 -58
- package/dist/number/branded-types/int32.d.mts.map +1 -1
- package/dist/number/branded-types/int32.mjs +49 -45
- package/dist/number/branded-types/int32.mjs.map +1 -1
- package/dist/number/branded-types/negative-finite-number.d.mts +68 -59
- package/dist/number/branded-types/negative-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/negative-finite-number.mjs +52 -46
- package/dist/number/branded-types/negative-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/negative-int.d.mts +60 -48
- package/dist/number/branded-types/negative-int.d.mts.map +1 -1
- package/dist/number/branded-types/negative-int.mjs +40 -36
- package/dist/number/branded-types/negative-int.mjs.map +1 -1
- package/dist/number/branded-types/negative-safe-int.d.mts +57 -56
- package/dist/number/branded-types/negative-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/negative-safe-int.mjs +40 -41
- package/dist/number/branded-types/negative-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.d.mts +74 -64
- package/dist/number/branded-types/non-negative-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-finite-number.mjs +58 -51
- package/dist/number/branded-types/non-negative-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int16.d.mts +64 -57
- package/dist/number/branded-types/non-negative-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int16.mjs +47 -43
- package/dist/number/branded-types/non-negative-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-negative-int32.d.mts +64 -58
- package/dist/number/branded-types/non-negative-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-negative-int32.mjs +47 -44
- package/dist/number/branded-types/non-negative-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-positive-finite-number.d.mts +64 -54
- package/dist/number/branded-types/non-positive-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-positive-finite-number.mjs +48 -41
- package/dist/number/branded-types/non-positive-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-positive-int.d.mts +41 -146
- package/dist/number/branded-types/non-positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-positive-int.mjs +27 -107
- package/dist/number/branded-types/non-positive-int.mjs.map +1 -1
- package/dist/number/branded-types/non-positive-safe-int.d.mts +54 -53
- package/dist/number/branded-types/non-positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-positive-safe-int.mjs +37 -39
- package/dist/number/branded-types/non-positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.d.mts +62 -49
- package/dist/number/branded-types/non-zero-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-finite-number.mjs +46 -37
- package/dist/number/branded-types/non-zero-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int.d.mts +51 -38
- package/dist/number/branded-types/non-zero-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int.mjs +31 -27
- package/dist/number/branded-types/non-zero-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int16.d.mts +52 -53
- package/dist/number/branded-types/non-zero-int16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int16.mjs +36 -39
- package/dist/number/branded-types/non-zero-int16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-int32.d.mts +52 -54
- package/dist/number/branded-types/non-zero-int32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-int32.mjs +36 -40
- package/dist/number/branded-types/non-zero-int32.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.d.mts +53 -54
- package/dist/number/branded-types/non-zero-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-safe-int.mjs +36 -40
- package/dist/number/branded-types/non-zero-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.d.mts +52 -53
- package/dist/number/branded-types/non-zero-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint16.mjs +35 -39
- package/dist/number/branded-types/non-zero-uint16.mjs.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.d.mts +52 -53
- package/dist/number/branded-types/non-zero-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/non-zero-uint32.mjs +35 -39
- package/dist/number/branded-types/non-zero-uint32.mjs.map +1 -1
- package/dist/number/branded-types/positive-finite-number.d.mts +74 -63
- package/dist/number/branded-types/positive-finite-number.d.mts.map +1 -1
- package/dist/number/branded-types/positive-finite-number.mjs +58 -50
- package/dist/number/branded-types/positive-finite-number.mjs.map +1 -1
- package/dist/number/branded-types/positive-int.d.mts +46 -68
- package/dist/number/branded-types/positive-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int.mjs +34 -49
- package/dist/number/branded-types/positive-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-int16.d.mts +61 -57
- package/dist/number/branded-types/positive-int16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int16.mjs +44 -43
- package/dist/number/branded-types/positive-int16.mjs.map +1 -1
- package/dist/number/branded-types/positive-int32.d.mts +61 -57
- package/dist/number/branded-types/positive-int32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-int32.mjs +44 -43
- package/dist/number/branded-types/positive-int32.mjs.map +1 -1
- package/dist/number/branded-types/positive-safe-int.d.mts +62 -57
- package/dist/number/branded-types/positive-safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/positive-safe-int.mjs +45 -43
- package/dist/number/branded-types/positive-safe-int.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint16.d.mts +61 -57
- package/dist/number/branded-types/positive-uint16.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint16.mjs +44 -43
- package/dist/number/branded-types/positive-uint16.mjs.map +1 -1
- package/dist/number/branded-types/positive-uint32.d.mts +61 -58
- package/dist/number/branded-types/positive-uint32.d.mts.map +1 -1
- package/dist/number/branded-types/positive-uint32.mjs +44 -44
- package/dist/number/branded-types/positive-uint32.mjs.map +1 -1
- package/dist/number/branded-types/safe-int.d.mts +43 -62
- package/dist/number/branded-types/safe-int.d.mts.map +1 -1
- package/dist/number/branded-types/safe-int.mjs +35 -42
- package/dist/number/branded-types/safe-int.mjs.map +1 -1
- package/dist/number/branded-types/safe-uint.d.mts +62 -57
- package/dist/number/branded-types/safe-uint.d.mts.map +1 -1
- package/dist/number/branded-types/safe-uint.mjs +46 -44
- package/dist/number/branded-types/safe-uint.mjs.map +1 -1
- package/dist/number/branded-types/uint.d.mts +63 -50
- package/dist/number/branded-types/uint.d.mts.map +1 -1
- package/dist/number/branded-types/uint.mjs +42 -39
- package/dist/number/branded-types/uint.mjs.map +1 -1
- package/dist/number/branded-types/uint16.d.mts +60 -58
- package/dist/number/branded-types/uint16.d.mts.map +1 -1
- package/dist/number/branded-types/uint16.mjs +44 -43
- package/dist/number/branded-types/uint16.mjs.map +1 -1
- package/dist/number/branded-types/uint32.d.mts +59 -55
- package/dist/number/branded-types/uint32.d.mts.map +1 -1
- package/dist/number/branded-types/uint32.mjs +42 -42
- package/dist/number/branded-types/uint32.mjs.map +1 -1
- package/dist/number/enum/int8.d.mts +56 -65
- package/dist/number/enum/int8.d.mts.map +1 -1
- package/dist/number/enum/int8.mjs +44 -43
- package/dist/number/enum/int8.mjs.map +1 -1
- package/dist/number/enum/uint8.d.mts +60 -58
- package/dist/number/enum/uint8.d.mts.map +1 -1
- package/dist/number/enum/uint8.mjs +44 -43
- package/dist/number/enum/uint8.mjs.map +1 -1
- package/dist/string/index.d.mts +2 -0
- package/dist/string/index.d.mts.map +1 -0
- package/dist/string/index.mjs +2 -0
- package/dist/string/index.mjs.map +1 -0
- package/dist/string/str.d.mts +273 -0
- package/dist/string/str.d.mts.map +1 -0
- package/dist/string/str.mjs +42 -0
- package/dist/string/str.mjs.map +1 -0
- package/package.json +31 -92
- package/src/array/impl/array-utils-creation.mts +2 -1
- package/src/array/impl/array-utils-element-access.mts +3 -3
- package/src/array/impl/array-utils-element-access.test.mts +3 -3
- package/src/{guard/as-length-bounded-array.mts → array/impl/array-utils-length-bounded-array-cast.mts} +9 -9
- package/src/{guard/as-length-bounded-array.test.mts → array/impl/array-utils-length-bounded-array-cast.test.mts} +2 -2
- package/src/{guard/is-length-bounded-array.mts → array/impl/array-utils-length-bounded-array-guard.mts} +12 -12
- package/src/{guard/is-length-bounded-array.test.mts → array/impl/array-utils-length-bounded-array-guard.test.mts} +2 -2
- package/src/array/impl/array-utils-modification.mts +9 -8
- package/src/array/impl/array-utils-modification.test.mts +6 -1
- package/src/array/impl/array-utils-reducing-value.mts +9 -9
- package/src/array/impl/array-utils-size.mts +2 -2
- package/src/array/impl/array-utils-slicing.mts +24 -13
- package/src/array/impl/array-utils-transformation.mts +18 -12
- package/src/array/impl/array-utils-transformation.test.mts +12 -12
- package/src/array/impl/index.mts +2 -0
- package/src/guard/index.mts +0 -3
- package/src/index.mts +1 -0
- package/src/number/branded-types/finite-number.mts +47 -61
- package/src/number/branded-types/int.mts +40 -46
- package/src/number/branded-types/int16.mts +65 -58
- package/src/number/branded-types/int32.mts +65 -58
- package/src/number/branded-types/negative-finite-number.mts +68 -68
- package/src/number/branded-types/negative-int.mts +60 -57
- package/src/number/branded-types/negative-safe-int.mts +57 -65
- package/src/number/branded-types/non-negative-finite-number.mts +74 -64
- package/src/number/branded-types/non-negative-int16.mts +64 -57
- package/src/number/branded-types/non-negative-int32.mts +64 -58
- package/src/number/branded-types/non-positive-finite-number.mts +64 -54
- package/src/number/branded-types/non-positive-int.mts +41 -146
- package/src/number/branded-types/non-positive-safe-int.mts +54 -53
- package/src/number/branded-types/non-zero-finite-number.mts +62 -51
- package/src/number/branded-types/non-zero-int.mts +51 -38
- package/src/number/branded-types/non-zero-int16.mts +52 -53
- package/src/number/branded-types/non-zero-int32.mts +52 -54
- package/src/number/branded-types/non-zero-safe-int.mts +53 -54
- package/src/number/branded-types/non-zero-uint16.mts +52 -53
- package/src/number/branded-types/non-zero-uint32.mts +52 -53
- package/src/number/branded-types/positive-finite-number.mts +74 -63
- package/src/number/branded-types/positive-int.mts +46 -68
- package/src/number/branded-types/positive-int16.mts +61 -57
- package/src/number/branded-types/positive-int32.mts +61 -57
- package/src/number/branded-types/positive-safe-int.mts +62 -57
- package/src/number/branded-types/positive-uint16.mts +61 -57
- package/src/number/branded-types/positive-uint32.mts +61 -58
- package/src/number/branded-types/safe-int.mts +43 -62
- package/src/number/branded-types/safe-uint.mts +62 -57
- package/src/number/branded-types/uint.mts +63 -50
- package/src/number/branded-types/uint16.mts +60 -58
- package/src/number/branded-types/uint32.mts +59 -55
- package/src/number/enum/int8.mts +56 -65
- package/src/number/enum/uint8.mts +60 -58
- package/src/string/index.mts +1 -0
- package/src/string/str.mts +371 -0
- package/src/string/str.test.mts +215 -0
- package/dist/guard/as-length-bounded-array.d.mts.map +0 -1
- package/dist/guard/as-length-bounded-array.mjs.map +0 -1
- package/dist/guard/is-length-bounded-array.d.mts.map +0 -1
- package/dist/guard/is-length-bounded-array.mjs.map +0 -1
- package/dist/guard/is-length-bounded-string.d.mts +0 -163
- package/dist/guard/is-length-bounded-string.d.mts.map +0 -1
- package/dist/guard/is-length-bounded-string.mjs +0 -7
- package/dist/guard/is-length-bounded-string.mjs.map +0 -1
- package/src/guard/is-length-bounded-string.mts +0 -199
- package/src/guard/is-length-bounded-string.test.mts +0 -170
|
@@ -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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBL,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyBL,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBA,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;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,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;AAoBH,MAAM,SAAA,GAAY;AAsBlB,MAAM,SAAA,GAAY;AAQlB,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,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBL,GAAA,EAAK,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyBL,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyBA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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
|
-
*
|
|
4
|
+
* Type guard that checks if a value is a non-negative safe integer.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
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
|
|
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
|
|
32
|
-
* integers.
|
|
37
|
+
* Namespace providing type-safe operations for the `SafeUint` branded type.
|
|
33
38
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
50
|
-
*
|
|
51
|
-
* @readonly
|
|
52
|
+
* The smallest value representable as `SafeUint`.
|
|
52
53
|
*/
|
|
53
54
|
readonly MIN_VALUE: 0;
|
|
54
55
|
/**
|
|
55
|
-
* The
|
|
56
|
-
*
|
|
57
|
-
* @readonly
|
|
56
|
+
* The largest value representable as `SafeUint`.
|
|
58
57
|
*/
|
|
59
58
|
readonly MAX_VALUE: TtfImported_SafeUint;
|
|
60
59
|
/**
|
|
61
|
-
* Returns the
|
|
60
|
+
* Returns the smallest of the given non-negative safe integers.
|
|
62
61
|
*
|
|
63
|
-
* @param
|
|
64
|
-
* @
|
|
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
|
|
67
|
+
* Returns the largest of the given non-negative safe integers.
|
|
70
68
|
*
|
|
71
|
-
* @param
|
|
72
|
-
* @
|
|
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
|
|
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
|
|
80
|
-
* @returns The
|
|
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
|
|
82
|
+
* Generates a random `SafeUint` within the given range.
|
|
83
|
+
*
|
|
84
|
+
* The range is inclusive on both ends.
|
|
85
85
|
*
|
|
86
|
-
* @
|
|
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
|
|
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
|
|
93
|
-
* @param b The exponent
|
|
94
|
-
* @returns `a ** b`
|
|
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
|
|
101
|
+
* Adds two non-negative safe integers, returning `a + b` as a `SafeUint`.
|
|
99
102
|
*
|
|
100
|
-
* @param a The first
|
|
101
|
-
* @param b The second
|
|
102
|
-
* @returns `a
|
|
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
|
|
109
|
+
* Subtracts two non-negative safe integers, returning `a - b` as a
|
|
110
|
+
* `SafeUint`.
|
|
107
111
|
*
|
|
108
|
-
* @param a The
|
|
109
|
-
* @param b The
|
|
110
|
-
* @returns `a
|
|
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
|
|
118
|
+
* Multiplies two non-negative safe integers, returning `a * b` as a
|
|
119
|
+
* `SafeUint`.
|
|
116
120
|
*
|
|
117
|
-
* @param a The first
|
|
118
|
-
* @param b The second
|
|
119
|
-
* @returns `a
|
|
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
|
|
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
|
|
126
|
-
* @param b The divisor
|
|
127
|
-
* @returns
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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
|
|
38
|
-
*
|
|
39
|
-
* @readonly
|
|
37
|
+
* The smallest value representable as `SafeUint`.
|
|
40
38
|
*/
|
|
41
39
|
MIN_VALUE,
|
|
42
40
|
/**
|
|
43
|
-
* The
|
|
44
|
-
*
|
|
45
|
-
* @readonly
|
|
41
|
+
* The largest value representable as `SafeUint`.
|
|
46
42
|
*/
|
|
47
43
|
MAX_VALUE,
|
|
48
44
|
/**
|
|
49
|
-
* Returns the
|
|
45
|
+
* Returns the smallest of the given non-negative safe integers.
|
|
50
46
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @
|
|
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
|
|
52
|
+
* Returns the largest of the given non-negative safe integers.
|
|
58
53
|
*
|
|
59
|
-
* @param
|
|
60
|
-
* @
|
|
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
|
|
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
|
|
68
|
-
* @returns The
|
|
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
|
|
67
|
+
* Generates a random `SafeUint` within the given range.
|
|
68
|
+
*
|
|
69
|
+
* The range is inclusive on both ends.
|
|
73
70
|
*
|
|
74
|
-
* @
|
|
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
|
|
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
|
|
81
|
-
* @param b The exponent
|
|
82
|
-
* @returns `a ** b`
|
|
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
|
|
86
|
+
* Adds two non-negative safe integers, returning `a + b` as a `SafeUint`.
|
|
87
87
|
*
|
|
88
|
-
* @param a The first
|
|
89
|
-
* @param b The second
|
|
90
|
-
* @returns `a
|
|
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
|
|
94
|
+
* Subtracts two non-negative safe integers, returning `a - b` as a
|
|
95
|
+
* `SafeUint`.
|
|
95
96
|
*
|
|
96
|
-
* @param a The
|
|
97
|
-
* @param b The
|
|
98
|
-
* @returns `a
|
|
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
|
|
103
|
+
* Multiplies two non-negative safe integers, returning `a * b` as a
|
|
104
|
+
* `SafeUint`.
|
|
104
105
|
*
|
|
105
|
-
* @param a The first
|
|
106
|
-
* @param b The second
|
|
107
|
-
* @returns `a
|
|
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
|
|
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
|
|
114
|
-
* @param b The divisor
|
|
115
|
-
* @returns
|
|
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 *
|
|
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;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,EASA,GAAA;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;;;;"}
|