From 2ba258d8e2c5098cd70ab13870ff6d37de9fb5b1 Mon Sep 17 00:00:00 2001 From: Hans Oksendahl Date: Thu, 30 May 2024 23:23:02 -0700 Subject: [PATCH] introduced ts-calc types --- bun.lockb | Bin 0 -> 89463 bytes src/any/antecedent/is-array.spec.ts | 2 +- src/any/antecedent/is-falsy.spec.ts | 2 +- src/any/antecedent/is-key.spec.ts | 2 +- src/any/antecedent/is-never.spec.ts | 2 +- src/any/antecedent/is-nullish.spec.ts | 2 +- src/any/antecedent/is-primitive.spec.ts | 2 +- src/any/antecedent/is-truthy.spec.ts | 2 +- .../antecedent/primitives/is-bigint.spec.ts | 2 +- .../antecedent/primitives/is-boolean.spec.ts | 2 +- src/any/antecedent/primitives/is-null.spec.ts | 2 +- .../antecedent/primitives/is-number.spec.ts | 2 +- .../antecedent/primitives/is-string.spec.ts | 2 +- .../antecedent/primitives/is-symbol.spec.ts | 2 +- .../primitives/is-undefined.spec.ts | 2 +- src/any/any-alphabetic.spec.ts | 2 +- src/any/any-array.spec.ts | 2 +- src/any/any-decimal-digit.spec.ts | 2 +- src/any/any-falsy.spec.ts | 2 +- src/any/any-function.spec.ts | 2 +- src/any/any-key.spec.ts | 2 +- src/any/any-map.spec.ts | 2 +- src/any/any-nullish.spec.ts | 2 +- src/any/any-object.spec.ts | 2 +- src/any/any-object.ts | 7 +- src/any/any-primitive.spec.ts | 2 +- src/any/any-set.spec.ts | 2 +- src/any/any-stringish.spec.ts | 2 +- src/any/any-weak-map.spec.ts | 2 +- src/any/any-weak-set.spec.ts | 5 +- src/any/to-string.spec.ts | 2 +- src/any/to-string.ts | 4 +- src/extension/antecedent/is-equal.spec.ts | 2 +- src/extension/antecedent/is-equal.ts | 2 +- src/extension/antecedent/is-extension.spec.ts | 2 +- .../antecedent/is-constructor.spec.ts | 2 +- src/function/antecedent/is-function.spec.ts | 2 +- src/function/arity/arity-0.spec.ts | 2 +- src/function/arity/arity-1.spec.ts | 2 +- src/function/arity/arity-2.spec.ts | 2 +- src/function/arity/arity-3.spec.ts | 2 +- src/function/arity/arity-4.spec.ts | 2 +- src/function/arity/arity-5.spec.ts | 2 +- src/function/arity/arity-6.spec.ts | 2 +- src/function/arity/arity-7.spec.ts | 2 +- src/function/arity/arity-8.spec.ts | 2 +- src/function/constructor-return-type.spec.ts | 2 +- src/function/constructor.spec.ts | 2 +- src/function/factory.spec.ts | 2 +- src/function/part-app/part-app-0.spec.ts | 2 +- src/function/part-app/part-app-1.spec.ts | 2 +- src/function/part-app/part-app-2.spec.ts | 2 +- src/function/part-app/part-app-3.spec.ts | 2 +- src/function/part-app/part-app-4.spec.ts | 2 +- src/function/part-app/part-app-5.spec.ts | 2 +- src/function/part-app/part-app-6.spec.ts | 2 +- src/function/part-app/part-app-7.spec.ts | 2 +- src/function/part-app/part-app-8.spec.ts | 2 +- src/generator/antecedent/is-generator.spec.ts | 2 +- src/generator/generator-next-type.spec.ts | 2 +- src/generator/generator-return-type.spec.ts | 2 +- src/generator/generator-yield-type.spec.ts | 2 +- src/helper/capture-group.ts | 2 +- src/helper/expect.ts | 6 ++ src/helper/index.ts | 2 - src/helper/inner-wrap-map.ts | 2 +- src/helper/last-unique-in-union.ts | 14 +-- src/helper/multi-add.ts | 24 ----- src/helper/multi-sub.ts | 23 ----- src/helper/outer-wrap-map.ts | 2 +- src/helper/test.ts | 6 -- src/helper/to-natural-number.spec.ts | 15 --- src/helper/to-natural-number.ts | 93 ----------------- src/helper/to-string-interface.ts | 2 +- src/helper/union-unique-length.ts | 10 +- .../is-array-concat-identity.spec.ts | 2 +- .../antecedent/is-bigint-add-identity.spec.ts | 2 +- .../is-bigint-mult-identity.spec.ts | 2 +- .../antecedent/is-num-add-identity.spec.ts | 2 +- .../antecedent/is-num-add-identity.ts | 8 -- .../antecedent/is-num-mult-identity.spec.ts | 2 +- .../is-object-assign-identity.spec.ts | 2 +- .../is-string-concat-identity.spec.ts | 2 +- src/identity/array-concat-identity.spec.ts | 2 +- src/identity/bigint-add-identity.spec.ts | 2 +- src/identity/bigint-mult-identity.spec.ts | 2 +- src/identity/num-add-identity.spec.ts | 2 +- src/identity/num-mult-identity.spec.ts | 2 +- src/identity/object-assign-identity.spec.ts | 2 +- src/identity/string-concat-identity.spec.ts | 2 +- .../antecedent/is-literal-bigint.spec.ts | 2 +- .../antecedent/is-literal-boolean.spec.ts | 2 +- src/literal/antecedent/is-literal-key.spec.ts | 2 +- .../antecedent/is-literal-null.spec.ts | 2 +- .../antecedent/is-literal-number.spec.ts | 2 +- .../antecedent/is-literal-primitive.spec.ts | 2 +- .../antecedent/is-literal-string.spec.ts | 2 +- .../antecedent/is-literal-symbol.spec.ts | 2 +- .../antecedent/is-literal-undefined.spec.ts | 2 +- .../antecedent/is-literal-void.spec.ts | 2 +- src/logic/antecedent/and.spec.ts | 2 +- src/logic/antecedent/is-false.spec.ts | 2 +- src/logic/antecedent/is-true.spec.ts | 2 +- src/logic/antecedent/not.spec.ts | 2 +- src/logic/antecedent/or.spec.ts | 2 +- src/logic/antecedent/xor.spec.ts | 2 +- src/logic/if.spec.ts | 2 +- src/math/absolute.spec.ts | 20 ++-- src/math/absolute.ts | 35 +++---- src/math/add.spec.ts | 34 ++++-- src/math/add.ts | 53 ++++++---- src/math/antecedent/index.ts | 5 +- src/math/antecedent/is-divisible.spec.ts | 21 ---- src/math/antecedent/is-divisible.ts | 21 ---- src/math/antecedent/is-float.spec.ts | 27 ----- src/math/antecedent/is-float.ts | 20 ---- .../is-greater-than-or-equal.spec.ts | 48 ++++++--- .../antecedent/is-greater-than-or-equal.ts | 24 ++--- src/math/antecedent/is-greater-than.spec.ts | 42 ++++++-- src/math/antecedent/is-greater-than.ts | 20 ++-- src/math/antecedent/is-integer.spec.ts | 37 ------- src/math/antecedent/is-integer.ts | 15 --- .../antecedent/is-less-than-or-equal.spec.ts | 42 ++++++-- src/math/antecedent/is-less-than-or-equal.ts | 24 ++--- src/math/antecedent/is-less-than.spec.ts | 42 ++++++-- src/math/antecedent/is-less-than.ts | 27 ++--- src/math/antecedent/is-natural.spec.ts | 45 -------- src/math/antecedent/is-natural.ts | 18 ---- src/math/antecedent/is-negative.spec.ts | 28 +++-- src/math/antecedent/is-negative.ts | 16 +-- src/math/antecedent/is-non-negative.spec.ts | 28 +++-- src/math/antecedent/is-non-negative.ts | 17 +-- src/math/antecedent/is-non-positive.spec.ts | 28 +++-- src/math/antecedent/is-non-positive.ts | 19 +--- src/math/antecedent/is-positive.spec.ts | 28 +++-- src/math/antecedent/is-positive.ts | 24 ++--- src/math/antecedent/is-zero.spec.ts | 29 ++++++ src/math/antecedent/is-zero.ts | 13 +++ src/math/compare.ts | 71 +++++++++++++ src/math/decrement.spec.ts | 10 +- src/math/decrement.ts | 24 +---- src/math/digits/addition-digits.ts | 97 ++++++++++++++++++ src/math/digits/division-digits.ts | 75 ++++++++++++++ src/math/digits/multiply-digits.ts | 41 ++++++++ src/math/digits/power-digits.ts | 22 ++++ src/math/digits/substraction-digits.ts | 97 ++++++++++++++++++ src/math/divide.spec.ts | 18 ++-- src/math/divide.ts | 49 +++++---- src/math/increment.spec.ts | 6 +- src/math/increment.ts | 16 ++- src/math/index.ts | 6 +- src/math/max.spec.ts | 13 --- src/math/max.ts | 15 --- src/math/min.spec.ts | 13 --- src/math/min.ts | 15 --- src/math/mod.spec.ts | 13 +++ src/math/mod.ts | 34 ++++++ src/math/modulo.spec.ts | 15 --- src/math/modulo.ts | 22 ---- src/math/multiply.spec.ts | 13 --- src/math/multiply.ts | 51 +++++---- src/math/negate.spec.ts | 29 ++++++ src/math/negate.ts | 23 +++++ src/math/power.spec.ts | 0 src/math/power.ts | 41 ++++++++ src/math/subtract.spec.ts | 16 +-- src/math/subtract.ts | 51 +++++---- src/math/utils.ts | 63 ++++++++++++ src/object/antecedent/is-key-of.spec.ts | 2 +- src/object/antecedent/is-object.spec.ts | 2 +- src/object/get-path-value.spec.ts | 2 +- src/object/get-paths.spec.ts | 2 +- src/object/length-prop.spec.ts | 2 +- src/object/object-length.spec.ts | 2 +- src/object/object-length.ts | 4 +- src/object/override.spec.ts | 2 +- src/peg/one-or-more.ts | 2 +- src/string/antecedent/ends-with.spec.ts | 2 +- .../antecedent/has-capture-group.spec.ts | 2 +- src/string/antecedent/has-capture-group.ts | 4 +- src/string/antecedent/includes.spec.ts | 2 +- src/string/antecedent/is-alphabetic.spec.ts | 2 +- src/string/antecedent/is-camel-case.spec.ts | 2 +- src/string/antecedent/is-capitalized.spec.ts | 2 +- src/string/antecedent/is-kebab-case.spec.ts | 2 +- src/string/antecedent/is-lower-case.spec.ts | 2 +- src/string/antecedent/is-numeric.spec.ts | 2 +- src/string/antecedent/is-snake-case.spec.ts | 2 +- src/string/antecedent/is-upper-case.spec.ts | 2 +- src/string/antecedent/starts-with.spec.ts | 2 +- src/string/capture.spec.ts | 2 +- src/string/capture.ts | 4 +- src/string/consume-left.spec.ts | 2 +- src/string/consume-right.spec.ts | 2 +- src/string/index.ts | 2 - src/string/interpolation.spec.ts | 2 +- src/string/interpolation.ts | 4 +- src/string/lower-case.spec.ts | 2 +- src/string/split.spec.ts | 2 +- src/string/string-length.spec.ts | 17 --- src/string/string-length.ts | 27 ----- src/string/upper-case.spec.ts | 2 +- src/tuple/antecedent/is-element-of.spec.ts | 2 +- src/tuple/antecedent/is-index-of.spec.ts | 2 +- src/tuple/antecedent/is-tuple.spec.ts | 2 +- src/tuple/antecedent/is-tuple.ts | 15 +-- src/tuple/append.spec.ts | 2 +- src/tuple/concat.spec.ts | 2 +- src/tuple/element-of.spec.ts | 2 +- src/tuple/first.spec.ts | 2 +- src/tuple/indices.spec.ts | 2 +- src/tuple/join.spec.ts | 2 +- src/tuple/join.ts | 4 +- src/tuple/last.spec.ts | 2 +- src/tuple/prepend.spec.ts | 2 +- src/tuple/rest.spec.ts | 2 +- src/tuple/reverse.spec.ts | 2 +- src/tuple/slice.spec.ts | 7 +- src/tuple/slice.ts | 10 +- src/tuple/tuple.spec.ts | 2 +- 220 files changed, 1335 insertions(+), 1057 deletions(-) create mode 100755 bun.lockb create mode 100644 src/helper/expect.ts delete mode 100644 src/helper/multi-add.ts delete mode 100644 src/helper/multi-sub.ts delete mode 100644 src/helper/test.ts delete mode 100644 src/helper/to-natural-number.spec.ts delete mode 100644 src/helper/to-natural-number.ts delete mode 100644 src/math/antecedent/is-divisible.spec.ts delete mode 100644 src/math/antecedent/is-divisible.ts delete mode 100644 src/math/antecedent/is-float.spec.ts delete mode 100644 src/math/antecedent/is-float.ts delete mode 100644 src/math/antecedent/is-integer.spec.ts delete mode 100644 src/math/antecedent/is-integer.ts delete mode 100644 src/math/antecedent/is-natural.spec.ts delete mode 100644 src/math/antecedent/is-natural.ts create mode 100644 src/math/antecedent/is-zero.spec.ts create mode 100644 src/math/antecedent/is-zero.ts create mode 100644 src/math/compare.ts create mode 100644 src/math/digits/addition-digits.ts create mode 100644 src/math/digits/division-digits.ts create mode 100644 src/math/digits/multiply-digits.ts create mode 100644 src/math/digits/power-digits.ts create mode 100644 src/math/digits/substraction-digits.ts delete mode 100644 src/math/max.spec.ts delete mode 100644 src/math/max.ts delete mode 100644 src/math/min.spec.ts delete mode 100644 src/math/min.ts create mode 100644 src/math/mod.spec.ts create mode 100644 src/math/mod.ts delete mode 100644 src/math/modulo.spec.ts delete mode 100644 src/math/modulo.ts create mode 100644 src/math/negate.spec.ts create mode 100644 src/math/negate.ts create mode 100644 src/math/power.spec.ts create mode 100644 src/math/power.ts create mode 100644 src/math/utils.ts delete mode 100644 src/string/string-length.spec.ts delete mode 100644 src/string/string-length.ts diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..9add8fbea32b984ba3146be2cc19d4e2c39a4fe4 GIT binary patch literal 89463 zcmeEvcRbc@`~PKRCL<#xE3%bQ*)xQMkP))?9z|v$D+xuEP-G{RmCzt$R7PYb*|Rb# z`JQL4&+~kK&+B>aF8A~2?>SztkK;PW`+Xeean9@fT-`S(yReU!r?91itFVo$FPo*0 zD;anMo!zXQY#p3!1Z~|sT`ar>eGii1V=x%ik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kzbF5Z ziP?7sAb|Zc4a|-Ip=?h{14lOh_#EFifNcC1VHO|UVN)*Fjf{?GTp~MUg)iiq^>Xg> z4Uo@WKzZ|%G~I_Cz@@uHMa)M7W2!-hv1Ej1^LpfN1W3)D$c%2T*BD!WKq^~@Ksob1 zmP0^}(nuR2Y{7ab25G}KaX>Mq&P!J3i#{DL?LZ|{U~`)RP6u& literal 0 HcmV?d00001 diff --git a/src/any/antecedent/is-array.spec.ts b/src/any/antecedent/is-array.spec.ts index 6faf394b..8cb07001 100644 --- a/src/any/antecedent/is-array.spec.ts +++ b/src/any/antecedent/is-array.spec.ts @@ -1,6 +1,6 @@ import type { IsArray } from '~/any/antecedent/is-array' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsArray', () => { it('should return true if A extends any[]', () => { diff --git a/src/any/antecedent/is-falsy.spec.ts b/src/any/antecedent/is-falsy.spec.ts index 76686054..d0a83592 100644 --- a/src/any/antecedent/is-falsy.spec.ts +++ b/src/any/antecedent/is-falsy.spec.ts @@ -1,6 +1,6 @@ import type { IsFalsy } from '~/any/antecedent/is-falsy' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsFalsy', () => { it('should return true if A extends falsy', () => { diff --git a/src/any/antecedent/is-key.spec.ts b/src/any/antecedent/is-key.spec.ts index cf5fb9b7..edd16e96 100644 --- a/src/any/antecedent/is-key.spec.ts +++ b/src/any/antecedent/is-key.spec.ts @@ -1,6 +1,6 @@ import type { IsKey } from '~/any/antecedent/is-key' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsKey', () => { it('should return true if A extends string | number', () => { diff --git a/src/any/antecedent/is-never.spec.ts b/src/any/antecedent/is-never.spec.ts index 1d68eb23..59f1bf0b 100644 --- a/src/any/antecedent/is-never.spec.ts +++ b/src/any/antecedent/is-never.spec.ts @@ -1,6 +1,6 @@ import type { IsNever } from '~/any/antecedent/is-never' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsNever', () => { it('should return true if A extends never', () => { diff --git a/src/any/antecedent/is-nullish.spec.ts b/src/any/antecedent/is-nullish.spec.ts index eeb0b041..b65a978e 100644 --- a/src/any/antecedent/is-nullish.spec.ts +++ b/src/any/antecedent/is-nullish.spec.ts @@ -1,6 +1,6 @@ import type { IsNullish } from '~/any/antecedent/is-nullish' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsNullish', () => { it('should return true if A extends null | undefined', () => { diff --git a/src/any/antecedent/is-primitive.spec.ts b/src/any/antecedent/is-primitive.spec.ts index b906eb16..a290a85a 100644 --- a/src/any/antecedent/is-primitive.spec.ts +++ b/src/any/antecedent/is-primitive.spec.ts @@ -1,6 +1,6 @@ import type { IsPrimitive } from '~/any/antecedent/is-primitive' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsPrimitive', () => { it('should return true if A extends primitive', () => { diff --git a/src/any/antecedent/is-truthy.spec.ts b/src/any/antecedent/is-truthy.spec.ts index fc1b7399..1d46341e 100644 --- a/src/any/antecedent/is-truthy.spec.ts +++ b/src/any/antecedent/is-truthy.spec.ts @@ -1,6 +1,6 @@ import type { IsTruthy } from '~/any/antecedent/is-truthy' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsTruthy', () => { it('should return true if A extends true', () => { diff --git a/src/any/antecedent/primitives/is-bigint.spec.ts b/src/any/antecedent/primitives/is-bigint.spec.ts index 764a5671..50b999b2 100644 --- a/src/any/antecedent/primitives/is-bigint.spec.ts +++ b/src/any/antecedent/primitives/is-bigint.spec.ts @@ -1,6 +1,6 @@ import type { IsBigInt } from '~/any/antecedent/primitives/is-bigint' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsBigInt', () => { it('should return true if A extends bigint', () => { diff --git a/src/any/antecedent/primitives/is-boolean.spec.ts b/src/any/antecedent/primitives/is-boolean.spec.ts index 012b2138..74824db8 100644 --- a/src/any/antecedent/primitives/is-boolean.spec.ts +++ b/src/any/antecedent/primitives/is-boolean.spec.ts @@ -1,6 +1,6 @@ import type { IsBoolean } from '~/any/antecedent/primitives/is-boolean' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsBoolean', () => { it('should return true if A extends boolean', () => { diff --git a/src/any/antecedent/primitives/is-null.spec.ts b/src/any/antecedent/primitives/is-null.spec.ts index da5c28a5..cbcb7eb7 100644 --- a/src/any/antecedent/primitives/is-null.spec.ts +++ b/src/any/antecedent/primitives/is-null.spec.ts @@ -1,6 +1,6 @@ import type { IsNull } from '~/any/antecedent/primitives/is-null' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsNull', () => { it('should return true if A extends null', () => { diff --git a/src/any/antecedent/primitives/is-number.spec.ts b/src/any/antecedent/primitives/is-number.spec.ts index 16942dc0..ba69ab75 100644 --- a/src/any/antecedent/primitives/is-number.spec.ts +++ b/src/any/antecedent/primitives/is-number.spec.ts @@ -1,6 +1,6 @@ import type { IsNumber } from '~/any/antecedent/primitives/is-number' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsNumber', () => { it('should return true if A extends number', () => { diff --git a/src/any/antecedent/primitives/is-string.spec.ts b/src/any/antecedent/primitives/is-string.spec.ts index 5451a563..aef5becd 100644 --- a/src/any/antecedent/primitives/is-string.spec.ts +++ b/src/any/antecedent/primitives/is-string.spec.ts @@ -1,6 +1,6 @@ import type { IsString } from '~/any/antecedent/primitives/is-string' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsString', () => { it('should return true if A extends string', () => { diff --git a/src/any/antecedent/primitives/is-symbol.spec.ts b/src/any/antecedent/primitives/is-symbol.spec.ts index d8a16d8f..270fc8f2 100644 --- a/src/any/antecedent/primitives/is-symbol.spec.ts +++ b/src/any/antecedent/primitives/is-symbol.spec.ts @@ -1,6 +1,6 @@ import type { IsSymbol } from '~/any/antecedent/primitives/is-symbol' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsSymbol', () => { it('should return true if A extends symbol', () => { diff --git a/src/any/antecedent/primitives/is-undefined.spec.ts b/src/any/antecedent/primitives/is-undefined.spec.ts index df6ae5ed..2add78f4 100644 --- a/src/any/antecedent/primitives/is-undefined.spec.ts +++ b/src/any/antecedent/primitives/is-undefined.spec.ts @@ -1,6 +1,6 @@ import type { IsUndefined } from '~/any/antecedent/primitives/is-undefined' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsUndefined', () => { it('should return true if A extends undefined', () => { diff --git a/src/any/any-alphabetic.spec.ts b/src/any/any-alphabetic.spec.ts index 54118aa7..313f6749 100644 --- a/src/any/any-alphabetic.spec.ts +++ b/src/any/any-alphabetic.spec.ts @@ -1,6 +1,6 @@ import type { AnyAlphabetic } from '~/any/any-alphabetic' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyAlphabetic', () => { it('should be an alphabetic character', () => { diff --git a/src/any/any-array.spec.ts b/src/any/any-array.spec.ts index 3e6fc9e1..93fea37f 100644 --- a/src/any/any-array.spec.ts +++ b/src/any/any-array.spec.ts @@ -1,6 +1,6 @@ import type { AnyArray } from '~/any/any-array' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyArray', () => { it('should equal any[]', () => { diff --git a/src/any/any-decimal-digit.spec.ts b/src/any/any-decimal-digit.spec.ts index 3424fbb9..a5d91c9a 100644 --- a/src/any/any-decimal-digit.spec.ts +++ b/src/any/any-decimal-digit.spec.ts @@ -1,6 +1,6 @@ import type { AnyDecimalDigit } from '~/any/any-decimal-digit' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyDecimalDigit', () => { it('should be a decimal digit', () => { diff --git a/src/any/any-falsy.spec.ts b/src/any/any-falsy.spec.ts index 9a627578..e4e87071 100644 --- a/src/any/any-falsy.spec.ts +++ b/src/any/any-falsy.spec.ts @@ -1,6 +1,6 @@ import type { AnyFalsy } from '~/any/any-falsy' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyFalsy', () => { it("should equal '' | 0 | 0n | false | null | undefined", () => { diff --git a/src/any/any-function.spec.ts b/src/any/any-function.spec.ts index 1c3610c7..6317f084 100644 --- a/src/any/any-function.spec.ts +++ b/src/any/any-function.spec.ts @@ -1,6 +1,6 @@ import type { AnyFunction } from '~/any/any-function' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyFunction', () => { it('should equal (...args: any[]) => any', () => { diff --git a/src/any/any-key.spec.ts b/src/any/any-key.spec.ts index 7882b763..aefb885c 100644 --- a/src/any/any-key.spec.ts +++ b/src/any/any-key.spec.ts @@ -1,6 +1,6 @@ import type { AnyKey } from '~/any/any-key' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyKey', () => { it('should equal string | number | symbol', () => { diff --git a/src/any/any-map.spec.ts b/src/any/any-map.spec.ts index 2392bbfe..726cc43c 100644 --- a/src/any/any-map.spec.ts +++ b/src/any/any-map.spec.ts @@ -1,6 +1,6 @@ import type { AnyMap } from '~/any/any-map' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyMap', () => { it('should equal Map', () => { diff --git a/src/any/any-nullish.spec.ts b/src/any/any-nullish.spec.ts index 508606e1..40aa1a3b 100644 --- a/src/any/any-nullish.spec.ts +++ b/src/any/any-nullish.spec.ts @@ -1,6 +1,6 @@ import type { AnyNullish } from '~/any/any-nullish' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyNullish', () => { it('should equal null | undefined', () => { diff --git a/src/any/any-object.spec.ts b/src/any/any-object.spec.ts index 67ab1197..3c58cbcb 100644 --- a/src/any/any-object.spec.ts +++ b/src/any/any-object.spec.ts @@ -1,7 +1,7 @@ import type { AnyKey } from '~/any/any-key' import type { AnyObject } from '~/any/any-object' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyObject', () => { it('should equal Record', () => { diff --git a/src/any/any-object.ts b/src/any/any-object.ts index d593ac22..5808c048 100644 --- a/src/any/any-object.ts +++ b/src/any/any-object.ts @@ -10,6 +10,7 @@ * type Ex2 = AnyObject<'a' | 'b', boolean> // { a: boolean, b: boolean } * ``` */ -export type AnyObject = { - [C in A]: B -} +export type AnyObject = Record< + A, + B +> diff --git a/src/any/any-primitive.spec.ts b/src/any/any-primitive.spec.ts index 7aaaef3e..bae3457c 100644 --- a/src/any/any-primitive.spec.ts +++ b/src/any/any-primitive.spec.ts @@ -1,6 +1,6 @@ import type { AnyPrimitive } from '~/any/any-primitive' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyPrimitive', () => { it('should be a union of all primitive types', () => { diff --git a/src/any/any-set.spec.ts b/src/any/any-set.spec.ts index b5d6469b..a7b029f9 100644 --- a/src/any/any-set.spec.ts +++ b/src/any/any-set.spec.ts @@ -1,6 +1,6 @@ import type { AnySet } from '~/any/any-set' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnySet', () => { it('should be a Set of any type', () => { diff --git a/src/any/any-stringish.spec.ts b/src/any/any-stringish.spec.ts index 479984f7..3c6a00c7 100644 --- a/src/any/any-stringish.spec.ts +++ b/src/any/any-stringish.spec.ts @@ -1,6 +1,6 @@ import type { AnyStringish } from '~/any/any-stringish' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyStringish', () => { it('should be a union of all TypeScript type that can be coercedto a string easily.', () => { diff --git a/src/any/any-weak-map.spec.ts b/src/any/any-weak-map.spec.ts index 7f2284d6..7f05b4c9 100644 --- a/src/any/any-weak-map.spec.ts +++ b/src/any/any-weak-map.spec.ts @@ -1,6 +1,6 @@ import type { AnyWeakMap } from '~/any/any-weak-map' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyWeakMap', () => { it('should be a WeakMap of any type', () => { diff --git a/src/any/any-weak-set.spec.ts b/src/any/any-weak-set.spec.ts index deb998a9..404bc514 100644 --- a/src/any/any-weak-set.spec.ts +++ b/src/any/any-weak-set.spec.ts @@ -1,13 +1,12 @@ -import type { AnyObject } from '~/any/any-object' import type { AnyWeakSet } from '~/any/any-weak-set' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('AnyWeakSet', () => { it('should be a WeakSet of any type', () => { type Ex = AnyWeakSet - type TestEx = Expect>> + type TestEx = Expect>> }) it('should be a WeakSet of type A', () => { diff --git a/src/any/to-string.spec.ts b/src/any/to-string.spec.ts index 77c35584..88ab8e78 100644 --- a/src/any/to-string.spec.ts +++ b/src/any/to-string.spec.ts @@ -1,6 +1,6 @@ import type { ToString } from '~/any/to-string' import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('ToString', () => { it('should convert `A` to a string', () => { diff --git a/src/any/to-string.ts b/src/any/to-string.ts index 65b6dce2..4b8c36b6 100644 --- a/src/any/to-string.ts +++ b/src/any/to-string.ts @@ -1,8 +1,8 @@ import type { AnyStringish } from '~/any/any-stringish' -import type { HelperToStringInterface } from '~/helper/to-string-interface' +import type { ToStringInterface } from '~/helper/to-string-interface' export type ToString = A extends AnyStringish ? `${A}` - : A extends HelperToStringInterface + : A extends ToStringInterface ? ReturnType : never diff --git a/src/extension/antecedent/is-equal.spec.ts b/src/extension/antecedent/is-equal.spec.ts index b61fb5e8..604db01e 100644 --- a/src/extension/antecedent/is-equal.spec.ts +++ b/src/extension/antecedent/is-equal.spec.ts @@ -1,4 +1,4 @@ -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsEqual } from './is-equal' describe('IsEqual', () => { diff --git a/src/extension/antecedent/is-equal.ts b/src/extension/antecedent/is-equal.ts index 457e53af..6d9bf211 100644 --- a/src/extension/antecedent/is-equal.ts +++ b/src/extension/antecedent/is-equal.ts @@ -1,4 +1,4 @@ -import type { IsExtension } from '~/extension/antecedent/is-extension' +import type { IsExtension } from './is-extension' /** * If `A extends B` and `B extends A` then `true` else `false` diff --git a/src/extension/antecedent/is-extension.spec.ts b/src/extension/antecedent/is-extension.spec.ts index 23f2ef3c..56827483 100644 --- a/src/extension/antecedent/is-extension.spec.ts +++ b/src/extension/antecedent/is-extension.spec.ts @@ -1,5 +1,5 @@ import type { IsExtension } from '~/extension/antecedent/is-extension' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsEqual } from './is-equal' describe('IsExtension', () => { diff --git a/src/function/antecedent/is-constructor.spec.ts b/src/function/antecedent/is-constructor.spec.ts index c5574ccc..d6a4851c 100644 --- a/src/function/antecedent/is-constructor.spec.ts +++ b/src/function/antecedent/is-constructor.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { IsConstructor } from '~/function/antecedent/is-constructor' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsConstructor', () => { it('hould return true if the function is a constructor', () => { diff --git a/src/function/antecedent/is-function.spec.ts b/src/function/antecedent/is-function.spec.ts index 0a68c85e..aaaf4a1d 100644 --- a/src/function/antecedent/is-function.spec.ts +++ b/src/function/antecedent/is-function.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { IsFunction } from '~/function/antecedent/is-function' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsFunction', () => { it('should return true if the function is a function', () => { diff --git a/src/function/arity/arity-0.spec.ts b/src/function/arity/arity-0.spec.ts index 9543a7ab..55fca9c1 100644 --- a/src/function/arity/arity-0.spec.ts +++ b/src/function/arity/arity-0.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity0 } from '~/function/arity/arity-0' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity0', () => { it('should be a function with 0 parameters', () => { diff --git a/src/function/arity/arity-1.spec.ts b/src/function/arity/arity-1.spec.ts index f2977090..dbcd7e3a 100644 --- a/src/function/arity/arity-1.spec.ts +++ b/src/function/arity/arity-1.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity1 } from '~/function/arity/arity-1' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Arity0 } from './arity-0' describe('Arity1', () => { diff --git a/src/function/arity/arity-2.spec.ts b/src/function/arity/arity-2.spec.ts index 799e699d..1abccb91 100644 --- a/src/function/arity/arity-2.spec.ts +++ b/src/function/arity/arity-2.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity2 } from '~/function/arity/arity-2' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity2', () => { it('should be a function with 2 parameters', () => { diff --git a/src/function/arity/arity-3.spec.ts b/src/function/arity/arity-3.spec.ts index c7c291e3..a658ac0b 100644 --- a/src/function/arity/arity-3.spec.ts +++ b/src/function/arity/arity-3.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity3 } from '~/function/arity/arity-3' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity3', () => { it('should be a function with 3 parameters', () => { diff --git a/src/function/arity/arity-4.spec.ts b/src/function/arity/arity-4.spec.ts index 3e35495b..bdcd49cc 100644 --- a/src/function/arity/arity-4.spec.ts +++ b/src/function/arity/arity-4.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity4 } from '~/function/arity/arity-4' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity4', () => { it('should be a function with 4 parameters', () => { diff --git a/src/function/arity/arity-5.spec.ts b/src/function/arity/arity-5.spec.ts index af311bc1..998d5472 100644 --- a/src/function/arity/arity-5.spec.ts +++ b/src/function/arity/arity-5.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity5 } from '~/function/arity/arity-5' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity5', () => { it('should be a function with 5 parameters', () => { diff --git a/src/function/arity/arity-6.spec.ts b/src/function/arity/arity-6.spec.ts index 284d714d..2d320f8d 100644 --- a/src/function/arity/arity-6.spec.ts +++ b/src/function/arity/arity-6.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity6 } from '~/function/arity/arity-6' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity6', () => { it('should be a function with 6 parameters', () => { diff --git a/src/function/arity/arity-7.spec.ts b/src/function/arity/arity-7.spec.ts index 7923a759..7d8b933f 100644 --- a/src/function/arity/arity-7.spec.ts +++ b/src/function/arity/arity-7.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity7 } from '~/function/arity/arity-7' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity7', () => { it('should be a function with 7 parameters', () => { diff --git a/src/function/arity/arity-8.spec.ts b/src/function/arity/arity-8.spec.ts index 00345b79..14abb86d 100644 --- a/src/function/arity/arity-8.spec.ts +++ b/src/function/arity/arity-8.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Arity8 } from '~/function/arity/arity-8' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Arity8', () => { it('should be a function with 8 parameters', () => { diff --git a/src/function/constructor-return-type.spec.ts b/src/function/constructor-return-type.spec.ts index a715aaaf..918de7c6 100644 --- a/src/function/constructor-return-type.spec.ts +++ b/src/function/constructor-return-type.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { ConstructorReturnType } from '~/function/constructor-return-type' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('ConstructorReturnType', () => { it('should return the type of the constructor', () => { diff --git a/src/function/constructor.spec.ts b/src/function/constructor.spec.ts index 9ccfeede..d91dbf4f 100644 --- a/src/function/constructor.spec.ts +++ b/src/function/constructor.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Constructor } from '~/function/constructor' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Constructor', () => { it('should be a function with 1 argument', () => { diff --git a/src/function/factory.spec.ts b/src/function/factory.spec.ts index 64648beb..87761f2b 100644 --- a/src/function/factory.spec.ts +++ b/src/function/factory.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { Factory } from '~/function/factory' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('Factory', () => { it('should work without specifying any typeParams', () => { diff --git a/src/function/part-app/part-app-0.spec.ts b/src/function/part-app/part-app-0.spec.ts index a9210b3b..37bc9b4d 100644 --- a/src/function/part-app/part-app-0.spec.ts +++ b/src/function/part-app/part-app-0.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp0 } from '~/function/part-app/part-app-0' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp0', () => { it('should be a function with 0 arguments', () => { diff --git a/src/function/part-app/part-app-1.spec.ts b/src/function/part-app/part-app-1.spec.ts index 94762198..6b4200ff 100644 --- a/src/function/part-app/part-app-1.spec.ts +++ b/src/function/part-app/part-app-1.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp1 } from '~/function/part-app/part-app-1' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp1', () => { it('should be a function with 1 argument', () => { diff --git a/src/function/part-app/part-app-2.spec.ts b/src/function/part-app/part-app-2.spec.ts index 24e7d0bc..ad002f70 100644 --- a/src/function/part-app/part-app-2.spec.ts +++ b/src/function/part-app/part-app-2.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp2 } from '~/function/part-app/part-app-2' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp2', () => { it('should be a function with 2 arguments', () => { diff --git a/src/function/part-app/part-app-3.spec.ts b/src/function/part-app/part-app-3.spec.ts index 294e2548..306d7717 100644 --- a/src/function/part-app/part-app-3.spec.ts +++ b/src/function/part-app/part-app-3.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp3 } from '~/function/part-app/part-app-3' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp3', () => { it('should have 3 parameters', () => { diff --git a/src/function/part-app/part-app-4.spec.ts b/src/function/part-app/part-app-4.spec.ts index cf6848e1..c0264038 100644 --- a/src/function/part-app/part-app-4.spec.ts +++ b/src/function/part-app/part-app-4.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp4 } from '~/function/part-app/part-app-4' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp4', () => { it('should be a function with 4 parameters', () => { diff --git a/src/function/part-app/part-app-5.spec.ts b/src/function/part-app/part-app-5.spec.ts index bf034966..751ae0cf 100644 --- a/src/function/part-app/part-app-5.spec.ts +++ b/src/function/part-app/part-app-5.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp5 } from '~/function/part-app/part-app-5' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp5', () => { it('should be a function with 5 parameters', () => { diff --git a/src/function/part-app/part-app-6.spec.ts b/src/function/part-app/part-app-6.spec.ts index 6a8b5039..87e6329e 100644 --- a/src/function/part-app/part-app-6.spec.ts +++ b/src/function/part-app/part-app-6.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp6 } from '~/function/part-app/part-app-6' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp6', () => { it('should be a function with 6 parameters', () => { diff --git a/src/function/part-app/part-app-7.spec.ts b/src/function/part-app/part-app-7.spec.ts index 66d277c0..1b4a7d2a 100644 --- a/src/function/part-app/part-app-7.spec.ts +++ b/src/function/part-app/part-app-7.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp7 } from '~/function/part-app/part-app-7' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp6', () => { it('should be a function with 7 parameters', () => { diff --git a/src/function/part-app/part-app-8.spec.ts b/src/function/part-app/part-app-8.spec.ts index 774327ee..dcd13b4a 100644 --- a/src/function/part-app/part-app-8.spec.ts +++ b/src/function/part-app/part-app-8.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { PartApp8 } from '~/function/part-app/part-app-8' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('PartApp6', () => { it('should be a function with 8 parameters', () => { diff --git a/src/generator/antecedent/is-generator.spec.ts b/src/generator/antecedent/is-generator.spec.ts index cf0a1d3a..e03e63fd 100644 --- a/src/generator/antecedent/is-generator.spec.ts +++ b/src/generator/antecedent/is-generator.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { IsGenerator } from '~/generator/antecedent/is-generator' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('IsGenerator', () => { it('should return true if `A` is a generator', () => { diff --git a/src/generator/generator-next-type.spec.ts b/src/generator/generator-next-type.spec.ts index 0a8f8f84..583a0064 100644 --- a/src/generator/generator-next-type.spec.ts +++ b/src/generator/generator-next-type.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { GeneratorNextType } from '~/generator/generator-next-type' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('GeneratorNextType', () => { it('should return the next type of a generator', () => { diff --git a/src/generator/generator-return-type.spec.ts b/src/generator/generator-return-type.spec.ts index c5864c0f..0f8633f7 100644 --- a/src/generator/generator-return-type.spec.ts +++ b/src/generator/generator-return-type.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { GeneratorReturnType } from '~/generator/generator-return-type' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('GeneratorReturnType', () => { it('should return the return type of a generator', () => { diff --git a/src/generator/generator-yield-type.spec.ts b/src/generator/generator-yield-type.spec.ts index d6f076a2..15baff3a 100644 --- a/src/generator/generator-yield-type.spec.ts +++ b/src/generator/generator-yield-type.spec.ts @@ -1,6 +1,6 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' import type { GeneratorYieldType } from '~/generator/generator-yield-type' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' describe('GeneratorYieldType', () => { it('should return the yield type of a generator', () => { diff --git a/src/helper/capture-group.ts b/src/helper/capture-group.ts index 79191bd6..453f26cc 100644 --- a/src/helper/capture-group.ts +++ b/src/helper/capture-group.ts @@ -8,7 +8,7 @@ * type Ex = CaptureGroup<'{{', '}}'> // { start: '{{', end: '}}' } * ``` */ -export interface HelperCaptureGroup< +export interface CaptureGroup< A extends string = string, B extends string = string, > { diff --git a/src/helper/expect.ts b/src/helper/expect.ts new file mode 100644 index 00000000..a5f53e3f --- /dev/null +++ b/src/helper/expect.ts @@ -0,0 +1,6 @@ +/** + * Represents a type that expects a value of type `true` used for unit tests. + * + * @typeParam A The type to expect, which should be `true`. + */ +export type Expect = A diff --git a/src/helper/index.ts b/src/helper/index.ts index 4b8154b5..5b66c553 100644 --- a/src/helper/index.ts +++ b/src/helper/index.ts @@ -1,8 +1,6 @@ export * from './capture-group' export * from './inner-wrap-map' export * from './last-unique-in-union' -export * from './multi-add' -export * from './multi-sub' export * from './outer-wrap-map' export * from './to-string-interface' export * from './union-unique-length' diff --git a/src/helper/inner-wrap-map.ts b/src/helper/inner-wrap-map.ts index 1f54c9e4..beb5df13 100644 --- a/src/helper/inner-wrap-map.ts +++ b/src/helper/inner-wrap-map.ts @@ -3,4 +3,4 @@ * @typeParam A - The type to be wrapped. * @group Helper */ -export type HelperInnerWrapMap = A extends any ? () => A : never +export type InnerWrapMap = A extends any ? () => A : never diff --git a/src/helper/last-unique-in-union.ts b/src/helper/last-unique-in-union.ts index d6996d6a..8ef2e1d9 100644 --- a/src/helper/last-unique-in-union.ts +++ b/src/helper/last-unique-in-union.ts @@ -1,18 +1,14 @@ -import type { HelperInnerWrapMap } from '~/helper/inner-wrap-map' -import type { HelperOuterWrapMap } from '~/helper/outer-wrap-map' +import type { InnerWrapMap } from '~/helper/inner-wrap-map' +import type { OuterWrapMap } from '~/helper/outer-wrap-map' /** * Extracts the last unique type from a union type. * @typeParam A - The union type from which to extract the last unique type. * @group Helper */ -export type HelperLastUniqueInUnion = +export type LastUniqueInUnion = ( - HelperOuterWrapMap> extends HelperOuterWrapMap< - infer B - > - ? B - : never - ) extends HelperInnerWrapMap + OuterWrapMap> extends OuterWrapMap ? B : never + ) extends InnerWrapMap ? B : never diff --git a/src/helper/multi-add.ts b/src/helper/multi-add.ts deleted file mode 100644 index b43dbda5..00000000 --- a/src/helper/multi-add.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { IsZero } from '~/identity/antecedent/is-num-add-identity' -import type { Or } from '~/logic/antecedent/or' -import type { Add } from '~/math/add' -import type { Decrement } from '~/math/decrement' - -export interface MultiAddOpts { - value: A -} - -/** - * Repeated addition utility function used in multiplication - * @typeParam A - The first number. - * @typeParam B - The second number. - * @typeParam C - The accumulator. - * @group Helper - */ -export type HelperMultiAdd< - A extends number, - B extends number, - C extends MultiAddOpts = MultiAddOpts<0>, -> = - Or, IsZero> extends true - ? C['value'] - : HelperMultiAdd, MultiAddOpts>> diff --git a/src/helper/multi-sub.ts b/src/helper/multi-sub.ts deleted file mode 100644 index c55aa6fb..00000000 --- a/src/helper/multi-sub.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { IsLessThan } from '~/math/antecedent/is-less-than' -import type { Increment } from '~/math/increment' -import type { Subtract } from '~/math/subtract' - -export interface MultiSubOpts { - value: A -} - -/** - * Repeated subtraction utility function used in division - * @typeParam A - The first number. - * @typeParam B - The second number. - * @typeParam C - The accumulator. - * @group Helper - */ -export type HelperMultiSub< - A extends number, - B extends number, - C extends MultiSubOpts = MultiSubOpts<0>, -> = - IsLessThan extends true - ? C['value'] - : HelperMultiSub, B, MultiSubOpts>> diff --git a/src/helper/outer-wrap-map.ts b/src/helper/outer-wrap-map.ts index 22f357e4..47c18a5e 100644 --- a/src/helper/outer-wrap-map.ts +++ b/src/helper/outer-wrap-map.ts @@ -4,4 +4,4 @@ * @typeParam A - The type to be wrapped. * @group Helper */ -export type HelperOuterWrapMap = A extends any ? (_: A) => void : never +export type OuterWrapMap = A extends any ? (_: A) => void : never diff --git a/src/helper/test.ts b/src/helper/test.ts deleted file mode 100644 index 39163f50..00000000 --- a/src/helper/test.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type Expect = A - -export type Equal = - (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 - ? true - : false diff --git a/src/helper/to-natural-number.spec.ts b/src/helper/to-natural-number.spec.ts deleted file mode 100644 index 5f155479..00000000 --- a/src/helper/to-natural-number.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { ToNaturalNumber } from '~/helper/to-natural-number' -import type { Expect } from './test' - -describe('ToNaturalNumber', () => { - it('should convert a string to a natural number', () => { - type Ex1 = ToNaturalNumber<'0'> - type Ex2 = ToNaturalNumber<'1'> - type Ex3 = ToNaturalNumber<'99'> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - }) -}) diff --git a/src/helper/to-natural-number.ts b/src/helper/to-natural-number.ts deleted file mode 100644 index c0b4054f..00000000 --- a/src/helper/to-natural-number.ts +++ /dev/null @@ -1,93 +0,0 @@ -import type { IsExtension } from '~/extension/antecedent/is-extension' -import type { Add } from '~/math/add' -import type { Multiply } from '~/math/multiply' -import type { StringLength } from '~/string/string-length' - -/** - * @internal - */ -export interface DigitValue { - '0': 0 - '1': 1 - '2': 2 - '3': 3 - '4': 4 - '5': 5 - '6': 6 - '7': 7 - '8': 8 - '9': 9 -} - -/** - * @internal - */ -export interface PlaceValue { - 1: 1 - 2: 10 - 3: 100 -} - -/** - * @internal - */ -export type StringShift = A extends `${infer B}${string}` - ? B - : never - -/** - * @internal - */ -export type StringTail = A extends `${string}${infer B}` - ? B - : never - -/** - * @internal - */ -export interface ToNaturalNumberOpts< - A extends string = string, - B extends number = number, -> { - remaining: A - sum: B - leftMostDigit: StringShift - length: StringLength -} - -/** - * Converts a string representation of a natural number to its numeric value. - * @typeParam A - The input string. - * @typeParam B - Optional configuration options. - * @group Helper - * @example - * ``` - * type Ex1 = ToNaturalNumber<'123'> // 123 - * type Ex2 = ToNaturalNumber<'0'> // 0 - * type Ex3 = ToNaturalNumber<'000'> // 0 - * ``` - */ -export type ToNaturalNumber< - A extends string, - B extends ToNaturalNumberOpts = ToNaturalNumberOpts, -> = B['leftMostDigit'] extends '' - ? B['sum'] - : IsExtension extends true - ? B['leftMostDigit'] extends keyof DigitValue - ? B['length'] extends keyof PlaceValue - ? ToNaturalNumber< - StringTail, - ToNaturalNumberOpts< - StringTail, - Add< - Multiply< - DigitValue[B['leftMostDigit']], - PlaceValue[B['length']] - >, - B['sum'] - > - > - > - : number - : never - : never diff --git a/src/helper/to-string-interface.ts b/src/helper/to-string-interface.ts index 9fbb7d3f..57ba6f00 100644 --- a/src/helper/to-string-interface.ts +++ b/src/helper/to-string-interface.ts @@ -2,6 +2,6 @@ * Represents an interface that defines a `toString` method. * @group Helper */ -export interface HelperToStringInterface { +export interface ToStringInterface { toString(): string } diff --git a/src/helper/union-unique-length.ts b/src/helper/union-unique-length.ts index fa6b90eb..1ce8565a 100644 --- a/src/helper/union-unique-length.ts +++ b/src/helper/union-unique-length.ts @@ -1,5 +1,5 @@ import type { IsNever } from '~/any/antecedent/is-never' -import type { HelperLastUniqueInUnion } from '~/helper/last-unique-in-union' +import type { LastUniqueInUnion } from '~/helper/last-unique-in-union' import type { Increment } from '~/math/increment' export interface UnionUniqueLengthOpts { @@ -17,13 +17,13 @@ export interface UnionUniqueLengthOpts { * type Ex2 = UnionUniqueLength<1 | 2 | 1 | 3> // 3 * ``` */ -export type HelperUnionUniqueLength< +export type UnionUniqueLength< A, B extends UnionUniqueLengthOpts = UnionUniqueLengthOpts<0>, > = - IsNever> extends true + IsNever> extends true ? B['value'] - : HelperUnionUniqueLength< - Exclude>, + : UnionUniqueLength< + Exclude>, UnionUniqueLengthOpts> > diff --git a/src/identity/antecedent/is-array-concat-identity.spec.ts b/src/identity/antecedent/is-array-concat-identity.spec.ts index 72770de6..ba129069 100644 --- a/src/identity/antecedent/is-array-concat-identity.spec.ts +++ b/src/identity/antecedent/is-array-concat-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsArrayConcatIdentity } from '~/identity/antecedent/is-array-concat-identity' describe('IsArrayConcatIdentity', () => { diff --git a/src/identity/antecedent/is-bigint-add-identity.spec.ts b/src/identity/antecedent/is-bigint-add-identity.spec.ts index 06725b8b..1e7c0e1d 100644 --- a/src/identity/antecedent/is-bigint-add-identity.spec.ts +++ b/src/identity/antecedent/is-bigint-add-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsBigIntAddIdentity } from '~/identity/antecedent/is-bigint-add-identity' describe('IsBigIntAddIdentity', () => { diff --git a/src/identity/antecedent/is-bigint-mult-identity.spec.ts b/src/identity/antecedent/is-bigint-mult-identity.spec.ts index 6e523d6f..c85de411 100644 --- a/src/identity/antecedent/is-bigint-mult-identity.spec.ts +++ b/src/identity/antecedent/is-bigint-mult-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsBigIntMultIdentity } from '~/identity/antecedent/is-bigint-mult-identity' describe('IsBigIntMultIdentity', () => { diff --git a/src/identity/antecedent/is-num-add-identity.spec.ts b/src/identity/antecedent/is-num-add-identity.spec.ts index 33e6d7eb..9163116d 100644 --- a/src/identity/antecedent/is-num-add-identity.spec.ts +++ b/src/identity/antecedent/is-num-add-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsNumAddIdentity } from '~/identity/antecedent/is-num-add-identity' describe('IsNumAddIdentity', () => { diff --git a/src/identity/antecedent/is-num-add-identity.ts b/src/identity/antecedent/is-num-add-identity.ts index e1dea77b..2b7b73ec 100644 --- a/src/identity/antecedent/is-num-add-identity.ts +++ b/src/identity/antecedent/is-num-add-identity.ts @@ -12,11 +12,3 @@ import type { IsExtension } from '~/any' * ``` */ export type IsNumAddIdentity = IsExtension - -/** - * Alias for `IsNumAddIdentity` - * @typeParam A - The type to check. - * @group Antecedent - * @group Identity - */ -export type IsZero = IsNumAddIdentity diff --git a/src/identity/antecedent/is-num-mult-identity.spec.ts b/src/identity/antecedent/is-num-mult-identity.spec.ts index 8ad23b08..28f70987 100644 --- a/src/identity/antecedent/is-num-mult-identity.spec.ts +++ b/src/identity/antecedent/is-num-mult-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsNumMultIdentity } from '~/identity/antecedent/is-num-mult-identity' describe('IsNumMultIdentity', () => { diff --git a/src/identity/antecedent/is-object-assign-identity.spec.ts b/src/identity/antecedent/is-object-assign-identity.spec.ts index 30d63315..16d6e2d8 100644 --- a/src/identity/antecedent/is-object-assign-identity.spec.ts +++ b/src/identity/antecedent/is-object-assign-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsObjectAssignIdentity } from '~/identity/antecedent/is-object-assign-identity' describe('IsObjectAssignIdentity', () => { diff --git a/src/identity/antecedent/is-string-concat-identity.spec.ts b/src/identity/antecedent/is-string-concat-identity.spec.ts index 6e8af144..c8edfef6 100644 --- a/src/identity/antecedent/is-string-concat-identity.spec.ts +++ b/src/identity/antecedent/is-string-concat-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsStringConcatIdentity } from '~/identity/antecedent/is-string-concat-identity' describe('IsStringConcatIdentity', () => { diff --git a/src/identity/array-concat-identity.spec.ts b/src/identity/array-concat-identity.spec.ts index a1e58ed4..869df87b 100644 --- a/src/identity/array-concat-identity.spec.ts +++ b/src/identity/array-concat-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { ArrayConcatIdentity } from '~/identity/array-concat-identity' describe('ArrayConcatIdentity', () => { diff --git a/src/identity/bigint-add-identity.spec.ts b/src/identity/bigint-add-identity.spec.ts index b7dd6f68..7fc5b8e4 100644 --- a/src/identity/bigint-add-identity.spec.ts +++ b/src/identity/bigint-add-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { BigIntAddIdentity } from '~/identity/bigint-add-identity' describe('BigIntAddIdentity', () => { diff --git a/src/identity/bigint-mult-identity.spec.ts b/src/identity/bigint-mult-identity.spec.ts index 12be4c89..b1ad4f28 100644 --- a/src/identity/bigint-mult-identity.spec.ts +++ b/src/identity/bigint-mult-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { BigIntMultIdentity } from '~/identity/bigint-mult-identity' describe('BigIntMultIdentity', () => { diff --git a/src/identity/num-add-identity.spec.ts b/src/identity/num-add-identity.spec.ts index 2dc27eef..1f51f5d3 100644 --- a/src/identity/num-add-identity.spec.ts +++ b/src/identity/num-add-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { NumAddIdentity } from '~/identity/num-add-identity' describe('NumAddIdentity', () => { diff --git a/src/identity/num-mult-identity.spec.ts b/src/identity/num-mult-identity.spec.ts index 36e56b7f..ee1fc8f9 100644 --- a/src/identity/num-mult-identity.spec.ts +++ b/src/identity/num-mult-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { NumMultIdentity } from '~/identity/num-mult-identity' describe('NumMultIdentity', () => { diff --git a/src/identity/object-assign-identity.spec.ts b/src/identity/object-assign-identity.spec.ts index e1a2839e..7ef0dfef 100644 --- a/src/identity/object-assign-identity.spec.ts +++ b/src/identity/object-assign-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { ObjectAssignIdentity } from '~/identity/object-assign-identity' describe('ObjectAssignIdentity', () => { diff --git a/src/identity/string-concat-identity.spec.ts b/src/identity/string-concat-identity.spec.ts index eec6c605..acc79eea 100644 --- a/src/identity/string-concat-identity.spec.ts +++ b/src/identity/string-concat-identity.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { StringConcatIdentity } from '~/identity/string-concat-identity' describe('StringConcatIdentity', () => { diff --git a/src/literal/antecedent/is-literal-bigint.spec.ts b/src/literal/antecedent/is-literal-bigint.spec.ts index 7cb80d04..8c523c1d 100644 --- a/src/literal/antecedent/is-literal-bigint.spec.ts +++ b/src/literal/antecedent/is-literal-bigint.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralBigInt } from '~/literal/antecedent/is-literal-bigint' describe('IsLiteralBigInt', () => { diff --git a/src/literal/antecedent/is-literal-boolean.spec.ts b/src/literal/antecedent/is-literal-boolean.spec.ts index da1474e0..e9209d3b 100644 --- a/src/literal/antecedent/is-literal-boolean.spec.ts +++ b/src/literal/antecedent/is-literal-boolean.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralBoolean } from '~/literal/antecedent/is-literal-boolean' describe('IsLiteralBoolean', () => { diff --git a/src/literal/antecedent/is-literal-key.spec.ts b/src/literal/antecedent/is-literal-key.spec.ts index 508c78b8..4e2ba5b0 100644 --- a/src/literal/antecedent/is-literal-key.spec.ts +++ b/src/literal/antecedent/is-literal-key.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralKey } from '~/literal/antecedent/is-literal-key' describe('IsLiteralKey', () => { diff --git a/src/literal/antecedent/is-literal-null.spec.ts b/src/literal/antecedent/is-literal-null.spec.ts index 247215ea..5f6af22f 100644 --- a/src/literal/antecedent/is-literal-null.spec.ts +++ b/src/literal/antecedent/is-literal-null.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralNull } from '~/literal/antecedent/is-literal-null' describe('IsLiteralNull', () => { diff --git a/src/literal/antecedent/is-literal-number.spec.ts b/src/literal/antecedent/is-literal-number.spec.ts index 0b1cd1aa..72d327f2 100644 --- a/src/literal/antecedent/is-literal-number.spec.ts +++ b/src/literal/antecedent/is-literal-number.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralNumber } from '~/literal/antecedent/is-literal-number' describe('IsLiteralNumber', () => { diff --git a/src/literal/antecedent/is-literal-primitive.spec.ts b/src/literal/antecedent/is-literal-primitive.spec.ts index f4db8be8..bb5b7341 100644 --- a/src/literal/antecedent/is-literal-primitive.spec.ts +++ b/src/literal/antecedent/is-literal-primitive.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralPrimitive } from '~/literal/antecedent/is-literal-primitive' describe('IsLiteralPrimitive', () => { diff --git a/src/literal/antecedent/is-literal-string.spec.ts b/src/literal/antecedent/is-literal-string.spec.ts index cad211a0..17f66014 100644 --- a/src/literal/antecedent/is-literal-string.spec.ts +++ b/src/literal/antecedent/is-literal-string.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralString } from '~/literal/antecedent/is-literal-string' describe('IsLiteralString', () => { diff --git a/src/literal/antecedent/is-literal-symbol.spec.ts b/src/literal/antecedent/is-literal-symbol.spec.ts index 0c664526..3f7bbe44 100644 --- a/src/literal/antecedent/is-literal-symbol.spec.ts +++ b/src/literal/antecedent/is-literal-symbol.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralSymbol } from '~/literal/antecedent/is-literal-symbol' describe('IsLiteralSymbol', () => { diff --git a/src/literal/antecedent/is-literal-undefined.spec.ts b/src/literal/antecedent/is-literal-undefined.spec.ts index f53992c7..3ed5c790 100644 --- a/src/literal/antecedent/is-literal-undefined.spec.ts +++ b/src/literal/antecedent/is-literal-undefined.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralUndefined } from '~/literal/antecedent/is-literal-undefined' describe('IsLiteralUndefined', () => { diff --git a/src/literal/antecedent/is-literal-void.spec.ts b/src/literal/antecedent/is-literal-void.spec.ts index 992909c4..c2d26203 100644 --- a/src/literal/antecedent/is-literal-void.spec.ts +++ b/src/literal/antecedent/is-literal-void.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLiteralVoid } from '~/literal/antecedent/is-literal-void' describe('IsLiteralVoid', () => { diff --git a/src/logic/antecedent/and.spec.ts b/src/logic/antecedent/and.spec.ts index 3a35f847..a3f95a52 100644 --- a/src/logic/antecedent/and.spec.ts +++ b/src/logic/antecedent/and.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { And } from '~/logic/antecedent/and' describe('And', () => { diff --git a/src/logic/antecedent/is-false.spec.ts b/src/logic/antecedent/is-false.spec.ts index 61102740..42da344c 100644 --- a/src/logic/antecedent/is-false.spec.ts +++ b/src/logic/antecedent/is-false.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsFalse } from '~/logic/antecedent/is-false' describe('IsFalse', () => { diff --git a/src/logic/antecedent/is-true.spec.ts b/src/logic/antecedent/is-true.spec.ts index 5ab4ff9b..1a5ef9fe 100644 --- a/src/logic/antecedent/is-true.spec.ts +++ b/src/logic/antecedent/is-true.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsTrue } from '~/logic/antecedent/is-true' describe('IsTrue', () => { diff --git a/src/logic/antecedent/not.spec.ts b/src/logic/antecedent/not.spec.ts index 460888e8..7da870f1 100644 --- a/src/logic/antecedent/not.spec.ts +++ b/src/logic/antecedent/not.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Not } from '~/logic/antecedent/not' describe('Not', () => { diff --git a/src/logic/antecedent/or.spec.ts b/src/logic/antecedent/or.spec.ts index 0a395916..adb03561 100644 --- a/src/logic/antecedent/or.spec.ts +++ b/src/logic/antecedent/or.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Or } from '~/logic/antecedent/or' describe('Or', () => { diff --git a/src/logic/antecedent/xor.spec.ts b/src/logic/antecedent/xor.spec.ts index e76726d4..72ad8815 100644 --- a/src/logic/antecedent/xor.spec.ts +++ b/src/logic/antecedent/xor.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Xor } from '~/logic/antecedent/xor' describe('Xor', () => { diff --git a/src/logic/if.spec.ts b/src/logic/if.spec.ts index 3a4bea64..75b8ed87 100644 --- a/src/logic/if.spec.ts +++ b/src/logic/if.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { If } from '~/logic/if' describe('If', () => { diff --git a/src/math/absolute.spec.ts b/src/math/absolute.spec.ts index 3e3d6c88..e9024116 100644 --- a/src/math/absolute.spec.ts +++ b/src/math/absolute.spec.ts @@ -1,15 +1,21 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Absolute } from '~/math/absolute' +import type { Expect } from '~/helper/expect' +import type { Absolute } from './absolute' -describe('Absolute', () => { +describe('absolute', () => { it('should return the absolute value of a number', () => { - type Ex1 = Absolute<0> - type Ex2 = Absolute<-1> + type Ex1 = Absolute<-1> + type Ex2 = Absolute<0> type Ex3 = Absolute<1> + type Ex4 = Absolute<-1n> + type Ex5 = Absolute<0n> + type Ex6 = Absolute<1n> - type TestEx1 = Expect> - type TestEx2 = Expect> + type TestEx1 = Expect> + type TestEx2 = Expect> type TestEx3 = Expect> + type TestEx4 = Expect> + type TestEx5 = Expect> + type TestEx6 = Expect> }) }) diff --git a/src/math/absolute.ts b/src/math/absolute.ts index becc0332..d56c83c0 100644 --- a/src/math/absolute.ts +++ b/src/math/absolute.ts @@ -1,24 +1,17 @@ -import type { ToNaturalNumber } from '~/helper/to-natural-number' -import type { If } from '~/logic/if' -import type { IsNatural } from '~/math/antecedent/is-natural' -import type { ConsumeRight } from '~/string/consume-right' +import type { + FromDigitNumber, + Normalize, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' /** - * Calculates the absolute value of `A`, where `A ∈ ℕ`. - * @typeParam A - The input number. - * @group Math - * @experimental - * @example - * ``` - * type Ex1 = Absolute<0> // 0 - * type Ex2 = Absolute<-0> // 0 - * type Ex3 = Absolute<-1> // 1 - * type Ex4 = Absolute<-100> // 100 - * type Ex5 = Absolute<100> // 100 - * ``` + * Returns the absolute value of a number or bigint. + * + * @typeParam A - The input number or bigint. */ -export type Absolute = If< - IsNatural, - ToNaturalNumber<`${A}`>, - ToNaturalNumber> -> +export type Absolute = + `${A}` extends `-${infer U extends number | bigint}` + ? U + : ToNumber>>>> diff --git a/src/math/add.spec.ts b/src/math/add.spec.ts index b75f3d32..2b82097e 100644 --- a/src/math/add.spec.ts +++ b/src/math/add.spec.ts @@ -1,13 +1,33 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Add } from '~/math/add' +import type { Expect } from '~/helper/expect' +import type { Add } from './add' -describe('Add', () => { +describe('addition', () => { it('should add two numbers', () => { - type Ex1 = Add<1, 2> - type Ex2 = Add<2, 3> + type Ex1 = Add<0, 1> + type Ex2 = Add<1, 2> + type Ex3 = Add<2, 3> + type Ex4 = Add<0n, 1n> + type Ex5 = Add<1n, 2n> + type Ex6 = Add<2n, 3n> + type Ex7 = Add<0, 1n> + type Ex8 = Add<1, 2n> + type Ex9 = Add<2, 3n> + type Ex10 = Add<0n, 1> + type Ex11 = Add<1n, 2> + type Ex12 = Add<2n, 3> - type TestEx1 = Expect> - type TestEx2 = Expect> + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> + type TestEx5 = Expect> + type TestEx6 = Expect> + type TestEx7 = Expect> + type TestEx8 = Expect> + type TestEx9 = Expect> + type TestEx10 = Expect> + type TestEx11 = Expect> + type TestEx12 = Expect> }) }) diff --git a/src/math/add.ts b/src/math/add.ts index f571c088..9805b9bd 100644 --- a/src/math/add.ts +++ b/src/math/add.ts @@ -1,22 +1,39 @@ -import type { And } from '~/logic/antecedent/and' -import type { If } from '~/logic/if' -import type { IsNatural } from '~/math/antecedent/is-natural' -import type { LengthProp } from '~/object/length-prop' -import type { Tuple } from '~/tuple/tuple' +import type { CompareDigits } from './compare' +import type { AddDigits } from './digits/addition-digits' +import type { SubDigits } from './digits/substraction-digits' +import type { + DigitNumber, + FromDigitNumber, + InvertSign, + MakeDigitNumber, + Normalize, + Num, + Sign, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' + +type AddDigitNumbers = + Sign extends Sign + ? MakeDigitNumber, AddDigits, Num>> + : CompareDigits, Num> extends 1 + ? MakeDigitNumber, SubDigits, Num>> + : MakeDigitNumber, SubDigits, Num>> /** - * Evaluate `A + B`, where `A ∈ ℕ` and `B ∈ ℕ`. - * @typeParam A - The first number. - * @typeParam B - The second number. - * @group Math - * @example - * ``` - * type Ex1 = Add<1, 2> // 3 - * type Ex2 = Add<0, 5> // 5 - * ``` + * Adds two numbers or bigints. + * + * @typeParam A - The type of the first number or bigint. + * @typeParam B - The type of the second number or bigint. */ -export type Add = If< - And, IsNatural>, - [...Tuple, ...Tuple] extends [...infer C] ? LengthProp : number, - number +export type Add< + A extends number | bigint, + B extends number | bigint, +> = ToNumber< + FromDigitNumber< + Normalize< + AddDigitNumbers>, ToDigitNumber>> + > + > > diff --git a/src/math/antecedent/index.ts b/src/math/antecedent/index.ts index c2595803..7ed12886 100644 --- a/src/math/antecedent/index.ts +++ b/src/math/antecedent/index.ts @@ -1,12 +1,9 @@ -export * from './is-divisible' -export * from './is-float' export * from './is-greater-than' export * from './is-greater-than-or-equal' -export * from './is-integer' export * from './is-less-than' export * from './is-less-than-or-equal' -export * from './is-natural' export * from './is-negative' export * from './is-non-negative' export * from './is-non-positive' export * from './is-positive' +export * from './is-zero' diff --git a/src/math/antecedent/is-divisible.spec.ts b/src/math/antecedent/is-divisible.spec.ts deleted file mode 100644 index 23120670..00000000 --- a/src/math/antecedent/is-divisible.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsDivisible } from '~/math/antecedent/is-divisible' - -describe('IsDivisible', () => { - it('should be true', () => { - type Ex1 = IsDivisible<10, 2> - - type TestEx1 = Expect> - }) - - it('should be false', () => { - type Ex1 = IsDivisible<10, 3> - type Ex2 = IsDivisible<10, number> - type Ex3 = IsDivisible - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - }) -}) diff --git a/src/math/antecedent/is-divisible.ts b/src/math/antecedent/is-divisible.ts deleted file mode 100644 index e60512fe..00000000 --- a/src/math/antecedent/is-divisible.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { IsZero } from '~/identity/antecedent/is-num-add-identity' -import type { IsLiteralNumber } from '~/literal/antecedent' -import type { And } from '~/logic/antecedent/and' -import type { Modulo } from '~/math/modulo' - -/** - * Evaluate `A % B === 0`, where `A ∈ ℕ` and `B ∈ ℕ` - * @typeParam A - The dividend. - * @typeParam B - The divisor. - * @group Antecedent - * @group Math - * @example - * ``` - * type Ex1 = IsDivisble<9, 3> // true - * type Ex2 = IsDivisible<11, 3> // false - * ``` - */ -export type IsDivisible = - And, IsLiteralNumber> extends true - ? IsZero> - : false diff --git a/src/math/antecedent/is-float.spec.ts b/src/math/antecedent/is-float.spec.ts deleted file mode 100644 index 1fc70228..00000000 --- a/src/math/antecedent/is-float.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsFloat } from '~/math/antecedent/is-float' - -describe('IsFloat', () => { - it('should return true for floating point numbers', () => { - type Ex1 = IsFloat<0.1> - type Ex2 = IsFloat<1.1> - type Ex3 = IsFloat<1.1e100> - type Ex4 = IsFloat<1.1e-100> - type Ex5 = IsFloat<1.1e100> - type Ex6 = IsFloat<-1.1> - type Ex7 = IsFloat<-1.1e100> - type Ex8 = IsFloat<-1.1e-100> - type Ex9 = IsFloat<-1.1e100> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - type TestEx4 = Expect> - type TestEx5 = Expect> - type TestEx6 = Expect> - type TestEx7 = Expect> - type TestEx8 = Expect> - type TestEx9 = Expect> - }) -}) diff --git a/src/math/antecedent/is-float.ts b/src/math/antecedent/is-float.ts deleted file mode 100644 index c5863414..00000000 --- a/src/math/antecedent/is-float.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { IsExtension } from '~/extension/antecedent/is-extension' - -/** - * If the string representation of `A` has a decimal then `true` else `false` - * @typeParam A - The number to check. - * @group Antecedent - * @group Math - * @example - * ``` - * type Ex1 = IsFloat<1.2> // true - * type Ex2 = IsFloat<3> // false - * ``` - */ -export type IsFloat = IsExtension< - `${A}`, - | `${number}.${number}` - | `${number}.${number}e${number}` - | `${number}.${number}e+${number}` - | `${number}.${number}e-${number}` -> diff --git a/src/math/antecedent/is-greater-than-or-equal.spec.ts b/src/math/antecedent/is-greater-than-or-equal.spec.ts index 94d1d025..b6d3d9fc 100644 --- a/src/math/antecedent/is-greater-than-or-equal.spec.ts +++ b/src/math/antecedent/is-greater-than-or-equal.spec.ts @@ -1,21 +1,41 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsGreaterThanOrEqual } from '~/math/antecedent/is-greater-than-or-equal' +import type { Expect } from '~/helper/expect' +import type { IsGreaterThanOrEqual } from './is-greater-than-or-equal' describe('IsGreaterThanOrEqual', () => { - it('should equal false', () => { - type TestIsGreaterThanOrEqual = Expect< - IsEqual, false> - > + it('should return true if A is greater than B', () => { + type Ex1 = IsGreaterThanOrEqual<2, 1> + type Ex2 = IsGreaterThanOrEqual<2, 1n> + type Ex3 = IsGreaterThanOrEqual<2n, 1> + type Ex4 = IsGreaterThanOrEqual<2n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal true', () => { - type TestIsGreaterThanOrEqual = Expect< - IsEqual, true> - > + + it('should return false if A is less than B', () => { + type Ex1 = IsGreaterThanOrEqual<1, 2> + type Ex2 = IsGreaterThanOrEqual<1, 2n> + type Ex3 = IsGreaterThanOrEqual<1n, 2> + type Ex4 = IsGreaterThanOrEqual<1n, 2n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal true', () => { - type TestIsGreaterThanOrEqual = Expect< - IsEqual, true> - > + + it('should return true if A is equal to B', () => { + type Ex1 = IsGreaterThanOrEqual<1, 1> + type Ex2 = IsGreaterThanOrEqual<1, 1n> + type Ex3 = IsGreaterThanOrEqual<1n, 1> + type Ex4 = IsGreaterThanOrEqual<1n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) }) diff --git a/src/math/antecedent/is-greater-than-or-equal.ts b/src/math/antecedent/is-greater-than-or-equal.ts index 55e628f0..d6223f3a 100644 --- a/src/math/antecedent/is-greater-than-or-equal.ts +++ b/src/math/antecedent/is-greater-than-or-equal.ts @@ -1,19 +1,15 @@ -import type { Not } from '~/logic/antecedent/not' -import type { IsLessThan } from '~/math/antecedent/is-less-than' +import type { Subtract } from '../subtract' +import type { IsNegative } from './is-negative' /** - * Evaluate `A ≥ B`, where `A ∈ ℕ` and `B ∈ ℕ` - * @typeParam A - The number to compare. - * @typeParam B - The number to compare against. + * Determines if the value of A is greater than or equal to the value of B. + * + * @typeParam A - The first number or bigint. + * @typeParam B - The second number or bigint. * @group Antecedent * @group Math - * @example - * ``` - * type Ex1 = IsGreaterThanOrEqual<3, 1> // true - * type Ex2 = IsGreaterThanOrEqual<3, 3> // true - * type Ex3 = IsGreaterThanOrEqual<1, 3> // false - * ``` */ -export type IsGreaterThanOrEqual = Not< - IsLessThan -> +export type IsGreaterThanOrEqual< + A extends number | bigint, + B extends number | bigint, +> = IsNegative> extends true ? false : true diff --git a/src/math/antecedent/is-greater-than.spec.ts b/src/math/antecedent/is-greater-than.spec.ts index 39b4e2ab..ac481261 100644 --- a/src/math/antecedent/is-greater-than.spec.ts +++ b/src/math/antecedent/is-greater-than.spec.ts @@ -1,15 +1,41 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsGreaterThan } from '~/math/antecedent/is-greater-than' +import type { Expect } from '~/helper/expect' +import type { IsGreaterThan } from './is-greater-than' describe('IsGreaterThan', () => { - it('should equal false', () => { - type TestIsGreaterThan = Expect, false>> + it('should return true if A is greater than B', () => { + type Ex1 = IsGreaterThan<2, 1> + type Ex2 = IsGreaterThan<2, 1n> + type Ex3 = IsGreaterThan<2n, 1> + type Ex4 = IsGreaterThan<2n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal true', () => { - type TestIsGreaterThan = Expect, true>> + + it('should return false if A is less than B', () => { + type Ex1 = IsGreaterThan<1, 2> + type Ex2 = IsGreaterThan<1, 2n> + type Ex3 = IsGreaterThan<1n, 2> + type Ex4 = IsGreaterThan<1n, 2n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal false', () => { - type TestIsGreaterThan = Expect, false>> + + it('should return false if A is equal to B', () => { + type Ex1 = IsGreaterThan<1, 1> + type Ex2 = IsGreaterThan<1, 1n> + type Ex3 = IsGreaterThan<1n, 1> + type Ex4 = IsGreaterThan<1n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) }) diff --git a/src/math/antecedent/is-greater-than.ts b/src/math/antecedent/is-greater-than.ts index eccfae5b..c2cf73e8 100644 --- a/src/math/antecedent/is-greater-than.ts +++ b/src/math/antecedent/is-greater-than.ts @@ -1,15 +1,15 @@ -import type { IsLessThan } from '~/math/antecedent/is-less-than' +import type { Subtract } from '../subtract' +import type { IsNegative } from './is-negative' /** - * Evaluate `A > B`, where `A ∈ ℕ` and `B ∈ ℕ` - * @typeParam A - The number to compare. - * @typeParam B - The number to compare against. + * Determines if the value of A is greater than the value of B. + * + * @typeParam A - The first number or bigint. + * @typeParam B - The second number or bigint. * @group Antecedent * @group Math - * @example - * ``` - * type Ex1 = IsGreaterThan<3, 1> // true - * type Ex2 = IsGreaterThan<1, 3> // false - * ``` */ -export type IsGreaterThan = IsLessThan +export type IsGreaterThan< + A extends number | bigint, + B extends number | bigint, +> = IsNegative> diff --git a/src/math/antecedent/is-integer.spec.ts b/src/math/antecedent/is-integer.spec.ts deleted file mode 100644 index 91056ab4..00000000 --- a/src/math/antecedent/is-integer.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsInteger } from '~/math/antecedent/is-integer' - -describe('IsInteger', () => { - it('should return true for integers', () => { - type Ex1 = IsInteger<1> - type Ex2 = IsInteger<0> - type Ex3 = IsInteger<-1> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - }) - - it('should return false for floating point numbers', () => { - type Ex1 = IsInteger<0.1> - type Ex2 = IsInteger<1.1> - type Ex3 = IsInteger<1.1e100> - type Ex4 = IsInteger<1.1e-100> - type Ex5 = IsInteger<1.1e100> - type Ex6 = IsInteger<-1.1> - type Ex7 = IsInteger<-1.1e100> - type Ex8 = IsInteger<-1.1e-100> - type Ex9 = IsInteger<-1.1e100> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - type TestEx4 = Expect> - type TestEx5 = Expect> - type TestEx6 = Expect> - type TestEx7 = Expect> - type TestEx8 = Expect> - type TestEx9 = Expect> - }) -}) diff --git a/src/math/antecedent/is-integer.ts b/src/math/antecedent/is-integer.ts deleted file mode 100644 index 42112235..00000000 --- a/src/math/antecedent/is-integer.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Not } from '~/logic/antecedent/not' -import type { IsFloat } from '~/math/antecedent/is-float' - -/** - * If `A ∈ ℤ` then `true` else `false`. - * @typeParam A - The number to check. - * @group Antecedent - * @group Math - * @example - * ``` - * type Ex1 = IsInteger<1> // true - * type Ex2 = IsInteger<2.3> // false - * ``` - */ -export type IsInteger = Not> diff --git a/src/math/antecedent/is-less-than-or-equal.spec.ts b/src/math/antecedent/is-less-than-or-equal.spec.ts index badd1bfb..0a10a02f 100644 --- a/src/math/antecedent/is-less-than-or-equal.spec.ts +++ b/src/math/antecedent/is-less-than-or-equal.spec.ts @@ -1,15 +1,41 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsLessThanOrEqual } from '~/math/antecedent/is-less-than-or-equal' +import type { Expect } from '~/helper/expect' +import type { IsLessThanOrEqual } from './is-less-than-or-equal' describe('IsLessThanOrEqual', () => { - it('should equal false', () => { - type TestIsLessThanOrEqual = Expect, false>> + it('should return true if A is less than B', () => { + type Ex1 = IsLessThanOrEqual<1, 2> + type Ex2 = IsLessThanOrEqual<1, 2n> + type Ex3 = IsLessThanOrEqual<1n, 2> + type Ex4 = IsLessThanOrEqual<1n, 2n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal true', () => { - type TestIsLessThanOrEqual = Expect, true>> + + it('should return false if A is greater than B', () => { + type Ex1 = IsLessThanOrEqual<2, 1> + type Ex2 = IsLessThanOrEqual<2, 1n> + type Ex3 = IsLessThanOrEqual<2n, 1> + type Ex4 = IsLessThanOrEqual<2n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal true', () => { - type TestIsLessThanOrEqual = Expect, true>> + + it('should return true if A is equal to B', () => { + type Ex1 = IsLessThanOrEqual<1, 1> + type Ex2 = IsLessThanOrEqual<1, 1n> + type Ex3 = IsLessThanOrEqual<1n, 1> + type Ex4 = IsLessThanOrEqual<1n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) }) diff --git a/src/math/antecedent/is-less-than-or-equal.ts b/src/math/antecedent/is-less-than-or-equal.ts index 6c1a5911..c90219d7 100644 --- a/src/math/antecedent/is-less-than-or-equal.ts +++ b/src/math/antecedent/is-less-than-or-equal.ts @@ -1,19 +1,15 @@ -import type { Not } from '~/logic/antecedent/not' -import type { IsGreaterThan } from '~/math/antecedent/is-greater-than' +import type { Subtract } from '../subtract' +import type { IsNegative } from './is-negative' /** - * Evaluate `A ≤ B`, where `A ∈ ℕ` and `B ∈ ℕ` - * @typeParam A - The number to compare. - * @typeParam B - The number to compare against. + * Determines if the value of A is less than or equal to the value of B. + * + * @typeParam A - The first number or bigint. + * @typeParam B - The second number or bigint. * @group Antecedent * @group Math - * @example - * ``` - * type Ex1 = IsLessThanOrEqual<3, 1> // true - * type Ex2 = IsLessThanOrEqual<3, 3> // true - * type Ex3 = IsLessThanOrEqual<1, 3> // false - * ``` */ -export type IsLessThanOrEqual = Not< - IsGreaterThan -> +export type IsLessThanOrEqual< + A extends number | bigint, + B extends number | bigint, +> = IsNegative> extends true ? false : true diff --git a/src/math/antecedent/is-less-than.spec.ts b/src/math/antecedent/is-less-than.spec.ts index db4e3fa0..bc2c28fb 100644 --- a/src/math/antecedent/is-less-than.spec.ts +++ b/src/math/antecedent/is-less-than.spec.ts @@ -1,15 +1,41 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsLessThan } from '~/math/antecedent/is-less-than' +import type { Expect } from '~/helper/expect' +import type { IsLessThan } from './is-less-than' describe('IsLessThan', () => { - it('should equal false', () => { - type TestIsLessThan = Expect, false>> + it('should return true if A is less than B', () => { + type Ex1 = IsLessThan<1, 2> + type Ex2 = IsLessThan<1, 2n> + type Ex3 = IsLessThan<1n, 2> + type Ex4 = IsLessThan<1n, 2n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal true', () => { - type TestIsLessThan = Expect, true>> + + it('should return false if A is greater than B', () => { + type Ex1 = IsLessThan<2, 1> + type Ex2 = IsLessThan<2, 1n> + type Ex3 = IsLessThan<2n, 1> + type Ex4 = IsLessThan<2n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) - it('should equal false', () => { - type TestIsLessThan = Expect, false>> + + it('should return false if A is equal to B', () => { + type Ex1 = IsLessThan<1, 1> + type Ex2 = IsLessThan<1, 1n> + type Ex3 = IsLessThan<1n, 1> + type Ex4 = IsLessThan<1n, 1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) }) diff --git a/src/math/antecedent/is-less-than.ts b/src/math/antecedent/is-less-than.ts index 7649784d..1dcfeb49 100644 --- a/src/math/antecedent/is-less-than.ts +++ b/src/math/antecedent/is-less-than.ts @@ -1,22 +1,15 @@ -import type { IsZero } from '~/identity/antecedent/is-num-add-identity' -import type { Not } from '~/logic/antecedent/not' -import type { Decrement } from '~/math/decrement' +import type { Subtract } from '../subtract' +import type { IsNegative } from './is-negative' /** - * Evaluate `A < B`, where `A ∈ ℕ` and `B ∈ ℕ` - * @typeParam A - The number to compare. - * @typeParam B - The number to compare against. + * Determines if the value of A is less than the value of B. + * + * @typeParam A - The first number or bigint. + * @typeParam B - The second number or bigint. * @group Antecedent * @group Math - * @example - * ``` - * type Ex1 = IsLessThan<1, 3> // true - * type Ex2 = IsLessThan<3, 1> // false - * ``` */ -export type IsLessThan = - IsZero extends true - ? Not> - : IsZero extends true - ? IsZero - : IsLessThan, Decrement> +export type IsLessThan< + A extends number | bigint, + B extends number | bigint, +> = IsNegative> diff --git a/src/math/antecedent/is-natural.spec.ts b/src/math/antecedent/is-natural.spec.ts deleted file mode 100644 index 510fec9e..00000000 --- a/src/math/antecedent/is-natural.spec.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsNatural } from '~/math/antecedent/is-natural' - -describe('IsNatural', () => { - it('should return true for natural numbers', () => { - type Ex1 = IsNatural<0> - type Ex2 = IsNatural<1> - type Ex3 = IsNatural<2> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - }) - - it('should return false for negative numbers', () => { - type Ex1 = IsNatural<-1> - type Ex2 = IsNatural<-2> - - type TestEx1 = Expect> - type TestEx2 = Expect> - }) - - it('should return false for floating point numbers', () => { - type Ex1 = IsNatural<0.1> - type Ex2 = IsNatural<1.1> - type Ex3 = IsNatural<1.1e100> - type Ex4 = IsNatural<1.1e-100> - type Ex5 = IsNatural<1.1e100> - type Ex6 = IsNatural<-1.1> - type Ex7 = IsNatural<-1.1e100> - type Ex8 = IsNatural<-1.1e-100> - type Ex9 = IsNatural<-1.1e100> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - type TestEx4 = Expect> - type TestEx5 = Expect> - type TestEx6 = Expect> - type TestEx7 = Expect> - type TestEx8 = Expect> - type TestEx9 = Expect> - }) -}) diff --git a/src/math/antecedent/is-natural.ts b/src/math/antecedent/is-natural.ts deleted file mode 100644 index b4d45b1f..00000000 --- a/src/math/antecedent/is-natural.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { And } from '~/logic/antecedent/and' -import type { IsInteger } from '~/math/antecedent/is-integer' -import type { IsNonNegative } from '~/math/antecedent/is-non-negative' - -/** - * If `A ∈ ℕ` then `true` else `false` - * @typeParam A - The number to check. - * @group Antecedent - * @group Math - * @example - * ``` - * type Ex1 = IsNatural<-1> // false - * type Ex2 = IsNatural<0> // true - * type Ex3 = IsNatural<1> // true - * type Ex4 = IsNatural<2.3> // false - * ``` - */ -export type IsNatural = And, IsInteger> diff --git a/src/math/antecedent/is-negative.spec.ts b/src/math/antecedent/is-negative.spec.ts index 9ea69f38..5333c44b 100644 --- a/src/math/antecedent/is-negative.spec.ts +++ b/src/math/antecedent/is-negative.spec.ts @@ -1,17 +1,29 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsNegative } from '~/math/antecedent/is-negative' +import type { Expect } from '~/helper/expect' +import type { IsNegative } from './is-negative' describe('IsNegative', () => { - it('should return true for negative numbers', () => { - type TestIsNegative = Expect, true>> + it('should return true for negative numbers and bigints', () => { + type Ex1 = IsNegative<-1> + type Ex2 = IsNegative<-1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return false for positive numbers', () => { - type TestIsNegative = Expect, false>> + it('should return false for positive numbers and bigints', () => { + type Ex1 = IsNegative<1> + type Ex2 = IsNegative<1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return false for 0', () => { - type TestIsNegative = Expect, false>> + it('should return false for zero', () => { + type Ex1 = IsNegative<0> + type Ex2 = IsNegative<0n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) }) diff --git a/src/math/antecedent/is-negative.ts b/src/math/antecedent/is-negative.ts index ef1fd832..82d1314b 100644 --- a/src/math/antecedent/is-negative.ts +++ b/src/math/antecedent/is-negative.ts @@ -1,15 +1,9 @@ -import type { IsExtension } from '~/extension/antecedent/is-extension' - /** - * If `A < 0` then `true` else `false` - * @typeParam A - The number to check. + * Determines whether a number or bigint is negative. + * + * @typeParam A - The type of the input value. * @group Antecedent * @group Math - * @example - * ``` - * type Ex1 = IsNegative<-1> // true - * type Ex2 = IsNegative<0> // false - * type Ex3 = IsNegative<1> // false - * ``` */ -export type IsNegative = IsExtension<`${A}`, `-${number}`> +export type IsNegative = + `${A}` extends `-${number | bigint}` ? true : false diff --git a/src/math/antecedent/is-non-negative.spec.ts b/src/math/antecedent/is-non-negative.spec.ts index 24d9b138..cf1c7634 100644 --- a/src/math/antecedent/is-non-negative.spec.ts +++ b/src/math/antecedent/is-non-negative.spec.ts @@ -1,17 +1,29 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsNonNegative } from '~/math/antecedent/is-non-negative' +import type { Expect } from '~/helper/expect' +import type { IsNonNegative } from './is-non-negative' describe('IsNonNegative', () => { - it('should return true for positive numbers', () => { - type TestIsNonNegative = Expect, true>> + it('should return true for zero', () => { + type Ex1 = IsNonNegative<0> + type Ex2 = IsNonNegative<0n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return false for negative numbers', () => { - type TestIsNonNegative = Expect, false>> + it('should return true for positive numbers and bigints', () => { + type Ex1 = IsNonNegative<1> + type Ex2 = IsNonNegative<1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return true for 0', () => { - type TestIsNonNegative = Expect, true>> + it('should return false for negative numbers and bigints', () => { + type Ex1 = IsNonNegative<-1> + type Ex2 = IsNonNegative<-1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) }) diff --git a/src/math/antecedent/is-non-negative.ts b/src/math/antecedent/is-non-negative.ts index 4d31115f..dcb2c942 100644 --- a/src/math/antecedent/is-non-negative.ts +++ b/src/math/antecedent/is-non-negative.ts @@ -1,16 +1,9 @@ -import type { Not } from '~/logic/antecedent/not' -import type { IsNegative } from '~/math/antecedent/is-negative' - /** - * If `A ≥ 0` then `true` else `false` - * @typeParam A - The number to check. + * Checks if a number or bigint is non-negative. + * + * @typeParam A - The type of the input value. * @group Antecedent * @group Math - * @example - * ``` - * type Ex1 = IsNonNegative<-1> // false - * type Ex2 = IsNonNegative<0> // true - * type Ex3 = IsNonNegative<1> // true - * ``` */ -export type IsNonNegative = Not> +export type IsNonNegative = + `${A}` extends `-${number | bigint}` ? false : true diff --git a/src/math/antecedent/is-non-positive.spec.ts b/src/math/antecedent/is-non-positive.spec.ts index 6d0c8efc..4a8e610a 100644 --- a/src/math/antecedent/is-non-positive.spec.ts +++ b/src/math/antecedent/is-non-positive.spec.ts @@ -1,17 +1,29 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsNonPositive } from '~/math/antecedent/is-non-positive' +import type { Expect } from '~/helper/expect' +import type { IsNonPositive } from './is-non-positive' describe('IsNonPositive', () => { - it('should return true for negative numbers', () => { - type TestIsNonPositive = Expect, true>> + it('should return true for negative numbers and bigints', () => { + type Ex1 = IsNonPositive<-1> + type Ex2 = IsNonPositive<-1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return true for 0', () => { - type TestIsNonPositiv = Expect, true>> + it('should return true for zero', () => { + type Ex1 = IsNonPositive<0> + type Ex2 = IsNonPositive<0n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return false for positive numbers', () => { - type TestIsNonPositiv = Expect, false>> + it('should return false for positive numbers and bigints', () => { + type Ex1 = IsNonPositive<1> + type Ex2 = IsNonPositive<1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) }) diff --git a/src/math/antecedent/is-non-positive.ts b/src/math/antecedent/is-non-positive.ts index ec27bd7b..0da7ba59 100644 --- a/src/math/antecedent/is-non-positive.ts +++ b/src/math/antecedent/is-non-positive.ts @@ -1,17 +1,4 @@ -import type { IsZero } from '~/identity/antecedent/is-num-add-identity' -import type { Or } from '~/logic/antecedent/or' -import type { IsNegative } from '~/math/antecedent/is-negative' +import type { IsZero } from './is-zero' -/** - * If `A ≤ 0` then `true` else `false` - * @typeParam A - The number to check. - * @group Antecedent - * @group Math - * @example - * ``` - * type Ex1 = IsNonPositive<-1> // true - * type Ex2 = IsNonPositive<0> // true - * type Ex3 = IsNonPositive<1> // false - * ``` - */ -export type IsNonPositive = Or, IsNegative> +export type IsNonPositive = + `${A}` extends `-${number | bigint}` ? true : IsZero diff --git a/src/math/antecedent/is-positive.spec.ts b/src/math/antecedent/is-positive.spec.ts index 86c7d9f8..b166949f 100644 --- a/src/math/antecedent/is-positive.spec.ts +++ b/src/math/antecedent/is-positive.spec.ts @@ -1,17 +1,29 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { IsPositive } from '~/math/antecedent/is-positive' +import type { Expect } from '~/helper/expect' +import type { IsPositive } from './is-positive' describe('IsPositive', () => { - it('should return true for positive numbers', () => { - type TestIsPositive = Expect, true>> + it('should return true for positive numbers and bigints', () => { + type Ex1 = IsPositive<1> + type Ex2 = IsPositive<1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return false for negative numbers', () => { - type TestIsPositive = Expect, false>> + it('should return false for negative numbers and bigints', () => { + type Ex1 = IsPositive<-1> + type Ex2 = IsPositive<-1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) - it('should return false for 0', () => { - type TestIsPositive = Expect, false>> + it('should return false for zero', () => { + type Ex1 = IsPositive<0> + type Ex2 = IsPositive<0n> + + type TestEx1 = Expect> + type TestEx2 = Expect> }) }) diff --git a/src/math/antecedent/is-positive.ts b/src/math/antecedent/is-positive.ts index c496b5f0..8b7101da 100644 --- a/src/math/antecedent/is-positive.ts +++ b/src/math/antecedent/is-positive.ts @@ -1,18 +1,8 @@ -import type { IsZero } from '~/identity/antecedent/is-num-add-identity' -import type { And } from '~/logic/antecedent/and' -import type { Not } from '~/logic/antecedent/not' -import type { IsNonNegative } from '~/math/antecedent/is-non-negative' +import type { IsZero } from './is-zero' -/** - * If `A > 0` then `true` else `false` - * @typeParam A - The number to check. - * @group Antecedent - * @group Math - * @example - * ``` - * type Ex1 = IsPositive<-1> // false - * type Ex2 = IsPositive<0> // false - * type Ex3 = IsPositive<1> // true - * ``` - */ -export type IsPositive = And>, IsNonNegative> +export type IsPositive = + IsZero extends true + ? false + : `${A}` extends `-${number | bigint}` + ? false + : true diff --git a/src/math/antecedent/is-zero.spec.ts b/src/math/antecedent/is-zero.spec.ts new file mode 100644 index 00000000..19fbce20 --- /dev/null +++ b/src/math/antecedent/is-zero.spec.ts @@ -0,0 +1,29 @@ +import type { IsEqual } from '~/extension/antecedent/is-equal' +import type { Expect } from '~/helper/expect' +import type { IsZero } from './is-zero' + +describe('IsZero', () => { + it('should return true for zero', () => { + type Ex1 = IsZero<0> + type Ex2 = IsZero<0n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + }) + + it('should return false for positive numbers and bigints', () => { + type Ex1 = IsZero<1> + type Ex2 = IsZero<1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + }) + + it('should return false for negative numbers and bigints', () => { + type Ex1 = IsZero<-1> + type Ex2 = IsZero<-1n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + }) +}) diff --git a/src/math/antecedent/is-zero.ts b/src/math/antecedent/is-zero.ts new file mode 100644 index 00000000..41d3fed1 --- /dev/null +++ b/src/math/antecedent/is-zero.ts @@ -0,0 +1,13 @@ +import type { BigIntAddIdentity } from '~/identity/bigint-add-identity' +import type { NumAddIdentity } from '~/identity/num-add-identity' + +export type Zeroish = NumAddIdentity | BigIntAddIdentity + +/** + * Determines whether a number or bigint is zero. + * + * @typeParam A - The type of the input value. + * @group Antecedent + * @group Math + */ +export type IsZero = A extends Zeroish ? true : false diff --git a/src/math/compare.ts b/src/math/compare.ts new file mode 100644 index 00000000..874c06df --- /dev/null +++ b/src/math/compare.ts @@ -0,0 +1,71 @@ +import type { + Digit, + DigitNumber, + Num, + Sign, + ToDigitNumber, + ToString, +} from './utils' + +export type CompareLength< + A extends any[], + B extends any[], +> = A['length'] extends B['length'] ? 1 : 0 + +export type DigitCompareTable = [ + [0, -1, -1, -1, -1, -1, -1, -1, -1, -1], + [1, 0, -1, -1, -1, -1, -1, -1, -1, -1], + [1, 1, 0, -1, -1, -1, -1, -1, -1, -1], + [1, 1, 1, 0, -1, -1, -1, -1, -1, -1], + [1, 1, 1, 1, 0, -1, -1, -1, -1, -1], + [1, 1, 1, 1, 1, 0, -1, -1, -1, -1], + [1, 1, 1, 1, 1, 1, 0, -1, -1, -1], + [1, 1, 1, 1, 1, 1, 1, 0, -1, -1], + [1, 1, 1, 1, 1, 1, 1, 1, 0, -1], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], +] + +export type DigitCompare< + A extends Digit, + B extends Digit, +> = DigitCompareTable[A][B] + +export type CompareDigitsWithEqualLength< + A extends Digit[], + B extends Digit[], +> = A extends [infer C extends Digit, ...infer D extends Digit[]] + ? B extends [infer E extends Digit, ...infer F extends Digit[]] + ? DigitCompare extends 0 + ? CompareDigitsWithEqualLength + : DigitCompare + : 0 + : 0 + +export type CompareDigits = + CompareLength extends 1 + ? CompareDigitsWithEqualLength + : keyof B extends keyof A + ? 1 + : -1 + +export type CompareDigitNumbers = + Sign extends Sign + ? Sign extends '' + ? CompareDigits, Num> + : CompareDigits, Num> + : Sign extends '-' + ? -1 + : 1 + +/** + * Compare two numbers + * @param A - First number + * @param B - Second number + * @returns 0 if A = B, 1 if A > B, -1 if A < B + */ +export type Compare< + A extends number | bigint, + B extends number | bigint, +> = A extends B + ? 0 + : CompareDigitNumbers>, ToDigitNumber>> diff --git a/src/math/decrement.spec.ts b/src/math/decrement.spec.ts index 970086f3..8fe916e9 100644 --- a/src/math/decrement.spec.ts +++ b/src/math/decrement.spec.ts @@ -1,13 +1,13 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Decrement } from '~/math/decrement' +import type { Expect } from '~/helper/expect' +import type { Decrement } from './decrement' describe('Decrement', () => { - it('should decrement a number', () => { - type Ex1 = Decrement<2> + it('should decrement a number by 1', () => { + type Ex1 = Decrement<0> type Ex2 = Decrement<1> - type TestEx1 = Expect> + type TestEx1 = Expect> type TestEx2 = Expect> }) }) diff --git a/src/math/decrement.ts b/src/math/decrement.ts index e00c677b..31346ee9 100644 --- a/src/math/decrement.ts +++ b/src/math/decrement.ts @@ -1,22 +1,8 @@ -import type { Zero } from '~/identity/num-add-identity' -import type { And } from '~/logic/antecedent/and' -import type { If } from '~/logic/if' -import type { IsGreaterThan } from '~/math/antecedent/is-greater-than' -import type { IsNatural } from '~/math/antecedent/is-natural' -import type { Subtract } from '~/math/subtract' +import type { Subtract } from './subtract' /** - * Evaluate `A - 1`, where `A > 0` and `A ∈ ℕ` - * @typeParam A - The number to decrement. - * @group Math - * @example - * ``` - * type Ex1 = Decrement<2> // 1 - * type Ex2 = Decrement<0> // number - * ``` + * Decrements a number or bigint by 1. + * + * @typeParam A - The input number or bigint. */ -export type Decrement = If< - And, IsGreaterThan>, - Subtract, - number -> +export type Decrement = Subtract diff --git a/src/math/digits/addition-digits.ts b/src/math/digits/addition-digits.ts new file mode 100644 index 00000000..a01e00c5 --- /dev/null +++ b/src/math/digits/addition-digits.ts @@ -0,0 +1,97 @@ +import type { Digit } from '../utils' + +type AddDigitTable = [ + [ + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + [1, 2, 3, 4, 5, 6, 7, 8, 9, 0], + [2, 3, 4, 5, 6, 7, 8, 9, 0, 1], + [3, 4, 5, 6, 7, 8, 9, 0, 1, 2], + [4, 5, 6, 7, 8, 9, 0, 1, 2, 3], + [5, 6, 7, 8, 9, 0, 1, 2, 3, 4], + [6, 7, 8, 9, 0, 1, 2, 3, 4, 5], + [7, 8, 9, 0, 1, 2, 3, 4, 5, 6], + [8, 9, 0, 1, 2, 3, 4, 5, 6, 7], + [9, 0, 1, 2, 3, 4, 5, 6, 7, 8], + ], + [ + [1, 2, 3, 4, 5, 6, 7, 8, 9, 0], + [2, 3, 4, 5, 6, 7, 8, 9, 0, 1], + [3, 4, 5, 6, 7, 8, 9, 0, 1, 2], + [4, 5, 6, 7, 8, 9, 0, 1, 2, 3], + [5, 6, 7, 8, 9, 0, 1, 2, 3, 4], + [6, 7, 8, 9, 0, 1, 2, 3, 4, 5], + [7, 8, 9, 0, 1, 2, 3, 4, 5, 6], + [8, 9, 0, 1, 2, 3, 4, 5, 6, 7], + [9, 0, 1, 2, 3, 4, 5, 6, 7, 8], + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + ], +] + +type AddDigitCarryTable = [ + [ + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 1, 1, 1, 1, 1, 1, 1, 1, 1], + ], + [ + [0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + ], +] + +type AddDigit< + A extends Digit, + B extends Digit, + Carry extends 0 | 1 = 0, +> = AddDigitTable[Carry][A][B] + +type AddCarryDigit< + A extends Digit, + B extends Digit, + Carry extends 0 | 1 = 0, +> = AddDigitCarryTable[Carry][A][B] + +export type AddDigits< + A extends Digit[], + B extends Digit[], + Carry extends 0 | 1 = 0, + Acc extends Digit[] = [], +> = A extends [...infer C extends Digit[], infer D extends Digit] + ? B extends [...infer E extends Digit[], infer F extends Digit] + ? AddDigits< + C, + E, + AddCarryDigit, + [AddDigit, ...Acc] + > + : AddDigits< + C, + [], + AddCarryDigit, + [AddDigit, ...Acc] + > + : B extends [...infer G extends Digit[], infer H extends Digit] + ? AddDigits< + [], + G, + AddCarryDigit<0, H, Carry>, + [AddDigit<0, H, Carry>, ...Acc] + > + : Carry extends 1 + ? [1, ...Acc] + : Acc diff --git a/src/math/digits/division-digits.ts b/src/math/digits/division-digits.ts new file mode 100644 index 00000000..f56859b0 --- /dev/null +++ b/src/math/digits/division-digits.ts @@ -0,0 +1,75 @@ +import type { CompareDigits } from '../compare' +import type { Digit, Digits, TrimZeros } from '../utils' +import type { AddDigits } from './addition-digits' +import type { SubDigits } from './substraction-digits' + +export type Rest = A extends [ + Digit, + ...infer B extends Digit[], +] + ? B + : never + +type TruncateWith< + A extends Digit[], + B extends Digit[], + Acc extends Digit[] = [], +> = B extends [] + ? [A, Acc] + : A extends [infer C extends Digit, ...infer D extends Digit[]] + ? TruncateWith, [...Acc, C]> + : [A, Acc] + +type DivModByDigit< + A extends Digit[], + B extends Digit[], + Mul extends Digit[] = [0], + IterTable extends Digit[] = Digits, + NextMul extends Digit[] = AddDigits, + Comp = CompareDigits, +> = IterTable extends [ + infer Iteration extends Digit, + ...infer Next extends Digit[], +] + ? Comp extends 0 + ? { Quotient: Next[0]; Remainder: [0] } + : Comp extends 1 + ? DivModByDigit + : { + Quotient: Iteration + Remainder: SubDigits + } + : never + +/** + * compute the long division of a number by a divisor + * @param A the Numerator Cut after M digits + * @param B the Numerator Cut with M first digits + * @param C the Divisor + * @param D the Quotient + * @see https://en.wikipedia.org/wiki/Long_division#Algorithm_for_arbitrary_base + */ +export type DivModDigits< + A extends Digit[], + B extends Digit[], + C extends Digit[], + D extends Digit[] = [], +> = + DivModByDigit extends { + Quotient: infer E extends Digit + Remainder: infer F extends Digit[] + } + ? A extends [infer G extends Digit, ...infer H extends Digit[]] + ? DivModDigits, C, [...D, E]> + : { Quotient: [...D, E]; Remainder: F } + : never + +export type DivDigits = + TruncateWith extends [infer C extends Digit[], infer D extends Digit[]] + ? DivModDigits['Quotient'] + : never + +export type ModDigits = + TruncateWith extends [infer C extends Digit[], infer D extends Digit[]] + ? DivModDigits['Remainder'] + : never diff --git a/src/math/digits/multiply-digits.ts b/src/math/digits/multiply-digits.ts new file mode 100644 index 00000000..22965cf9 --- /dev/null +++ b/src/math/digits/multiply-digits.ts @@ -0,0 +1,41 @@ +import type { Digit } from '../utils' +import type { AddDigits } from './addition-digits' +import type { SubDigits } from './substraction-digits' + +export type MulX2 = AddDigits +export type MulX3 = AddDigits> +export type MulX4 = MulX2> +export type MulX5 = AddDigits> +export type MulX6 = MulX2> +export type MulX7 = SubDigits, MulX3> +export type MulX8 = SubDigits, MulX2> +export type MulX9 = SubDigits, A> +export type MulX10 = [...A, 0] + +export type MulByDigit = B extends 0 + ? [0] + : B extends 1 + ? A + : B extends 2 + ? MulX2 + : B extends 3 + ? MulX3 + : B extends 4 + ? MulX4 + : B extends 5 + ? MulX5 + : B extends 6 + ? MulX6 + : B extends 7 + ? MulX7 + : B extends 8 + ? MulX8 + : MulX9 + +export type MulDigits< + A extends Digit[], + B extends Digit[], + Acc extends Digit[] = [], +> = B extends [infer N extends Digit, ...infer R extends Digit[]] + ? MulDigits, MulX10>> + : Acc diff --git a/src/math/digits/power-digits.ts b/src/math/digits/power-digits.ts new file mode 100644 index 00000000..9f30657e --- /dev/null +++ b/src/math/digits/power-digits.ts @@ -0,0 +1,22 @@ +import type { Digit, TrimZeros } from '../utils' +import type { DivModDigits } from './division-digits' +import type { MulDigits } from './multiply-digits' + +export type PowerDigits< + A extends Digit[], + B extends Digit[], + Acc extends Digit[] = [1], +> = B extends [0] + ? [1] + : B extends [1] + ? MulDigits + : B extends [infer C extends Digit, ...infer D extends Digit[]] + ? DivModDigits extends { + Quotient: infer E extends Digit[] + Remainder: infer F extends Digit[] + } + ? TrimZeros extends [0] + ? PowerDigits, TrimZeros, Acc> + : PowerDigits, TrimZeros, MulDigits> + : never + : Acc diff --git a/src/math/digits/substraction-digits.ts b/src/math/digits/substraction-digits.ts new file mode 100644 index 00000000..947410a6 --- /dev/null +++ b/src/math/digits/substraction-digits.ts @@ -0,0 +1,97 @@ +import type { Digit } from '../utils' + +type SubDigitTable = [ + [ + [0, 9, 8, 7, 6, 5, 4, 3, 2, 1], + [1, 0, 9, 8, 7, 6, 5, 4, 3, 2], + [2, 1, 0, 9, 8, 7, 6, 5, 4, 3], + [3, 2, 1, 0, 9, 8, 7, 6, 5, 4], + [4, 3, 2, 1, 0, 9, 8, 7, 6, 5], + [5, 4, 3, 2, 1, 0, 9, 8, 7, 6], + [6, 5, 4, 3, 2, 1, 0, 9, 8, 7], + [7, 6, 5, 4, 3, 2, 1, 0, 9, 8], + [8, 7, 6, 5, 4, 3, 2, 1, 0, 9], + [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], + ], + [ + [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], + [0, 9, 8, 7, 6, 5, 4, 3, 2, 1], + [1, 0, 9, 8, 7, 6, 5, 4, 3, 2], + [2, 1, 0, 9, 8, 7, 6, 5, 4, 3], + [3, 2, 1, 0, 9, 8, 7, 6, 5, 4], + [4, 3, 2, 1, 0, 9, 8, 7, 6, 5], + [5, 4, 3, 2, 1, 0, 9, 8, 7, 6], + [6, 5, 4, 3, 2, 1, 0, 9, 8, 7], + [7, 6, 5, 4, 3, 2, 1, 0, 9, 8], + [8, 7, 6, 5, 4, 3, 2, 1, 0, 9], + ], +] + +type SubDigitCarryTable = [ + [ + [0, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ], + [ + [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 1, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 1, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 1, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 1, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 1], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + ], +] + +type SubDigit< + A extends Digit, + B extends Digit, + Carry extends 0 | 1 = 0, +> = SubDigitTable[Carry][A][B] + +type SubCarryDigit< + A extends Digit, + B extends Digit, + Carry extends 0 | 1 = 0, +> = SubDigitCarryTable[Carry][A][B] + +export type SubDigits< + A extends Digit[], + B extends Digit[], + Carry extends 0 | 1 = 0, + Acc extends Digit[] = [], +> = A extends [...infer C extends Digit[], infer D extends Digit] + ? B extends [...infer E extends Digit[], infer F extends Digit] + ? SubDigits< + C, + E, + SubCarryDigit, + [SubDigit, ...Acc] + > + : SubDigits< + C, + [], + SubCarryDigit, + [SubDigit, ...Acc] + > + : B extends [...infer G extends Digit[], infer H extends Digit] + ? SubDigits< + [], + G, + SubCarryDigit<0, H, Carry>, + [SubDigit<0, H, Carry>, ...Acc] + > + : Carry extends 1 + ? [...Acc, 9] + : Acc diff --git a/src/math/divide.spec.ts b/src/math/divide.spec.ts index 6cc5b399..6d4800b2 100644 --- a/src/math/divide.spec.ts +++ b/src/math/divide.spec.ts @@ -1,13 +1,17 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Divide } from '~/math/divide' +import type { Expect } from '~/helper/expect' +import type { Divide } from './divide' -describe('Divide', () => { +describe('divide', () => { it('should divide two numbers', () => { - type Ex1 = Divide<4, 2> - type Ex2 = Divide<6, 3> + type Ex1 = Divide<9, 3> + type Ex2 = Divide<11, 3> + type Ex3 = Divide<9n, 3n> + type Ex4 = Divide<11n, 3n> - type TestEx1 = Expect> - type TestEx2 = Expect> + type TestEx1 = Expect> + type TestEx2 = Expect> + type TestEx3 = Expect> + type TestEx4 = Expect> }) }) diff --git a/src/math/divide.ts b/src/math/divide.ts index d1098d2d..eaa170fc 100644 --- a/src/math/divide.ts +++ b/src/math/divide.ts @@ -1,22 +1,35 @@ -import type { HelperMultiSub } from '~/helper/multi-sub' -import type { And } from '~/logic/antecedent/and' -import type { If } from '~/logic/if' -import type { IsNatural } from '~/math/antecedent/is-natural' +import type { DivDigits } from './digits/division-digits' +import type { + DigitNumber, + FromDigitNumber, + MakeDigitNumber, + MulSign, + Normalize, + Num, + Sign, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' + +export type DivDigitNumbers< + A extends DigitNumber, + B extends DigitNumber, +> = MakeDigitNumber, Sign>, DivDigits, Num>> /** - * Evaluate `A / B`, where `A ∈ ℕ` and `B ∈ ℕ`. - * @typeParam A - The dividend (must be a natural number). - * @typeParam B - The divisor (must be a natural number). - * @group Math - * @example - * ``` - * type Ex1 = Divide<9, 3> // 3 - * // NOTE only natural numbers are supported for output - * type Ex2 = Divide<11, 3> // 3 - * ``` + * Divides two numbers or bigints. + * + * @typeParam A - The type of the dividend. + * @typeParam B - The type of the divisor. */ -export type Divide = If< - And, IsNatural>, - HelperMultiSub, - number +export type Divide< + A extends number | bigint, + B extends number | bigint, +> = ToNumber< + FromDigitNumber< + Normalize< + DivDigitNumbers>, ToDigitNumber>> + > + > > diff --git a/src/math/increment.spec.ts b/src/math/increment.spec.ts index 4a09dde6..c3cadc34 100644 --- a/src/math/increment.spec.ts +++ b/src/math/increment.spec.ts @@ -1,9 +1,9 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Increment } from '~/math/increment' +import type { Expect } from '~/helper/expect' +import type { Increment } from './increment' describe('Increment', () => { - it('should increment a number', () => { + it('should increment a number by 1', () => { type Ex1 = Increment<0> type Ex2 = Increment<1> diff --git a/src/math/increment.ts b/src/math/increment.ts index dbde1dc2..47961661 100644 --- a/src/math/increment.ts +++ b/src/math/increment.ts @@ -1,16 +1,14 @@ -import type { One } from '~/identity/num-mult-identity' -import type { If } from '~/logic/if' -import type { Add } from '~/math/add' -import type { IsNatural } from '~/math/antecedent/is-natural' +import type { Add } from './add' /** - * Evaluate `A + 1`, where `A ∈ ℕ`. - * @typeParam A - The number to increment (must be a natural number). + * Increments a number or bigint by 1. + * + * @typeParam A - The input number or bigint. * @group Math * @example * ``` - * type Ex1 = Increment<1> // 3 - * type Ex2 = Increment<0> // 2 + * type Ex1 = Increment<0> // 1 + * type Ex2 = Increment<1n> // 2 * ``` */ -export type Increment = If, Add, number> +export type Increment = Add diff --git a/src/math/index.ts b/src/math/index.ts index 31b4ed87..014936f2 100644 --- a/src/math/index.ts +++ b/src/math/index.ts @@ -1,11 +1,11 @@ export * from './absolute' export * from './add' export * from './antecedent' +export * from './compare' export * from './decrement' export * from './divide' export * from './increment' -export * from './max' -export * from './min' -export * from './modulo' export * from './multiply' +export * from './negate' +export * from './power' export * from './subtract' diff --git a/src/math/max.spec.ts b/src/math/max.spec.ts deleted file mode 100644 index 19debb50..00000000 --- a/src/math/max.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Max } from '~/math/max' - -describe('Max', () => { - it('should return the larger of two numbers', () => { - type Ex1 = Max<1, 2> - type Ex2 = Max<2, 1> - - type TestEx1 = Expect> - type TestEx2 = Expect> - }) -}) diff --git a/src/math/max.ts b/src/math/max.ts deleted file mode 100644 index 43badcb7..00000000 --- a/src/math/max.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { If } from '~/logic/if' -import type { IsLessThan } from '~/math/antecedent/is-less-than' - -/** - * Returns the maximum value between two numbers, where `A ∈ ℕ` and `B ∈ ℕ`. - * @typeParam A - The first number (must be a natural number). - * @typeParam B - The second number (must be a natural number). - * @group Math - * @example - * ``` - * type Ex1 = Max<1, 3> // 3 - * type Ex2 = Max<3, 1> // 3 - * ``` - */ -export type Max = If, B, A> diff --git a/src/math/min.spec.ts b/src/math/min.spec.ts deleted file mode 100644 index 47666b97..00000000 --- a/src/math/min.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Min } from '~/math/min' - -describe('Min', () => { - it('should return the minimum of two numbers', () => { - type Ex1 = Min<1, 2> - type Ex2 = Min<2, 1> - - type TestEx1 = Expect> - type TestEx2 = Expect> - }) -}) diff --git a/src/math/min.ts b/src/math/min.ts deleted file mode 100644 index 0a8a282a..00000000 --- a/src/math/min.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { If } from '~/logic/if' -import type { IsLessThan } from '~/math/antecedent/is-less-than' - -/** - * Returns the minimum value between two numbers, where `A ∈ ℕ` and `B ∈ ℕ`. - * @typeParam A - The first number (must be a natural number). - * @typeParam B - The second number (must be a natural number). - * @group Math - * @example - * ``` - * type Ex1 = Min<1, 3> // 1 - * type Ex2 = Min<3, 1> // 1 - * ``` - */ -export type Min = If, A, B> diff --git a/src/math/mod.spec.ts b/src/math/mod.spec.ts new file mode 100644 index 00000000..a1309713 --- /dev/null +++ b/src/math/mod.spec.ts @@ -0,0 +1,13 @@ +import type { IsEqual } from '~/extension/antecedent/is-equal' +import type { Expect } from '~/helper/expect' +import type { Mod } from './mod' + +describe('mod', () => { + it('should return the remainder of a division', () => { + type Ex1 = Mod<10, 3> + type Ex2 = Mod<10n, 3n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + }) +}) diff --git a/src/math/mod.ts b/src/math/mod.ts new file mode 100644 index 00000000..b0f62b0b --- /dev/null +++ b/src/math/mod.ts @@ -0,0 +1,34 @@ +import type { ModDigits } from './digits/division-digits' +import type { + DigitNumber, + FromDigitNumber, + MakeDigitNumber, + Normalize, + Num, + Sign, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' + +export type ModDigitNumbers< + A extends DigitNumber, + B extends DigitNumber, +> = MakeDigitNumber, ModDigits, Num>> + +/** + * Calculates the modulus of two numbers or bigints. + * + * @typeParam A - The type of the dividend. + * @typeParam B - The type of the divisor. + */ +export type Mod< + A extends number | bigint, + B extends number | bigint, +> = ToNumber< + FromDigitNumber< + Normalize< + ModDigitNumbers>, ToDigitNumber>> + > + > +> diff --git a/src/math/modulo.spec.ts b/src/math/modulo.spec.ts deleted file mode 100644 index 82920561..00000000 --- a/src/math/modulo.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Modulo } from '~/math/modulo' - -describe('Modulo', () => { - it('should return the remainder of a division', () => { - type Ex1 = Modulo<5, 2> - type Ex2 = Modulo<10, 3> - type Ex3 = Modulo<10, 5> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - }) -}) diff --git a/src/math/modulo.ts b/src/math/modulo.ts deleted file mode 100644 index 6cffb78c..00000000 --- a/src/math/modulo.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { And } from '~/logic/antecedent/and' -import type { If } from '~/logic/if' -import type { IsLessThan } from '~/math/antecedent/is-less-than' -import type { IsNatural } from '~/math/antecedent/is-natural' -import type { Subtract } from '~/math/subtract' - -/** - * Evaluate `A % B`, where `A ∈ ℕ` and `B ∈ ℕ`. - * @typeParam A - The dividend (must be a natural number). - * @typeParam B - The divisor (must be a natural number). - * @group Math - * @example - * ``` - * type Ex1 = Modulo<3, 2> // 1 - * type Ex2 = Modulo<4, 2> // 0 - * ``` - */ -export type Modulo = If< - And, IsNatural>, - IsLessThan extends true ? A : Modulo, B>, - number -> diff --git a/src/math/multiply.spec.ts b/src/math/multiply.spec.ts index a238ca7d..e69de29b 100644 --- a/src/math/multiply.spec.ts +++ b/src/math/multiply.spec.ts @@ -1,13 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Multiply } from '~/math/multiply' - -describe('Multiply', () => { - it('should multiply two numbers', () => { - type Ex1 = Multiply<1, 2> - type Ex2 = Multiply<2, 3> - - type TestEx1 = Expect> - type TestEx2 = Expect> - }) -}) diff --git a/src/math/multiply.ts b/src/math/multiply.ts index 35029d9c..629f8316 100644 --- a/src/math/multiply.ts +++ b/src/math/multiply.ts @@ -1,22 +1,35 @@ -import type { HelperMultiAdd } from '~/helper/multi-add' -import type { And } from '~/logic/antecedent/and' -import type { If } from '~/logic/if' -import type { IsNatural } from '~/math/antecedent/is-natural' +import type { MulDigits } from './digits/multiply-digits' +import type { + DigitNumber, + FromDigitNumber, + MakeDigitNumber, + MulSign, + Normalize, + Num, + Sign, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' + +export type MulDigitNumbers< + A extends DigitNumber, + B extends DigitNumber, +> = MakeDigitNumber, Sign>, MulDigits, Num>> /** - * Return the product of `A * B`, where `A ∈ ℕ` and `B ∈ ℕ`. - * @typeParam A - The first number (must be a natural number). - * @typeParam B - The second number (must be a natural number). - * @group Math - * @example - * ``` - * type Ex0 = Multiply<0, 0> // 0 - * type Ex1 = Multiply<2, 3> // 6 - * type Ex2 = Multiply<5, 5> // 25 - * ``` - * */ -export type Multiply = If< - And, IsNatural>, - HelperMultiAdd, - number + * Multiplies two numbers or bigints. + * + * @typeParam A - The first number or bigint. + * @typeParam B - The second number or bigint. + */ +export type Multiply< + A extends number | bigint, + B extends number | bigint, +> = ToNumber< + FromDigitNumber< + Normalize< + MulDigitNumbers>, ToDigitNumber>> + > + > > diff --git a/src/math/negate.spec.ts b/src/math/negate.spec.ts new file mode 100644 index 00000000..36a1f0d9 --- /dev/null +++ b/src/math/negate.spec.ts @@ -0,0 +1,29 @@ +import type { IsEqual } from '~/extension/antecedent/is-equal' +import type { Expect } from '~/helper/expect' +import type { Negate } from './negate' + +describe('negate', () => { + it('should negate a positive number', () => { + type Ex1 = Negate<42> + type Ex2 = Negate<42n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + }) + + it('should negate a negative number', () => { + type Ex1 = Negate<-42> + type Ex2 = Negate<-42n> + + type TestEx1 = Expect> + type TestEx2 = Expect> + }) + + it('should negate zero', () => { + type Ex1 = Negate<0> + type Ex2 = Negate<0n> + + type TestEx = Expect> + type TestEx2 = Expect> + }) +}) diff --git a/src/math/negate.ts b/src/math/negate.ts new file mode 100644 index 00000000..79f83616 --- /dev/null +++ b/src/math/negate.ts @@ -0,0 +1,23 @@ +import type { + FromDigitNumber, + Normalize, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' + +/** + * Negates a number or bigint. + * If the input is positive, it returns the negative value. + * If the input is negative, it returns the positive value. + * If the input is zero, it returns zero. + * + * @typeParam A - The input number or bigint. + */ +export type Negate = A extends 0 | 0n + ? ToNumber>>>> + : `${A}` extends `-${infer B extends number | bigint}` + ? B + : `-${A}` extends `${infer C extends number | bigint}` + ? C + : never diff --git a/src/math/power.spec.ts b/src/math/power.spec.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/math/power.ts b/src/math/power.ts new file mode 100644 index 00000000..4cbac447 --- /dev/null +++ b/src/math/power.ts @@ -0,0 +1,41 @@ +import type { PowerDigits } from './digits/power-digits' +import type { + Digit, + DigitNumber, + FromDigitNumber, + MakeDigitNumber, + Normalize, + Num, + Sign, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' + +type PowerSign = A extends '-' + ? Num extends [...Digit[], 0 | 2 | 4 | 6 | 8] + ? '' + : '-' + : '' + +export type PowerDigitNumbers = + Sign extends '-' + ? MakeDigitNumber, [0]> + : MakeDigitNumber, B>, PowerDigits, Num>> + +/** + * Calculates the power of two numbers. + * + * @typeParam A - The base number. + * @typeParam B - The exponent number. + */ +export type Power< + A extends number | bigint, + B extends number | bigint, +> = ToNumber< + FromDigitNumber< + Normalize< + PowerDigitNumbers>, ToDigitNumber>> + > + > +> diff --git a/src/math/subtract.spec.ts b/src/math/subtract.spec.ts index a10c9275..0213cd20 100644 --- a/src/math/subtract.spec.ts +++ b/src/math/subtract.spec.ts @@ -1,13 +1,13 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { Subtract } from '~/math/subtract' +import type { Expect } from '~/helper/expect' +import type { Subtract } from './subtract' -describe('Subtract', () => { - it('should subtract two numbers', () => { - type Ex1 = Subtract<3, 2> - type Ex2 = Subtract<5, 3> +describe('subtraction', () => { + it('should subtract two positive numbers', () => { + type Ex1 = Subtract<42, 21> + type Ex2 = Subtract<42n, 21n> - type TestEx1 = Expect> - type TestEx2 = Expect> + type TestEx1 = Expect> + type TestEx2 = Expect> }) }) diff --git a/src/math/subtract.ts b/src/math/subtract.ts index b457f764..13ec4e54 100644 --- a/src/math/subtract.ts +++ b/src/math/subtract.ts @@ -1,22 +1,33 @@ -import type { And } from '~/logic/antecedent/and' -import type { If } from '~/logic/if' -import type { IsNatural } from '~/math/antecedent/is-natural' -import type { LengthProp } from '~/object/length-prop' -import type { Tuple } from '~/tuple/tuple' +import type { CompareDigits } from './compare' +import type { AddDigits } from './digits/addition-digits' +import type { SubDigits } from './digits/substraction-digits' +import type { + DigitNumber, + FromDigitNumber, + InvertSign, + MakeDigitNumber, + Normalize, + Num, + Sign, + ToDigitNumber, + ToNumber, + ToString, +} from './utils' -/** - * Return the difference of `A - B`, where `A ∈ ℕ` and `B ∈ ℕ`. - * @typeParam A - The first number (must be a natural number). - * @typeParam B - The second number (must be a natural number). - * @group Math - * @example - * ``` - * type Ex1 = Subtract<10, 5> // 5 - * type Ex2 = Subtract<20, 13> // 7 - * ``` - */ -export type Subtract = If< - And, IsNatural>, - Tuple extends [...infer C, ...Tuple] ? LengthProp : number, - number +type SubDigitNumbers = + Sign extends Sign + ? CompareDigits, Num> extends 1 + ? MakeDigitNumber, SubDigits, Num>> + : MakeDigitNumber, SubDigits, Num>> + : MakeDigitNumber, AddDigits, Num>> + +export type Subtract< + A extends number | bigint, + B extends number | bigint, +> = ToNumber< + FromDigitNumber< + Normalize< + SubDigitNumbers>, ToDigitNumber>> + > + > > diff --git a/src/math/utils.ts b/src/math/utils.ts new file mode 100644 index 00000000..f2682c3e --- /dev/null +++ b/src/math/utils.ts @@ -0,0 +1,63 @@ +export type ToNumber = T extends `${infer N extends + | number + | bigint}` + ? N + : never + +export type ToString = `${T}` + +export type Digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +export type Digit = Digits[number] + +export type DigitNumber = { sign: '-' | ''; num: Digit[] } +export type MakeDigitNumber = { + sign: S + num: N +} + +export type ToDigits< + T extends string, + Acc extends Digit[] = [], +> = T extends `${infer N extends Digit}${infer R}` + ? ToDigits + : Acc + +export type ToDigitNumber = T extends `-${infer R}` + ? { sign: '-'; num: ToDigits } + : { sign: ''; num: ToDigits } + +export type FromDigits = T extends [ + infer N extends Digit, + ...infer R, +] + ? FromDigits + : Acc + +export type Sign = T['sign'] +export type InvertSign = Sign extends '-' ? '' : '-' +export type MulSign = S1 extends '-' + ? S2 extends '-' + ? '' + : '-' + : S2 extends '-' + ? '-' + : '' + +export type Num = T['num'] + +export type FromDigitNumber = `${Sign}${FromDigits< + Num +>}` + +export type TrimZeros = T extends [0] + ? [0] + : T extends [0, ...infer R extends Digit[]] + ? TrimZeros + : T + +export type Normalize< + T extends DigitNumber, + Trim extends Digit[] = TrimZeros>, +> = Trim extends [0] + ? MakeDigitNumber<'', Trim> + : MakeDigitNumber, Trim> diff --git a/src/object/antecedent/is-key-of.spec.ts b/src/object/antecedent/is-key-of.spec.ts index 3066ed91..07cc5f93 100644 --- a/src/object/antecedent/is-key-of.spec.ts +++ b/src/object/antecedent/is-key-of.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsKeyOf } from '~/object/antecedent/is-key-of' describe('IsKeyOf', () => { diff --git a/src/object/antecedent/is-object.spec.ts b/src/object/antecedent/is-object.spec.ts index da7c0b42..bb35eeb9 100644 --- a/src/object/antecedent/is-object.spec.ts +++ b/src/object/antecedent/is-object.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsObject } from '~/object/antecedent/is-object' describe('IsObject', () => { diff --git a/src/object/get-path-value.spec.ts b/src/object/get-path-value.spec.ts index 76f9a533..072f16f4 100644 --- a/src/object/get-path-value.spec.ts +++ b/src/object/get-path-value.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { GetPathValue } from '~/object/get-path-value' describe('GetPathValue', () => { diff --git a/src/object/get-paths.spec.ts b/src/object/get-paths.spec.ts index fb82f744..b4f64041 100644 --- a/src/object/get-paths.spec.ts +++ b/src/object/get-paths.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { GetPaths } from '~/object/get-paths' describe('GetPaths', () => { diff --git a/src/object/length-prop.spec.ts b/src/object/length-prop.spec.ts index c7486129..1db792c4 100644 --- a/src/object/length-prop.spec.ts +++ b/src/object/length-prop.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { LengthProp } from '~/object/length-prop' describe('LengthProp', () => { diff --git a/src/object/object-length.spec.ts b/src/object/object-length.spec.ts index 443296b2..dd758251 100644 --- a/src/object/object-length.spec.ts +++ b/src/object/object-length.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { ObjectLength } from '~/object/object-length' describe('ObjectLength', () => { diff --git a/src/object/object-length.ts b/src/object/object-length.ts index 197a240f..03a9df1c 100644 --- a/src/object/object-length.ts +++ b/src/object/object-length.ts @@ -1,4 +1,4 @@ -import type { HelperUnionUniqueLength } from '~/helper/union-unique-length' +import type { UnionUniqueLength } from '~/helper/union-unique-length' import type { IsLiteralKey } from '~/literal/antecedent/is-literal-key' /** @@ -13,4 +13,4 @@ import type { IsLiteralKey } from '~/literal/antecedent/is-literal-key' * ``` */ export type ObjectLength = - IsLiteralKey extends true ? HelperUnionUniqueLength : number + IsLiteralKey extends true ? UnionUniqueLength : number diff --git a/src/object/override.spec.ts b/src/object/override.spec.ts index 29189518..ac0499fc 100644 --- a/src/object/override.spec.ts +++ b/src/object/override.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Override } from '~/object/override' describe('Override', () => { diff --git a/src/peg/one-or-more.ts b/src/peg/one-or-more.ts index 38a49c68..50ccdb50 100644 --- a/src/peg/one-or-more.ts +++ b/src/peg/one-or-more.ts @@ -1,5 +1,5 @@ -import type { IsZero } from '~/identity/antecedent/is-num-add-identity' import type { If } from '~/logic/if' +import type { IsZero } from '~/math/antecedent/is-zero' import type { Increment } from '~/math/increment' export interface OneOrMoreOpts { diff --git a/src/string/antecedent/ends-with.spec.ts b/src/string/antecedent/ends-with.spec.ts index cd6f31b9..87d23a3c 100644 --- a/src/string/antecedent/ends-with.spec.ts +++ b/src/string/antecedent/ends-with.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { EndsWith } from '~/string/antecedent/ends-with' describe('EndsWith', () => { diff --git a/src/string/antecedent/has-capture-group.spec.ts b/src/string/antecedent/has-capture-group.spec.ts index 0e72714e..4f36f3e3 100644 --- a/src/string/antecedent/has-capture-group.spec.ts +++ b/src/string/antecedent/has-capture-group.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { HasCaptureGroup } from '~/string/antecedent/has-capture-group' describe('HasCaptureGroup', () => { diff --git a/src/string/antecedent/has-capture-group.ts b/src/string/antecedent/has-capture-group.ts index d36c8ebc..5bb08fb5 100644 --- a/src/string/antecedent/has-capture-group.ts +++ b/src/string/antecedent/has-capture-group.ts @@ -1,5 +1,5 @@ import type { IsExtension } from '~/extension/antecedent/is-extension' -import type { HelperCaptureGroup } from '~/helper/capture-group' +import type { CaptureGroup } from '~/helper/capture-group' /** * Evaluate if `A` has a matches CaptureGroup `B` @@ -16,5 +16,5 @@ import type { HelperCaptureGroup } from '~/helper/capture-group' */ export type HasCaptureGroup< A extends string, - B extends HelperCaptureGroup = HelperCaptureGroup<'{{', '}}'>, + B extends CaptureGroup = CaptureGroup<'{{', '}}'>, > = IsExtension diff --git a/src/string/antecedent/includes.spec.ts b/src/string/antecedent/includes.spec.ts index 0b95f822..2b74ebb3 100644 --- a/src/string/antecedent/includes.spec.ts +++ b/src/string/antecedent/includes.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Includes } from '~/string/antecedent/includes' describe('Includes', () => { diff --git a/src/string/antecedent/is-alphabetic.spec.ts b/src/string/antecedent/is-alphabetic.spec.ts index 5234f2e4..373ce27c 100644 --- a/src/string/antecedent/is-alphabetic.spec.ts +++ b/src/string/antecedent/is-alphabetic.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsAlphabetic } from '~/string/antecedent/is-alphabetic' describe('IsAlphabetic', () => { diff --git a/src/string/antecedent/is-camel-case.spec.ts b/src/string/antecedent/is-camel-case.spec.ts index 77c6ff59..d216386e 100644 --- a/src/string/antecedent/is-camel-case.spec.ts +++ b/src/string/antecedent/is-camel-case.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsCamelCase } from '~/string/antecedent/is-camel-case' describe('IsCamelCase', () => { diff --git a/src/string/antecedent/is-capitalized.spec.ts b/src/string/antecedent/is-capitalized.spec.ts index 8015353c..4ef068a7 100644 --- a/src/string/antecedent/is-capitalized.spec.ts +++ b/src/string/antecedent/is-capitalized.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsCapitalized } from '~/string/antecedent/is-capitalized' describe('IsCapitalized', () => { diff --git a/src/string/antecedent/is-kebab-case.spec.ts b/src/string/antecedent/is-kebab-case.spec.ts index 11912bbd..c2656f5b 100644 --- a/src/string/antecedent/is-kebab-case.spec.ts +++ b/src/string/antecedent/is-kebab-case.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsKebabCase } from '~/string/antecedent/is-kebab-case' describe('IsKebabCase', () => { diff --git a/src/string/antecedent/is-lower-case.spec.ts b/src/string/antecedent/is-lower-case.spec.ts index 07caea27..7447cfd5 100644 --- a/src/string/antecedent/is-lower-case.spec.ts +++ b/src/string/antecedent/is-lower-case.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsLowerCase } from '~/string/antecedent/is-lower-case' describe('IsLowerCase', () => { diff --git a/src/string/antecedent/is-numeric.spec.ts b/src/string/antecedent/is-numeric.spec.ts index 0fd0d852..f9da9290 100644 --- a/src/string/antecedent/is-numeric.spec.ts +++ b/src/string/antecedent/is-numeric.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsNumeric } from '~/string/antecedent/is-numeric' describe('IsNumeric', () => { diff --git a/src/string/antecedent/is-snake-case.spec.ts b/src/string/antecedent/is-snake-case.spec.ts index b7fee41a..8c4e1d16 100644 --- a/src/string/antecedent/is-snake-case.spec.ts +++ b/src/string/antecedent/is-snake-case.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsSnakeCase } from '~/string/antecedent/is-snake-case' describe('IsSnakeCase', () => { diff --git a/src/string/antecedent/is-upper-case.spec.ts b/src/string/antecedent/is-upper-case.spec.ts index 7f3359f3..1775c336 100644 --- a/src/string/antecedent/is-upper-case.spec.ts +++ b/src/string/antecedent/is-upper-case.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsUpperCase } from '~/string/antecedent/is-upper-case' describe('IsUpperCase', () => { diff --git a/src/string/antecedent/starts-with.spec.ts b/src/string/antecedent/starts-with.spec.ts index 38ed1d08..1ba3c5cf 100644 --- a/src/string/antecedent/starts-with.spec.ts +++ b/src/string/antecedent/starts-with.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { StartsWith } from '~/string/antecedent/starts-with' describe('StartsWith', () => { diff --git a/src/string/capture.spec.ts b/src/string/capture.spec.ts index a9b1b53d..d77ab0a8 100644 --- a/src/string/capture.spec.ts +++ b/src/string/capture.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Capture } from '~/string/capture' describe('Capture', () => { diff --git a/src/string/capture.ts b/src/string/capture.ts index 38a22311..d78a899f 100644 --- a/src/string/capture.ts +++ b/src/string/capture.ts @@ -1,4 +1,4 @@ -import type { HelperCaptureGroup } from '~/helper/capture-group' +import type { CaptureGroup } from '~/helper/capture-group' export interface CaptureOpts { value: A @@ -16,7 +16,7 @@ export interface CaptureOpts { */ export type Capture< A extends string, - B extends HelperCaptureGroup = HelperCaptureGroup<'{{', '}}'>, + B extends CaptureGroup = CaptureGroup<'{{', '}}'>, Z extends CaptureOpts = CaptureOpts, > = A extends `${string}${B['start']}${infer C}${B['end']}${infer D}` ? Capture> diff --git a/src/string/consume-left.spec.ts b/src/string/consume-left.spec.ts index 2bc988b5..37442ffc 100644 --- a/src/string/consume-left.spec.ts +++ b/src/string/consume-left.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { ConsumeLeft } from '~/string/consume-left' describe('ConsumeLeft', () => { diff --git a/src/string/consume-right.spec.ts b/src/string/consume-right.spec.ts index efbe8746..253028ee 100644 --- a/src/string/consume-right.spec.ts +++ b/src/string/consume-right.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { ConsumeRight } from '~/string/consume-right' describe('ConsumeRight', () => { diff --git a/src/string/index.ts b/src/string/index.ts index 612a3663..0c720e4c 100644 --- a/src/string/index.ts +++ b/src/string/index.ts @@ -1,4 +1,3 @@ -export * from '../helper/to-natural-number' export * from './antecedent' export * from './capture' export * from './consume-left' @@ -6,5 +5,4 @@ export * from './consume-right' export * from './interpolation' export * from './lower-case' export * from './split' -export * from './string-length' export * from './upper-case' diff --git a/src/string/interpolation.spec.ts b/src/string/interpolation.spec.ts index dc4042fe..f1ff04f6 100644 --- a/src/string/interpolation.spec.ts +++ b/src/string/interpolation.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Interpolation } from '~/string/interpolation' describe('Interpolation', () => { diff --git a/src/string/interpolation.ts b/src/string/interpolation.ts index 3fa480c3..0f2c78cf 100644 --- a/src/string/interpolation.ts +++ b/src/string/interpolation.ts @@ -1,4 +1,4 @@ -import type { HelperCaptureGroup } from '~/helper/capture-group' +import type { CaptureGroup } from '~/helper/capture-group' import type { Capture } from '~/string/capture' export type InterpolationVariable = string | number | bigint | boolean @@ -25,7 +25,7 @@ export interface InterpolationOpts< export type Interpolation< A extends string, B extends Record, InterpolationVariable>, - C extends HelperCaptureGroup = HelperCaptureGroup<'{{', '}}'>, + C extends CaptureGroup = CaptureGroup<'{{', '}}'>, Z extends InterpolationOpts> = InterpolationOpts< A, Capture diff --git a/src/string/lower-case.spec.ts b/src/string/lower-case.spec.ts index ec40d8dd..c968436a 100644 --- a/src/string/lower-case.spec.ts +++ b/src/string/lower-case.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { LowerCase } from '~/string/lower-case' describe('LowerCase', () => { diff --git a/src/string/split.spec.ts b/src/string/split.spec.ts index d98580f8..00c34d72 100644 --- a/src/string/split.spec.ts +++ b/src/string/split.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Split } from '~/string/split' describe('Split', () => { diff --git a/src/string/string-length.spec.ts b/src/string/string-length.spec.ts deleted file mode 100644 index 8451bd32..00000000 --- a/src/string/string-length.spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' -import type { StringLength } from '~/string/string-length' - -describe('StringLength', () => { - it('should get the length of a string', () => { - type Ex1 = StringLength<'hello'> - type Ex2 = StringLength<'hello world'> - type Ex3 = StringLength<'hello 123'> - type Ex4 = StringLength<'hello world 123'> - - type TestEx1 = Expect> - type TestEx2 = Expect> - type TestEx3 = Expect> - type TestEx4 = Expect> - }) -}) diff --git a/src/string/string-length.ts b/src/string/string-length.ts deleted file mode 100644 index 91a72e1b..00000000 --- a/src/string/string-length.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { IsLiteralString } from '~/literal/antecedent/is-literal-string' -import type { Increment } from '~/math/increment' - -export interface StringLengthOpts { - value: A -} - -/** - * Calculates the length of a string type recursively. - * @typeParam A - The string type to calculate the length of. - * @group String - * @example - * ``` - * type Ex1 = StringLength<'abc'> // 3 - * type Ex2 = StringLength<'abc' | 'wxyz'> // 3 | 4 - * type Ex3 = StringLength // number - * ``` - */ -export type StringLength< - A extends string, - B extends StringLengthOpts = StringLengthOpts<0>, -> = - IsLiteralString extends true - ? A extends `${string}${infer C}` - ? StringLength>> - : B['value'] - : number diff --git a/src/string/upper-case.spec.ts b/src/string/upper-case.spec.ts index de08e5ea..68ff0f5b 100644 --- a/src/string/upper-case.spec.ts +++ b/src/string/upper-case.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { UpperCase } from '~/string/upper-case' describe('UpperCase', () => { diff --git a/src/tuple/antecedent/is-element-of.spec.ts b/src/tuple/antecedent/is-element-of.spec.ts index ee91886a..d7e0a275 100644 --- a/src/tuple/antecedent/is-element-of.spec.ts +++ b/src/tuple/antecedent/is-element-of.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsElementOf } from '~/tuple/antecedent/is-element-of' describe('IsElementOf', () => { diff --git a/src/tuple/antecedent/is-index-of.spec.ts b/src/tuple/antecedent/is-index-of.spec.ts index bac1b3a8..b33e3cd6 100644 --- a/src/tuple/antecedent/is-index-of.spec.ts +++ b/src/tuple/antecedent/is-index-of.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsIndexOf } from '~/tuple/antecedent/is-index-of' describe('IsIndexOf', () => { diff --git a/src/tuple/antecedent/is-tuple.spec.ts b/src/tuple/antecedent/is-tuple.spec.ts index b40b6727..27d9adb0 100644 --- a/src/tuple/antecedent/is-tuple.spec.ts +++ b/src/tuple/antecedent/is-tuple.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { IsTuple } from '~/tuple/antecedent/is-tuple' describe('IsTuple', () => { diff --git a/src/tuple/antecedent/is-tuple.ts b/src/tuple/antecedent/is-tuple.ts index 2a205adb..9e5e234f 100644 --- a/src/tuple/antecedent/is-tuple.ts +++ b/src/tuple/antecedent/is-tuple.ts @@ -1,9 +1,3 @@ -import type { AnyArray } from '~/any/any-array' -import type { IsExtension } from '~/extension/antecedent/is-extension' -import type { And } from '~/logic/antecedent/and' -import type { Not } from '~/logic/antecedent/not' -import type { LengthProp } from '~/object/length-prop' - /** * If `A` is a tuple return `true` else `false` * @typeParam A - The type to check. @@ -15,7 +9,8 @@ import type { LengthProp } from '~/object/length-prop' * type Ex2 = IsTuple // false * ``` */ -export type IsTuple = And< - IsExtension, - Not>> -> +export type IsTuple = A extends any[] + ? number extends A['length'] + ? false + : true + : false diff --git a/src/tuple/append.spec.ts b/src/tuple/append.spec.ts index 1926086b..50e12bb3 100644 --- a/src/tuple/append.spec.ts +++ b/src/tuple/append.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Append } from '~/tuple/append' describe('Append', () => { diff --git a/src/tuple/concat.spec.ts b/src/tuple/concat.spec.ts index 5fd7b623..aa813cec 100644 --- a/src/tuple/concat.spec.ts +++ b/src/tuple/concat.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Concat } from '~/tuple/concat' describe('Concat', () => { diff --git a/src/tuple/element-of.spec.ts b/src/tuple/element-of.spec.ts index c5fea0a3..fca8da59 100644 --- a/src/tuple/element-of.spec.ts +++ b/src/tuple/element-of.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { ElementOf } from '~/tuple/element-of' describe('ElementOf', () => { diff --git a/src/tuple/first.spec.ts b/src/tuple/first.spec.ts index f9af0a24..129de2b8 100644 --- a/src/tuple/first.spec.ts +++ b/src/tuple/first.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { First } from '~/tuple/first' describe('First', () => { diff --git a/src/tuple/indices.spec.ts b/src/tuple/indices.spec.ts index 3ac7a1a5..e2026ad9 100644 --- a/src/tuple/indices.spec.ts +++ b/src/tuple/indices.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Indices } from '~/tuple/indices' describe('Indices', () => { diff --git a/src/tuple/join.spec.ts b/src/tuple/join.spec.ts index 67839cee..b72328a4 100644 --- a/src/tuple/join.spec.ts +++ b/src/tuple/join.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Join } from '~/tuple/join' describe('Join', () => { diff --git a/src/tuple/join.ts b/src/tuple/join.ts index 8a20f65c..09997bf6 100644 --- a/src/tuple/join.ts +++ b/src/tuple/join.ts @@ -1,6 +1,6 @@ import type { AnyStringish } from '~/any/any-stringish' import type { ToString } from '~/any/to-string' -import type { HelperToStringInterface } from '~/helper/to-string-interface' +import type { ToStringInterface } from '~/helper/to-string-interface' import type { IsStringConcatIdentity } from '~/identity/antecedent/is-string-concat-identity' import type { If } from '~/logic/if' @@ -8,7 +8,7 @@ export interface JoinOpts { value: A } -export type StringLike = AnyStringish | HelperToStringInterface +export type StringLike = AnyStringish | ToStringInterface /** * Join a tuple of templatables `A` on a templatable `B` diff --git a/src/tuple/last.spec.ts b/src/tuple/last.spec.ts index e52854f9..0451bc34 100644 --- a/src/tuple/last.spec.ts +++ b/src/tuple/last.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Last } from '~/tuple/last' describe('Last', () => { diff --git a/src/tuple/prepend.spec.ts b/src/tuple/prepend.spec.ts index c3721bb3..e60419ea 100644 --- a/src/tuple/prepend.spec.ts +++ b/src/tuple/prepend.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Prepend } from '~/tuple/prepend' describe('Prepend', () => { diff --git a/src/tuple/rest.spec.ts b/src/tuple/rest.spec.ts index d4946607..08dd6f6a 100644 --- a/src/tuple/rest.spec.ts +++ b/src/tuple/rest.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Rest } from '~/tuple/rest' describe('Rest', () => { diff --git a/src/tuple/reverse.spec.ts b/src/tuple/reverse.spec.ts index 19efde72..8912b515 100644 --- a/src/tuple/reverse.spec.ts +++ b/src/tuple/reverse.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Reverse } from '~/tuple/reverse' describe('Reverse', () => { diff --git a/src/tuple/slice.spec.ts b/src/tuple/slice.spec.ts index fc0308dc..8d0d316b 100644 --- a/src/tuple/slice.spec.ts +++ b/src/tuple/slice.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Slice } from '~/tuple/slice' describe('Slice', () => { @@ -7,4 +7,9 @@ describe('Slice', () => { type Ex1 = Slice<['a', 'b', 'c', 'd', 'e'], 1, 3> // ['b', 'c'] type TestEx1 = Expect> }) + + it('should support negative indexes', () => { + type Ex1 = Slice<['a', 'b', 'c', 'd', 'e'], 1, -1> // ['b', 'c', 'd'] + type TestEx1 = Expect> + }) }) diff --git a/src/tuple/slice.ts b/src/tuple/slice.ts index bb591d24..5e062bc8 100644 --- a/src/tuple/slice.ts +++ b/src/tuple/slice.ts @@ -13,9 +13,9 @@ import type { Override } from '~/object/override' export interface SliceOpts< A extends AnyArray = AnyArray, - B extends number = number, - C extends number = number, - D extends number = number, + B extends number | bigint = number | bigint, + C extends number | bigint = number | bigint, + D extends number | bigint = number | bigint, > { value: A startIndex: B @@ -66,7 +66,9 @@ export type Slice< { value: [ ...D['value'], - A[Add, D['startIndex']>], + A[Add, D['startIndex']> extends number + ? Add, D['startIndex']> + : never], ] } > diff --git a/src/tuple/tuple.spec.ts b/src/tuple/tuple.spec.ts index 2ef97e02..394f4728 100644 --- a/src/tuple/tuple.spec.ts +++ b/src/tuple/tuple.spec.ts @@ -1,5 +1,5 @@ import type { IsEqual } from '~/extension/antecedent/is-equal' -import type { Expect } from '~/helper/test' +import type { Expect } from '~/helper/expect' import type { Tuple } from '~/tuple/tuple' describe('Tuple', () => {