diff --git a/src/core.ts b/src/core.ts index 4420f17ed..73e3a3716 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1,55 +1,45 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals, type Extends } from "tsafe"; +import { type Equals, type Extends, assert } from "tsafe"; -import { type Exponent } from "./exponents"; -import { type RemoveNeverValues, type ExcludeUnitZeroSubvalues } from "./utils"; +import type { Exponent } from "./exponents"; +import type { ExcludeUnitZeroSubvalues, RemoveNeverValues } from "./utils"; /** * A unit without any meta data. * * @group Abstract Unit Generators */ -export type AbstractUnit = number & { - readonly __uom_types__unit_class: UnitClass; -}; +export type AbstractUnit = number & + Readonly<{ + __uom_types__unit_class: UnitClass; + }>; /** * Create a unit without meta data from an already existing {@link UnitClass}. * * @group Abstract Unit Generators */ -export type AbstractUnitFrom = C extends UnitClass< - infer A -> - ? AbstractUnit - : never; +export type AbstractUnitFrom = + C extends UnitClass ? AbstractUnit : never; /** * The core unit type. * * @group Unit Generators */ -export type Unit< - C extends UnitSubvalues, - M extends UnitSubvalues = {}, -> = number & { - readonly __uom_types__unit_class: UnitClass; - readonly __uom_types__unit_meta: UnitMeta; -}; +export type Unit = number & + Readonly<{ + __uom_types__unit_class: UnitClass; + __uom_types__unit_meta: UnitMeta; + }>; /** * Create a {@link Unit} from already existing {@link UnitClass} and {@link UnitMeta}. * * @group Unit Generators */ -export type UnitFrom< - C extends UnknownUnitClass, - M extends UnknownUnitMeta = UnitMeta<{}>, -> = C extends UnitClass - ? M extends UnitMeta - ? Unit - : never - : never; +export type UnitFrom> = + C extends UnitClass ? (M extends UnitMeta ? Unit : never) : never; /** * A {@link Unit} without any {@link UnitClass}. @@ -58,9 +48,10 @@ export type UnitFrom< * * @group Unit Generators */ -export type UnitConversionRate = number & { - readonly __uom_types__unit_meta: UnitMeta; -}; +export type UnitConversionRate = number & + Readonly<{ + __uom_types__unit_meta: UnitMeta; + }>; /** * Create a {@link UnitConversionRate} from already existing {@link UnitMeta}. @@ -75,9 +66,10 @@ export type UnitConversionRateFrom = * * @group Unit Components */ -export type UnitClass = UnitKeyValues & { - readonly __uno_types__unit_class_type: true; -}; +export type UnitClass = UnitKeyValues & + Readonly<{ + __uno_types__unit_class_type: true; + }>; /** * Used to state how units of the same {@link UnitClass} differ from one another. @@ -85,66 +77,70 @@ export type UnitClass = UnitKeyValues & { * * @group Unit Components */ -export type UnitMeta = UnitKeyValues & { - readonly __uno_types__unit_meta_type: true; -}; +export type UnitMeta = UnitKeyValues & + Readonly<{ + __uno_types__unit_meta_type: true; + }>; /** * A {@link Unit} that we don't know anything about. * * @group Unknown Units */ -export type UnknownUnit = UnknownAbstractUnit & { - readonly __uom_types__unit_meta: UnknownUnitMeta; -}; +export type UnknownUnit = UnknownAbstractUnit & + Readonly<{ + __uom_types__unit_meta: UnknownUnitMeta; + }>; /** * An {@link AbstractUnit} that we don't know anything about. * * @group Unknown Units */ -export type UnknownAbstractUnit = number & { - readonly __uom_types__unit_class: UnknownUnitClass; -}; +export type UnknownAbstractUnit = number & + Readonly<{ + __uom_types__unit_class: UnknownUnitClass; + }>; /** * An {@link UnitConversionRate} that we don't know anything about. * * @group Unknown Units */ -export type UnknownUnitConversionRate = number & { - readonly __uom_types__unit_meta: UnknownUnitMeta; -}; +export type UnknownUnitConversionRate = number & + Readonly<{ + __uom_types__unit_meta: UnknownUnitMeta; + }>; /** * A {@link UnitClass} that we don't know anything about. * * @group Unknown Units */ -export type UnknownUnitClass = UnknownUnitKeyValues & { - readonly __uno_types__unit_class_type: true; -}; +export type UnknownUnitClass = UnknownUnitKeyValues & + Readonly<{ + __uno_types__unit_class_type: true; + }>; /** * A {@link UnitMeta} that we don't know anything about. * * @group Unknown Units */ -export type UnknownUnitMeta = UnknownUnitKeyValues & { - readonly __uno_types__unit_meta_type: true; -}; +export type UnknownUnitMeta = UnknownUnitKeyValues & + Readonly<{ + __uno_types__unit_meta_type: true; + }>; -type UnitKeyValues = { - readonly __uom_types__keys: keyof ExcludeUnitZeroSubvalues extends string - ? keyof ExcludeUnitZeroSubvalues - : never; - readonly __uom_types__value: RemoveNeverValues; -}; +type UnitKeyValues = Readonly<{ + __uom_types__keys: keyof ExcludeUnitZeroSubvalues extends string ? keyof ExcludeUnitZeroSubvalues : never; + __uom_types__value: RemoveNeverValues; +}>; -type UnknownUnitKeyValues = { - readonly __uom_types__keys: string; - readonly __uom_types__value: {}; -}; +type UnknownUnitKeyValues = Readonly<{ + __uom_types__keys: string; + __uom_types__value: {}; +}>; /** * A mapping of subvalue of a unit its magnitude. @@ -170,21 +166,9 @@ if (import.meta.vitest !== undefined) { assert, AbstractUnit<{}>>>(); assert, AbstractUnit<{ a: 1 }>>>(); assert, AbstractUnit>>(); - assert< - Extends>, AbstractUnitFrom>> - >(); - assert< - Extends< - UnitFrom>, - AbstractUnitFrom> - > - >(); - assert< - Extends< - UnitFrom>, - AbstractUnitFrom> - > - >(); + assert>, AbstractUnitFrom>>>(); + assert>, AbstractUnitFrom>>>(); + assert>, AbstractUnitFrom>>>(); }); }); @@ -192,23 +176,11 @@ if (import.meta.vitest !== undefined) { it("a super type of Unit", () => { assert, UnitConversionRate<{}>>>(); assert, UnitConversionRate<{ a: 1 }>>>(); + assert, UnitConversionRate>>(); + assert>, UnitConversionRateFrom>>>(); + assert, UnitMeta<{ a: 1 }>>, UnitConversionRateFrom>>>(); assert< - Extends, UnitConversionRate> - >(); - assert< - Extends>, UnitConversionRateFrom>> - >(); - assert< - Extends< - UnitFrom, UnitMeta<{ a: 1 }>>, - UnitConversionRateFrom> - > - >(); - assert< - Extends< - UnitFrom, UnitMeta>, - UnitConversionRateFrom> - > + Extends, UnitMeta>, UnitConversionRateFrom>> >(); }); }); @@ -235,12 +207,8 @@ if (import.meta.vitest !== undefined) { describe("UnitConversionRate", () => { it(assignableToConcreteTypes, () => { assert, UnknownUnitConversionRate>>(); - assert< - Extends, UnknownUnitConversionRate> - >(); - assert< - Extends, UnknownUnitConversionRate> - >(); + assert, UnknownUnitConversionRate>>(); + assert, UnknownUnitConversionRate>>(); }); }); diff --git a/src/deprecated.ts b/src/deprecated.ts index df19202ca..d90452017 100644 --- a/src/deprecated.ts +++ b/src/deprecated.ts @@ -1,22 +1,16 @@ -import { type Exponent } from "./exponents"; -import { type Pow, type Root } from "./units-operations"; +import type { Exponent } from "./exponents"; +import type { Pow, Root } from "./units-operations"; /** * Multiple the exponent values of a unit by a number. * * @deprecated Use {@link Pow} instead. */ -export type MultiplyUnitExponents = Pow< - T, - E ->; +export type MultiplyUnitExponents = Pow; /** * Divide the exponent values of a unit by a number. * * @deprecated Use {@link Root} instead. */ -export type DivideUnitExponents = Root< - T, - E ->; +export type DivideUnitExponents = Root; diff --git a/src/math.ts b/src/math.ts index f02a716d1..e1fe25c13 100644 --- a/src/math.ts +++ b/src/math.ts @@ -1,21 +1,17 @@ -import { - type PosExponent, - type Exponent, - type Pow, - type Divide, - type Inverse, - type Multiply, - type Root, - type UnknownAbstractUnit, - type UnknownUnit, +import type { + Divide, + Exponent, + Inverse, + Multiply, + PosExponent, + Pow, + Root, + UnknownAbstractUnit, + UnknownUnit, } from "#uom-types"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -type OperationIO = [T] extends [ - UnknownUnit | UnknownAbstractUnit, -] - ? T - : number; +type OperationIO = [T] extends [UnknownUnit | UnknownAbstractUnit] ? T : number; /** * Add two values with the same units together. @@ -23,10 +19,7 @@ type OperationIO = [T] extends [ * @category Math * @returns `a + b` */ -export function add( - a: OperationIO, - b: OperationIO, -): OperationIO; +export function add(a: OperationIO, b: OperationIO): OperationIO; /** * Add two values with the same units together. @@ -34,9 +27,7 @@ export function add( * @category Math * @returns `(a) => a + b` */ -export function add( - b: OperationIO, -): (a: OperationIO) => OperationIO; +export function add(b: OperationIO): (a: OperationIO) => OperationIO; export function add(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a + args[0] : args[0] + args[1]; @@ -48,10 +39,7 @@ export function add(...args: Readonly<[number, number] | [number]>) { * @category Math * @returns `a - b` */ -export function sub( - a: OperationIO, - b: OperationIO, -): OperationIO; +export function sub(a: OperationIO, b: OperationIO): OperationIO; /** * Subtract one value from another with the same units. @@ -59,9 +47,7 @@ export function sub( * @category Math * @returns `(a) => a - b` */ -export function sub( - b: OperationIO, -): (a: OperationIO) => OperationIO; +export function sub(b: OperationIO): (a: OperationIO) => OperationIO; export function sub(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a - args[0] : args[0] - args[1]; @@ -73,10 +59,7 @@ export function sub(...args: Readonly<[number, number] | [number]>) { * @category Math * @returns `a * b` */ -export function mul( - a: A, - b: B, -): Multiply; +export function mul(a: A, b: B): Multiply; /** * Multiple a value by the given value. @@ -84,9 +67,7 @@ export function mul( * @category Math * @returns `(a) => a * b` */ -export function mul( - b: B, -): (a: A) => Multiply; +export function mul(b: B): (a: A) => Multiply; export function mul(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a * args[0] : args[0] * args[1]; @@ -98,10 +79,7 @@ export function mul(...args: Readonly<[number, number] | [number]>) { * @category Math * @returns `a / b` */ -export function div( - a: A, - b: B, -): Divide; +export function div(a: A, b: B): Divide; /** * Divide one value by the given value. @@ -109,9 +87,7 @@ export function div( * @category Math * @returns `(a) => a / b` */ -export function div( - b: B, -): (a: A) => Divide; +export function div(b: B): (a: A) => Divide; export function div(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a / args[0] : args[0] / args[1]; @@ -125,10 +101,7 @@ export function div(...args: Readonly<[number, number] | [number]>) { * @param b - Must be an integer. * @returns `a % b` */ -export function mod( - a: OperationIO, - b: OperationIO, -): OperationIO; +export function mod(a: OperationIO, b: OperationIO): OperationIO; /** * Modulo operator. @@ -137,9 +110,7 @@ export function mod( * @param b - Must be an integer. * @returns `(a) => a % b` */ -export function mod( - b: OperationIO, -): (a: OperationIO) => OperationIO; +export function mod(b: OperationIO): (a: OperationIO) => OperationIO; export function mod(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a % args[0] : args[0] % args[1]; @@ -153,10 +124,7 @@ export function mod(...args: Readonly<[number, number] | [number]>) { * @param b - Must be a positive integer. * @returns An integer between zero (inclusive) and `b` (exclusive). */ -export function modSafe( - a: OperationIO, - b: OperationIO, -): OperationIO; +export function modSafe(a: OperationIO, b: OperationIO): OperationIO; /** * Perform mathematic modular arithmetic. @@ -165,9 +133,7 @@ export function modSafe( * @param b - Must be a positive integer. * @returns A function that takes a integer and returns an integer between zero (inclusive) and `b` (exclusive). */ -export function modSafe( - b: OperationIO, -): (a: OperationIO) => OperationIO; +export function modSafe(b: OperationIO): (a: OperationIO) => OperationIO; export function modSafe(...args: Readonly<[number, number] | [number]>) { return args.length === 1 @@ -178,12 +144,12 @@ export function modSafe(...args: Readonly<[number, number] | [number]>) { type PowFunction = E extends UnknownUnit ? never : E extends UnknownAbstractUnit - ? never - : E extends Exponent - ? (b: B) => Pow - : E extends 0.5 - ? (b: B) => Root - : (b: B) => number; + ? never + : E extends Exponent + ? (b: B) => Pow + : E extends 0.5 + ? (b: B) => Root + : (b: B) => number; /** * Raise a number to the power of another. @@ -193,11 +159,7 @@ type PowFunction = E extends UnknownUnit */ export function pow( base: B, - exponent: E extends UnknownUnit - ? never - : E extends UnknownAbstractUnit - ? never - : E, + exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E, ): E extends Exponent ? Pow : number; /** @@ -216,9 +178,7 @@ export function pow(base: B, exponent: 0.5): Root; */ export function pow( exponent: E, -): ( - base: Parameters>[0], -) => ReturnType>; +): (base: Parameters>[0]) => ReturnType>; export function pow(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (b: number) => b ** args[0] : args[0] ** args[1]; @@ -227,10 +187,10 @@ export function pow(...args: Readonly<[number, number] | [number]>) { type RootFunction = E extends UnknownUnit ? never : E extends UnknownAbstractUnit - ? never - : E extends PosExponent - ? (b: B) => Root - : (b: B) => number; + ? never + : E extends PosExponent + ? (b: B) => Root + : (b: B) => number; /** * Take the nth root of a number. @@ -240,11 +200,7 @@ type RootFunction = E extends UnknownUnit */ export function root( base: B, - exponent: E extends UnknownUnit - ? never - : E extends UnknownAbstractUnit - ? never - : E, + exponent: E extends UnknownUnit ? never : E extends UnknownAbstractUnit ? never : E, ): E extends PosExponent ? Root : number; /** @@ -255,14 +211,10 @@ export function root( */ export function root( exponent: E, -): ( - base: Parameters>[0], -) => ReturnType>; +): (base: Parameters>[0]) => ReturnType>; export function root(...args: Readonly<[number, number] | [number]>) { - return args.length === 1 - ? (b: number) => b ** (1 / args[0]) - : args[0] ** (1 / args[1]); + return args.length === 1 ? (b: number) => b ** (1 / args[0]) : args[0] ** (1 / args[1]); } /** @@ -291,9 +243,7 @@ export function inverse(value: T): Inverse { * @category Math * @returns `-value` */ -export function negate( - value: OperationIO, -): OperationIO { +export function negate(value: OperationIO): OperationIO { return -value as OperationIO; } @@ -373,10 +323,7 @@ export function sum(values: Iterable): OperationIO { * @category Math * @returns `a === b` */ -export function eq( - a: OperationIO, - b: OperationIO, -): boolean; +export function eq(a: OperationIO, b: OperationIO): boolean; /** * Equal: Compare if a value is equal to the given value. @@ -384,9 +331,7 @@ export function eq( * @category Math * @returns `(a) => a === b` */ -export function eq( - b: OperationIO, -): (a: OperationIO) => boolean; +export function eq(b: OperationIO): (a: OperationIO) => boolean; export function eq(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a === args[0] : args[0] === args[1]; @@ -398,10 +343,7 @@ export function eq(...args: Readonly<[number, number] | [number]>) { * @category Math * @returns `a > b` */ -export function gt( - a: OperationIO, - b: OperationIO, -): boolean; +export function gt(a: OperationIO, b: OperationIO): boolean; /** * Greater Than: Compare if a value is greater than the given value. @@ -409,9 +351,7 @@ export function gt( * @category Math * @returns `(a) => a > b` */ -export function gt( - b: OperationIO, -): (a: OperationIO) => boolean; +export function gt(b: OperationIO): (a: OperationIO) => boolean; export function gt(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a > args[0] : args[0] > args[1]; @@ -423,10 +363,7 @@ export function gt(...args: Readonly<[number, number] | [number]>) { * @category Math * @returns `a >= b` */ -export function gte( - a: OperationIO, - b: OperationIO, -): boolean; +export function gte(a: OperationIO, b: OperationIO): boolean; /** * Greater Than or Equal: Compare if a value is greater than or equal to the given value. @@ -434,9 +371,7 @@ export function gte( * @category Math * @returns `(a) => a >= b` */ -export function gte( - b: OperationIO, -): (a: OperationIO) => boolean; +export function gte(b: OperationIO): (a: OperationIO) => boolean; export function gte(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a >= args[0] : args[0] >= args[1]; @@ -448,10 +383,7 @@ export function gte(...args: Readonly<[number, number] | [number]>) { * @category Math * @returns `a < b` */ -export function lt( - a: OperationIO, - b: OperationIO, -): boolean; +export function lt(a: OperationIO, b: OperationIO): boolean; /** * Less Than: Compare if a value is less than the given value. @@ -459,9 +391,7 @@ export function lt( * @category Math * @returns `(a) => a < b` */ -export function lt( - b: OperationIO, -): (a: OperationIO) => boolean; +export function lt(b: OperationIO): (a: OperationIO) => boolean; export function lt(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a < args[0] : args[0] < args[1]; @@ -473,10 +403,7 @@ export function lt(...args: Readonly<[number, number] | [number]>) { * @category Math * @returns `a <= b` */ -export function lte( - a: OperationIO, - b: OperationIO, -): boolean; +export function lte(a: OperationIO, b: OperationIO): boolean; /** * Less Than or Equal: Compare if a value is less than or equal to the given value. @@ -484,9 +411,7 @@ export function lte( * @category Math * @returns `(a) => a <= b` */ -export function lte( - b: OperationIO, -): (a: OperationIO) => boolean; +export function lte(b: OperationIO): (a: OperationIO) => boolean; export function lte(...args: Readonly<[number, number] | [number]>) { return args.length === 1 ? (a: number) => a <= args[0] : args[0] <= args[1]; diff --git a/src/units-operations.ts b/src/units-operations.ts index d52a77b1c..b6e0b96b8 100644 --- a/src/units-operations.ts +++ b/src/units-operations.ts @@ -1,26 +1,17 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; - -import { - type AbstractUnit, - type Unit, - type UnitConversionRate, - type UnitSubvalues, - type UnknownAbstractUnit, - type UnknownUnit, - type UnknownUnitConversionRate, +import { type Equals, assert } from "tsafe"; + +import type { + AbstractUnit, + Unit, + UnitConversionRate, + UnitSubvalues, + UnknownAbstractUnit, + UnknownUnit, + UnknownUnitConversionRate, } from "./core"; -import { - type DivideExponents, - type Exponent, - type MultiplyExponents, - type SumExponents, -} from "./exponents"; -import { - type ExcludeUnitZeroSubvalues, - type FlatternAlias, - type GetExponent, -} from "./utils"; +import type { DivideExponents, Exponent, MultiplyExponents, SumExponents } from "./exponents"; +import type { ExcludeUnitZeroSubvalues, FlatternAlias, GetExponent } from "./utils"; /** * Take the inverse of a unit. @@ -35,10 +26,7 @@ export type Inverse = Pow; * * @group Unit Subvalue Functions */ -export type InverseUnitSubvalues = PowUnitSubvalues< - T, - -1 ->; +export type InverseUnitSubvalues = PowUnitSubvalues; /** * Multiply a unit by another unit. @@ -49,77 +37,65 @@ export type InverseUnitSubvalues = PowUnitSubvalues< export type Multiply = A extends UnknownUnit ? MultiplyHelperUnit : B extends UnknownUnit - ? MultiplyHelperUnit - : A extends UnknownAbstractUnit - ? MultiplyHelperAbstractUnit - : B extends UnknownAbstractUnit - ? MultiplyHelperAbstractUnit - : A extends UnknownUnitConversionRate - ? MultiplyHelperUnitConversionRate - : B extends UnknownUnitConversionRate - ? MultiplyHelperUnitConversionRate - : number; + ? MultiplyHelperUnit + : A extends UnknownAbstractUnit + ? MultiplyHelperAbstractUnit + : B extends UnknownAbstractUnit + ? MultiplyHelperAbstractUnit + : A extends UnknownUnitConversionRate + ? MultiplyHelperUnitConversionRate + : B extends UnknownUnitConversionRate + ? MultiplyHelperUnitConversionRate + : number; /** * Multiple a Unit by a Unit, AbstractUnit, UnitConversionRate or number * * @internal */ -type MultiplyHelperUnit< - A extends UnknownUnit, - B extends number, -> = A extends Unit - ? B extends Unit - ? Unit< - FlatternAlias>, - FlatternAlias> - > - : B extends AbstractUnit - ? Unit>, AMeta> - : B extends UnitConversionRate - ? Unit>> - : A - : never; +type MultiplyHelperUnit = + A extends Unit + ? B extends Unit + ? Unit>, FlatternAlias>> + : B extends AbstractUnit + ? Unit>, AMeta> + : B extends UnitConversionRate + ? Unit>> + : A + : never; /** * Multiple an AbstractUnit by an AbstractUnit, UnitConversionRate or number * * @internal */ -type MultiplyHelperAbstractUnit< - A extends UnknownAbstractUnit, - B extends number, -> = A extends AbstractUnit - ? B extends AbstractUnit - ? AbstractUnit>> - : B extends UnitConversionRate - ? Unit - : A - : never; +type MultiplyHelperAbstractUnit = + A extends AbstractUnit + ? B extends AbstractUnit + ? AbstractUnit>> + : B extends UnitConversionRate + ? Unit + : A + : never; /** * Multiple an UnitConversionRate by a UnitConversionRate or number * * @internal */ -type MultiplyHelperUnitConversionRate< - A extends UnknownUnitConversionRate, - B extends number, -> = A extends UnitConversionRate - ? B extends UnitConversionRate - ? UnitConversionRate>> - : A - : never; +type MultiplyHelperUnitConversionRate = + A extends UnitConversionRate + ? B extends UnitConversionRate + ? UnitConversionRate>> + : A + : never; /** * Multiply each of the subvalues from a unit with the corresponding once from another unit. * * @group Unit Subvalue Functions */ -export type MultiplyUnitSubvalues< - A extends UnitSubvalues, - B extends UnitSubvalues, -> = ExcludeUnitZeroSubvalues<{ +export type MultiplyUnitSubvalues = ExcludeUnitZeroSubvalues<{ [S in keyof A | keyof B]: SumExponents, GetExponent>; }>; @@ -129,49 +105,38 @@ export type MultiplyUnitSubvalues< * @group Unit Functions * @returns `A/B` */ -export type Divide = Multiply< - A, - Inverse ->; +export type Divide = Multiply>; /** * Divide each of the subvalues from a unit with the corresponding once from another unit. * * @group Unit Subvalue Functions */ -export type DivideUnitSubvalues< - A extends UnitSubvalues, - B extends UnitSubvalues, -> = MultiplyUnitSubvalues>; +export type DivideUnitSubvalues = MultiplyUnitSubvalues< + A, + InverseUnitSubvalues +>; /** * Put a unit to the power of an exponent. * * @group Unit Functions */ -export type Pow = T extends Unit< - infer Class, - infer Meta -> - ? Unit< - FlatternAlias>, - FlatternAlias> - > - : T extends AbstractUnit - ? AbstractUnit>> - : T extends UnitConversionRate - ? UnitConversionRate>> - : number; +export type Pow = + T extends Unit + ? Unit>, FlatternAlias>> + : T extends AbstractUnit + ? AbstractUnit>> + : T extends UnitConversionRate + ? UnitConversionRate>> + : number; /** * Put each subvalue of a unit to the power of an exponent. * * @group Unit Subvalue Functions */ -export type PowUnitSubvalues< - T extends UnitSubvalues, - E extends Exponent, -> = ExcludeUnitZeroSubvalues<{ +export type PowUnitSubvalues = ExcludeUnitZeroSubvalues<{ [S in keyof T]: MultiplyExponents, E>; }>; @@ -180,29 +145,21 @@ export type PowUnitSubvalues< * * @group Unit Functions */ -export type Root = T extends Unit< - infer Class, - infer Meta -> - ? Unit< - FlatternAlias>, - FlatternAlias> - > - : T extends AbstractUnit - ? AbstractUnit>> - : T extends UnitConversionRate - ? UnitConversionRate>> - : number; +export type Root = + T extends Unit + ? Unit>, FlatternAlias>> + : T extends AbstractUnit + ? AbstractUnit>> + : T extends UnitConversionRate + ? UnitConversionRate>> + : number; /** * Take the nth root of each subvalue of a unit. * * @group Unit Subvalue Functions */ -export type RootUnitSubvalues< - T extends UnitSubvalues, - E extends Exponent, -> = ExcludeUnitZeroSubvalues<{ +export type RootUnitSubvalues = ExcludeUnitZeroSubvalues<{ [S in keyof T]: DivideExponents, E>; }>; @@ -216,42 +173,23 @@ if (import.meta.vitest !== undefined) { }); it("works with Unit by AbstractUnit", () => { - assert< - Equals< - Inverse>, - AbstractUnit<{ a: -2; b: -2 }> - > - >(); + assert>, AbstractUnit<{ a: -2; b: -2 }>>>(); }); it("works with Unit by UnitConversionRate", () => { - assert< - Equals< - Inverse>, - UnitConversionRate<{ a: -2; b: -2 }> - > - >(); + assert>, UnitConversionRate<{ a: -2; b: -2 }>>>(); }); }); describe("Multiply", () => { it("works with Unit by Unit", () => { - assert< - Equals< - Multiply, Unit<{ a: 1; b: 2 }>>, - Unit<{ a: 2; b: 2 }> - > - >(); + assert, Unit<{ a: 1; b: 2 }>>, Unit<{ a: 2; b: 2 }>>>(); }); it("works with Unit by number", () => { - assert< - Equals, number>, Unit<{ a: 2; b: 2 }>> - >(); + assert, number>, Unit<{ a: 2; b: 2 }>>>(); - assert< - Equals>, Unit<{ a: 2; b: 2 }>> - >(); + assert>, Unit<{ a: 2; b: 2 }>>>(); }); it("works with Unit by concrete number", () => { @@ -261,79 +199,38 @@ if (import.meta.vitest !== undefined) { }); it("works with Unit by AbstractUnit", () => { - assert< - Equals< - Multiply, AbstractUnit<{ a: 1 }>>, - Unit<{ a: 3; b: 2 }> - > - >(); + assert, AbstractUnit<{ a: 1 }>>, Unit<{ a: 3; b: 2 }>>>(); - assert< - Equals< - Multiply, Unit<{ a: 2; b: 2 }>>, - Unit<{ a: 3; b: 2 }> - > - >(); + assert, Unit<{ a: 2; b: 2 }>>, Unit<{ a: 3; b: 2 }>>>(); }); it("works with AbstractUnit by AbstractUnit", () => { - assert< - Equals< - Multiply, AbstractUnit<{ a: 1; b: 2 }>>, - AbstractUnit<{ a: 2; b: 2 }> - > - >(); + assert, AbstractUnit<{ a: 1; b: 2 }>>, AbstractUnit<{ a: 2; b: 2 }>>>(); }); it("works with AbstractUnit by number", () => { - assert< - Equals< - Multiply, number>, - AbstractUnit<{ a: 2; b: 2 }> - > - >(); + assert, number>, AbstractUnit<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Multiply>, - AbstractUnit<{ a: 2; b: 2 }> - > - >(); + assert>, AbstractUnit<{ a: 2; b: 2 }>>>(); }); it("works with AbstractUnit by concrete number", () => { - assert< - Equals< - Multiply, 2>, - AbstractUnit<{ a: 2; b: 2 }> - > - >(); + assert, 2>, AbstractUnit<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Multiply<2, AbstractUnit<{ a: 2; b: 2 }>>, - AbstractUnit<{ a: 2; b: 2 }> - > - >(); + assert>, AbstractUnit<{ a: 2; b: 2 }>>>(); }); it("works with AbstractUnit by UnitConversionRate", () => { assert< Equals< - Multiply< - AbstractUnit<{ a: 2; b: 2 }>, - UnitConversionRate<{ c: 3; d: 4 }> - >, + Multiply, UnitConversionRate<{ c: 3; d: 4 }>>, Unit<{ a: 2; b: 2 }, { c: 3; d: 4 }> > >(); assert< Equals< - Multiply< - UnitConversionRate<{ c: 3; d: 4 }>, - AbstractUnit<{ a: 2; b: 2 }> - >, + Multiply, AbstractUnit<{ a: 2; b: 2 }>>, Unit<{ a: 2; b: 2 }, { c: 3; d: 4 }> > >(); @@ -342,63 +239,34 @@ if (import.meta.vitest !== undefined) { it("works with UnitConversionRate by UnitConversionRate", () => { assert< Equals< - Multiply< - UnitConversionRate<{ a: 1 }>, - UnitConversionRate<{ a: 1; b: 2 }> - >, + Multiply, UnitConversionRate<{ a: 1; b: 2 }>>, UnitConversionRate<{ a: 2; b: 2 }> > >(); }); it("works with UnitConversionRate by number", () => { - assert< - Equals< - Multiply, number>, - UnitConversionRate<{ a: 2; b: 2 }> - > - >(); + assert, number>, UnitConversionRate<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Multiply>, - UnitConversionRate<{ a: 2; b: 2 }> - > - >(); + assert>, UnitConversionRate<{ a: 2; b: 2 }>>>(); }); it("works with UnitConversionRate by concrete number", () => { - assert< - Equals< - Multiply, 2>, - UnitConversionRate<{ a: 2; b: 2 }> - > - >(); + assert, 2>, UnitConversionRate<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Multiply<2, UnitConversionRate<{ a: 2; b: 2 }>>, - UnitConversionRate<{ a: 2; b: 2 }> - > - >(); + assert>, UnitConversionRate<{ a: 2; b: 2 }>>>(); }); }); describe("Divide", () => { it("works with Unit by Unit", () => { - assert< - Equals, Unit<{ a: 1; b: 2 }>>, Unit<{ b: -2 }>> - >(); + assert, Unit<{ a: 1; b: 2 }>>, Unit<{ b: -2 }>>>(); }); it("works with Unit by number", () => { - assert< - Equals, number>, Unit<{ a: 2; b: 2 }>> - >(); + assert, number>, Unit<{ a: 2; b: 2 }>>>(); - assert< - Equals>, Unit<{ a: -2; b: -2 }>> - >(); + assert>, Unit<{ a: -2; b: -2 }>>>(); }); it("works with Unit by concrete number", () => { @@ -408,79 +276,38 @@ if (import.meta.vitest !== undefined) { }); it("works with Unit by AbstractUnit", () => { - assert< - Equals< - Divide, AbstractUnit<{ a: 1 }>>, - Unit<{ a: 1; b: 2 }> - > - >(); + assert, AbstractUnit<{ a: 1 }>>, Unit<{ a: 1; b: 2 }>>>(); - assert< - Equals< - Divide, Unit<{ a: 2; b: 2 }>>, - Unit<{ a: -1; b: -2 }> - > - >(); + assert, Unit<{ a: 2; b: 2 }>>, Unit<{ a: -1; b: -2 }>>>(); }); it("works with AbstractUnit by AbstractUnit", () => { - assert< - Equals< - Divide, AbstractUnit<{ a: 1; b: 2 }>>, - AbstractUnit<{ b: -2 }> - > - >(); + assert, AbstractUnit<{ a: 1; b: 2 }>>, AbstractUnit<{ b: -2 }>>>(); }); it("works with AbstractUnit by number", () => { - assert< - Equals< - Divide, number>, - AbstractUnit<{ a: 2; b: 2 }> - > - >(); + assert, number>, AbstractUnit<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Divide>, - AbstractUnit<{ a: -2; b: -2 }> - > - >(); + assert>, AbstractUnit<{ a: -2; b: -2 }>>>(); }); it("works with AbstractUnit by concrete number", () => { - assert< - Equals< - Divide, 2>, - AbstractUnit<{ a: 2; b: 2 }> - > - >(); + assert, 2>, AbstractUnit<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Divide<2, AbstractUnit<{ a: 2; b: 2 }>>, - AbstractUnit<{ a: -2; b: -2 }> - > - >(); + assert>, AbstractUnit<{ a: -2; b: -2 }>>>(); }); it("works with AbstractUnit by UnitConversionRate", () => { assert< Equals< - Divide< - AbstractUnit<{ a: 2; b: 2 }>, - UnitConversionRate<{ c: 3; d: 4 }> - >, + Divide, UnitConversionRate<{ c: 3; d: 4 }>>, Unit<{ a: 2; b: 2 }, { c: -3; d: -4 }> > >(); assert< Equals< - Divide< - UnitConversionRate<{ c: 3; d: 4 }>, - AbstractUnit<{ a: 2; b: 2 }> - >, + Divide, AbstractUnit<{ a: 2; b: 2 }>>, Unit<{ a: -2; b: -2 }, { c: 3; d: 4 }> > >(); @@ -488,46 +315,20 @@ if (import.meta.vitest !== undefined) { it("works with UnitConversionRate by UnitConversionRate", () => { assert< - Equals< - Divide< - UnitConversionRate<{ a: 1 }>, - UnitConversionRate<{ a: 1; b: 2 }> - >, - UnitConversionRate<{ b: -2 }> - > + Equals, UnitConversionRate<{ a: 1; b: 2 }>>, UnitConversionRate<{ b: -2 }>> >(); }); it("works with UnitConversionRate by number", () => { - assert< - Equals< - Divide, number>, - UnitConversionRate<{ a: 2; b: 2 }> - > - >(); + assert, number>, UnitConversionRate<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Divide>, - UnitConversionRate<{ a: -2; b: -2 }> - > - >(); + assert>, UnitConversionRate<{ a: -2; b: -2 }>>>(); }); it("works with UnitConversionRate by concrete number", () => { - assert< - Equals< - Divide, 2>, - UnitConversionRate<{ a: 2; b: 2 }> - > - >(); + assert, 2>, UnitConversionRate<{ a: 2; b: 2 }>>>(); - assert< - Equals< - Divide<2, UnitConversionRate<{ a: 2; b: 2 }>>, - UnitConversionRate<{ a: -2; b: -2 }> - > - >(); + assert>, UnitConversionRate<{ a: -2; b: -2 }>>>(); }); }); @@ -544,53 +345,19 @@ if (import.meta.vitest !== undefined) { it("works with AbstractUnit", () => { assert, 2>, AbstractUnit<{ a: 2 }>>>(); assert, 2>, AbstractUnit<{ a: 4 }>>>(); - assert< - Equals, 2>, AbstractUnit<{ a: -4 }>> - >(); + assert, 2>, AbstractUnit<{ a: -4 }>>>(); assert, 3>, AbstractUnit<{ a: 3 }>>>(); assert, 3>, AbstractUnit<{ a: 6 }>>>(); - assert< - Equals, 3>, AbstractUnit<{ a: -6 }>> - >(); + assert, 3>, AbstractUnit<{ a: -6 }>>>(); }); it("works with UnitConversionRate", () => { - assert< - Equals< - Pow, 2>, - UnitConversionRate<{ a: 2 }> - > - >(); - assert< - Equals< - Pow, 2>, - UnitConversionRate<{ a: 4 }> - > - >(); - assert< - Equals< - Pow, 2>, - UnitConversionRate<{ a: -4 }> - > - >(); - assert< - Equals< - Pow, 3>, - UnitConversionRate<{ a: 3 }> - > - >(); - assert< - Equals< - Pow, 3>, - UnitConversionRate<{ a: 6 }> - > - >(); - assert< - Equals< - Pow, 3>, - UnitConversionRate<{ a: -6 }> - > - >(); + assert, 2>, UnitConversionRate<{ a: 2 }>>>(); + assert, 2>, UnitConversionRate<{ a: 4 }>>>(); + assert, 2>, UnitConversionRate<{ a: -4 }>>>(); + assert, 3>, UnitConversionRate<{ a: 3 }>>>(); + assert, 3>, UnitConversionRate<{ a: 6 }>>>(); + assert, 3>, UnitConversionRate<{ a: -6 }>>>(); }); }); @@ -607,53 +374,19 @@ if (import.meta.vitest !== undefined) { it("works with AbstractUnit", () => { assert, 2>, AbstractUnit<{ a: 2 }>>>(); assert, 2>, AbstractUnit<{ a: 1 }>>>(); - assert< - Equals, 2>, AbstractUnit<{ a: -1 }>> - >(); + assert, 2>, AbstractUnit<{ a: -1 }>>>(); assert, 3>, AbstractUnit<{ a: 2 }>>>(); assert, 3>, AbstractUnit<{ a: 1 }>>>(); - assert< - Equals, 3>, AbstractUnit<{ a: -1 }>> - >(); + assert, 3>, AbstractUnit<{ a: -1 }>>>(); }); it("works with UnitConversionRate", () => { - assert< - Equals< - Root, 2>, - UnitConversionRate<{ a: 2 }> - > - >(); - assert< - Equals< - Root, 2>, - UnitConversionRate<{ a: 1 }> - > - >(); - assert< - Equals< - Root, 2>, - UnitConversionRate<{ a: -1 }> - > - >(); - assert< - Equals< - Root, 3>, - UnitConversionRate<{ a: 2 }> - > - >(); - assert< - Equals< - Root, 3>, - UnitConversionRate<{ a: 1 }> - > - >(); - assert< - Equals< - Root, 3>, - UnitConversionRate<{ a: -1 }> - > - >(); + assert, 2>, UnitConversionRate<{ a: 2 }>>>(); + assert, 2>, UnitConversionRate<{ a: 1 }>>>(); + assert, 2>, UnitConversionRate<{ a: -1 }>>>(); + assert, 3>, UnitConversionRate<{ a: 2 }>>>(); + assert, 3>, UnitConversionRate<{ a: 1 }>>>(); + assert, 3>, UnitConversionRate<{ a: -1 }>>>(); }); }); } diff --git a/src/units/base-units.ts b/src/units/base-units.ts index 1c1805430..24c01d7d6 100644 --- a/src/units/base-units.ts +++ b/src/units/base-units.ts @@ -1,19 +1,15 @@ // eslint-disable-next-line import/no-extraneous-dependencies import { type Equals, assert } from "tsafe"; -import { type Exponent, type Unit, type UnitClass } from "#uom-types"; +import type { + Exponent, + Unit, // eslint-disable-line ts/no-unused-vars + UnitClass, +} from "#uom-types"; -import { type Exactify } from "../utils"; +import type { Exactify } from "../utils"; -type SiUnitKeys = - | "Second" - | "Meter" - | "Kilogram" - | "Mole" - | "Ampere" - | "Candela" - | "Kelvin" - | "Radian"; +type SiUnitKeys = "Second" | "Meter" | "Kilogram" | "Mole" | "Ampere" | "Candela" | "Kelvin" | "Radian"; /** * The {@link UnitClass} that is the base of all {@link Unit}s defined by this library. @@ -35,14 +31,10 @@ if (import.meta.vitest !== undefined) { assert, BaseUnitClass<{}>>>(); assert, BaseUnitClass<{ Second: 1 }>>>(); assert, BaseUnitClass<{ Meter: 1 }>>>(); - assert< - Equals, BaseUnitClass<{ Kilogram: 1 }>> - >(); + assert, BaseUnitClass<{ Kilogram: 1 }>>>(); assert, BaseUnitClass<{ Mole: 1 }>>>(); assert, BaseUnitClass<{ Ampere: 1 }>>>(); - assert< - Equals, BaseUnitClass<{ Candela: 1 }>> - >(); + assert, BaseUnitClass<{ Candela: 1 }>>>(); assert, BaseUnitClass<{ Kelvin: 1 }>>>(); assert, BaseUnitClass<{ Radian: 1 }>>>(); }); diff --git a/src/units/common/angle-plane.ts b/src/units/common/angle-plane.ts index ea5ece0c9..258c57991 100644 --- a/src/units/common/angle-plane.ts +++ b/src/units/common/angle-plane.ts @@ -1,12 +1,6 @@ -import { - type UnknownUnitMeta, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -26,18 +20,13 @@ export type PlaneAngle = AbstractUnitFrom; * @group Unit Generators * @category Angle (Plane) */ -export type PlaneAngleUnit = PlaneAngleUnitFrom< - UnitMeta ->; +export type PlaneAngleUnit = PlaneAngleUnitFrom>; /** * @group Unit Generators * @category Angle (Plane) */ -export type PlaneAngleUnitFrom = UnitFrom< - PlaneAngleUnitClass, - M ->; +export type PlaneAngleUnitFrom = UnitFrom; /** * A unit of {@link PlaneAngle}. diff --git a/src/units/common/angle-solid.ts b/src/units/common/angle-solid.ts index fa6cc83ae..4bc37eb58 100644 --- a/src/units/common/angle-solid.ts +++ b/src/units/common/angle-solid.ts @@ -1,18 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Radian } from "."; +import type { Radian } from "."; /** * @group Unit Classes @@ -32,18 +26,13 @@ export type SolidAngle = AbstractUnitFrom; * @group Unit Generators * @category Angle (Solid) */ -export type SolidAngleUnit = SolidAngleUnitFrom< - UnitMeta ->; +export type SolidAngleUnit = SolidAngleUnitFrom>; /** * @group Unit Generators * @category Angle (Solid) */ -export type SolidAngleUnitFrom = UnitFrom< - SolidAngleUnitClass, - M ->; +export type SolidAngleUnitFrom = UnitFrom; /** * A unit of {@link SolidAngle}. diff --git a/src/units/common/chemical-amount-of-substance.ts b/src/units/common/chemical-amount-of-substance.ts index e6230def9..c40c6cdeb 100644 --- a/src/units/common/chemical-amount-of-substance.ts +++ b/src/units/common/chemical-amount-of-substance.ts @@ -1,12 +1,6 @@ -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -24,17 +18,13 @@ export type AmountOfSubstance = AbstractUnitFrom; * @group Unit Generators * @category Chemical */ -export type AmountOfSubstanceUnit = - AmountOfSubstanceUnitFrom>; +export type AmountOfSubstanceUnit = AmountOfSubstanceUnitFrom>; /** * @group Unit Generators * @category Chemical */ -export type AmountOfSubstanceUnitFrom = UnitFrom< - AmountOfSubstanceUnitClass, - M ->; +export type AmountOfSubstanceUnitFrom = UnitFrom; /** * A unit of {@link AmountOfSubstance}. diff --git a/src/units/common/chemical-catalytic-activity.ts b/src/units/common/chemical-catalytic-activity.ts index 1a5767ba6..49e7fcaba 100644 --- a/src/units/common/chemical-catalytic-activity.ts +++ b/src/units/common/chemical-catalytic-activity.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Mole, type Second } from "."; +import type { Mole, Second } from "."; /** * @group Unit Classes @@ -30,17 +23,13 @@ export type CatalyticActivity = AbstractUnitFrom; * @group Unit Generators * @category Chemical */ -export type CatalyticActivityUnit = - CatalyticActivityUnitFrom>; +export type CatalyticActivityUnit = CatalyticActivityUnitFrom>; /** * @group Unit Generators * @category Chemical */ -export type CatalyticActivityUnitFrom = UnitFrom< - CatalyticActivityUnitClass, - M ->; +export type CatalyticActivityUnitFrom = UnitFrom; /** * A unit of {@link CatalyticActivity}. diff --git a/src/units/common/chemical-concentration.ts b/src/units/common/chemical-concentration.ts index 45918334b..d6c7daead 100644 --- a/src/units/common/chemical-concentration.ts +++ b/src/units/common/chemical-concentration.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic } from "../modifiers"; -import { type Meter, type Liter, type Mole } from "."; +import type { Liter, Meter, Mole } from "."; /** * @group Unit Classes @@ -31,17 +24,13 @@ export type MolarConcentration = AbstractUnitFrom; * @group Unit Generators * @category Chemical */ -export type MolarConcentrationUnit = - MolarConcentrationUnitFrom>; +export type MolarConcentrationUnit = MolarConcentrationUnitFrom>; /** * @group Unit Generators * @category Chemical */ -export type MolarConcentrationUnitFrom = UnitFrom< - MolarConcentrationUnitClass, - M ->; +export type MolarConcentrationUnitFrom = UnitFrom; /** * A unit of {@link MolarConcentration}. diff --git a/src/units/common/electromagnetic-electrical-capacitance.ts b/src/units/common/electromagnetic-electrical-capacitance.ts index cb117b750..2a198a4fd 100644 --- a/src/units/common/electromagnetic-electrical-capacitance.ts +++ b/src/units/common/electromagnetic-electrical-capacitance.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Coulomb, type Volt } from "."; +import type { Coulomb, Volt } from "."; /** * @group Unit Classes @@ -29,24 +22,19 @@ export type ElectricCapacitanceUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricCapacitance = - AbstractUnitFrom; +export type ElectricCapacitance = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricCapacitanceUnit = - ElectricCapacitanceUnitFrom>; +export type ElectricCapacitanceUnit = ElectricCapacitanceUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricCapacitanceUnitFrom = UnitFrom< - ElectricCapacitanceUnitClass, - M ->; +export type ElectricCapacitanceUnitFrom = UnitFrom; /** * A unit of {@link ElectricCapacitance}. diff --git a/src/units/common/electromagnetic-electrical-charge-density.ts b/src/units/common/electromagnetic-electrical-charge-density.ts index 1ebf9f327..b07789893 100644 --- a/src/units/common/electromagnetic-electrical-charge-density.ts +++ b/src/units/common/electromagnetic-electrical-charge-density.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic } from "../modifiers"; -import { type Meter, type Coulomb } from "."; +import type { Coulomb, Meter } from "."; /** * @group Unit Classes @@ -29,24 +22,19 @@ export type ElectricChargeDensityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricChargeDensity = - AbstractUnitFrom; +export type ElectricChargeDensity = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricChargeDensityUnit = - ElectricChargeDensityUnitFrom>; +export type ElectricChargeDensityUnit = ElectricChargeDensityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricChargeDensityUnitFrom = UnitFrom< - ElectricChargeDensityUnitClass, - M ->; +export type ElectricChargeDensityUnitFrom = UnitFrom; /** * A unit of {@link ElectricChargeDensity}. diff --git a/src/units/common/electromagnetic-electrical-charge.ts b/src/units/common/electromagnetic-electrical-charge.ts index 36be27852..7b0360f6f 100644 --- a/src/units/common/electromagnetic-electrical-charge.ts +++ b/src/units/common/electromagnetic-electrical-charge.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Ampere, type Second } from "."; +import type { Ampere, Second } from "."; /** * @group Unit Classes @@ -33,17 +26,13 @@ export type ElectricCharge = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ElectricChargeUnit = - ElectricChargeUnitFrom>; +export type ElectricChargeUnit = ElectricChargeUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricChargeUnitFrom = UnitFrom< - ElectricChargeUnitClass, - M ->; +export type ElectricChargeUnitFrom = UnitFrom; /** * A unit of {@link ElectricCharge}. diff --git a/src/units/common/electromagnetic-electrical-conductance.ts b/src/units/common/electromagnetic-electrical-conductance.ts index f39b25d2b..2d024a679 100644 --- a/src/units/common/electromagnetic-electrical-conductance.ts +++ b/src/units/common/electromagnetic-electrical-conductance.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Ampere, type Volt } from "."; +import type { Ampere, Volt } from "."; /** * @group Unit Classes @@ -29,24 +22,19 @@ export type ElectricConductanceUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricConductance = - AbstractUnitFrom; +export type ElectricConductance = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricConductanceUnit = - ElectricConductanceUnitFrom>; +export type ElectricConductanceUnit = ElectricConductanceUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricConductanceUnitFrom = UnitFrom< - ElectricConductanceUnitClass, - M ->; +export type ElectricConductanceUnitFrom = UnitFrom; /** * A unit of {@link ElectricConductance}. diff --git a/src/units/common/electromagnetic-electrical-conductivity.ts b/src/units/common/electromagnetic-electrical-conductivity.ts index 1e6aab6ca..c68165669 100644 --- a/src/units/common/electromagnetic-electrical-conductivity.ts +++ b/src/units/common/electromagnetic-electrical-conductivity.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Siemens } from "."; +import type { Meter, Siemens } from "."; /** * @group Unit Classes @@ -29,22 +22,19 @@ export type ElectricalConductivityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricalConductivity = - AbstractUnitFrom; +export type ElectricalConductivity = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricalConductivityUnit = - ElectricalConductivityUnitFrom>; +export type ElectricalConductivityUnit = ElectricalConductivityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricalConductivityUnitFrom = - UnitFrom; +export type ElectricalConductivityUnitFrom = UnitFrom; /** * A unit of {@link ElectricalConductivity}. diff --git a/src/units/common/electromagnetic-electrical-current-density.ts b/src/units/common/electromagnetic-electrical-current-density.ts index 6a95c682c..581737f98 100644 --- a/src/units/common/electromagnetic-electrical-current-density.ts +++ b/src/units/common/electromagnetic-electrical-current-density.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Ampere } from "."; +import type { Ampere, Meter } from "."; /** * @group Unit Classes @@ -28,22 +21,19 @@ export type ElectricCurrentDensityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricCurrentDensity = - AbstractUnitFrom; +export type ElectricCurrentDensity = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricCurrentDensityUnit = - ElectricCurrentDensityUnitFrom>; +export type ElectricCurrentDensityUnit = ElectricCurrentDensityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricCurrentDensityUnitFrom = - UnitFrom; +export type ElectricCurrentDensityUnitFrom = UnitFrom; /** * A unit of {@link ElectricCurrentDensity}. diff --git a/src/units/common/electromagnetic-electrical-current.ts b/src/units/common/electromagnetic-electrical-current.ts index df18ef5ef..a66c9e5dd 100644 --- a/src/units/common/electromagnetic-electrical-current.ts +++ b/src/units/common/electromagnetic-electrical-current.ts @@ -1,12 +1,6 @@ -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -26,17 +20,13 @@ export type ElectricCurrent = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ElectricCurrentUnit = - ElectricCurrentUnitFrom>; +export type ElectricCurrentUnit = ElectricCurrentUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricCurrentUnitFrom = UnitFrom< - ElectricCurrentUnitClass, - M ->; +export type ElectricCurrentUnitFrom = UnitFrom; /** * A unit of {@link ElectricCurrent}. diff --git a/src/units/common/electromagnetic-electrical-displacement-field.ts b/src/units/common/electromagnetic-electrical-displacement-field.ts index 61abbf6d5..0cb3f71b3 100644 --- a/src/units/common/electromagnetic-electrical-displacement-field.ts +++ b/src/units/common/electromagnetic-electrical-displacement-field.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Coulomb } from "."; +import type { Coulomb, Meter } from "."; /** * @group Unit Classes @@ -29,22 +22,22 @@ export type ElectricDisplacementFieldUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricDisplacementField = - AbstractUnitFrom; +export type ElectricDisplacementField = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricDisplacementFieldUnit = - ElectricDisplacementFieldUnitFrom>; +export type ElectricDisplacementFieldUnit = ElectricDisplacementFieldUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricDisplacementFieldUnitFrom = - UnitFrom; +export type ElectricDisplacementFieldUnitFrom = UnitFrom< + ElectricDisplacementFieldUnitClass, + M +>; /** * A unit of {@link ElectricDisplacementField}. diff --git a/src/units/common/electromagnetic-electrical-field-strength.ts b/src/units/common/electromagnetic-electrical-field-strength.ts index 0b7ee253e..949046512 100644 --- a/src/units/common/electromagnetic-electrical-field-strength.ts +++ b/src/units/common/electromagnetic-electrical-field-strength.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Volt, type Meter } from "."; +import type { Meter, Volt } from "."; /** * @group Unit Classes @@ -29,24 +22,19 @@ export type ElectricFieldStrengthUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricFieldStrength = - AbstractUnitFrom; +export type ElectricFieldStrength = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricFieldStrengthUnit = - ElectricFieldStrengthUnitFrom>; +export type ElectricFieldStrengthUnit = ElectricFieldStrengthUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricFieldStrengthUnitFrom = UnitFrom< - ElectricFieldStrengthUnitClass, - M ->; +export type ElectricFieldStrengthUnitFrom = UnitFrom; /** * A unit of {@link ElectricFieldStrength}. diff --git a/src/units/common/electromagnetic-electrical-inductance.ts b/src/units/common/electromagnetic-electrical-inductance.ts index 893fec36d..8f263a78d 100644 --- a/src/units/common/electromagnetic-electrical-inductance.ts +++ b/src/units/common/electromagnetic-electrical-inductance.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Weber, type Second, type Ohm, type Ampere } from "."; +import type { Ampere, Ohm, Second, Weber } from "."; /** * @group Unit Classes @@ -36,17 +36,13 @@ export type ElectricInductance = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ElectricInductanceUnit = - ElectricInductanceUnitFrom>; +export type ElectricInductanceUnit = ElectricInductanceUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricInductanceUnitFrom = UnitFrom< - ElectricInductanceUnitClass, - M ->; +export type ElectricInductanceUnitFrom = UnitFrom; /** * A unit of {@link ElectricInductance}. diff --git a/src/units/common/electromagnetic-electrical-linear-charge-density.ts b/src/units/common/electromagnetic-electrical-linear-charge-density.ts index fb52c0b34..0d2843183 100644 --- a/src/units/common/electromagnetic-electrical-linear-charge-density.ts +++ b/src/units/common/electromagnetic-electrical-linear-charge-density.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Coulomb, type Meter } from "."; +import type { Coulomb, Meter } from "."; /** * @group Unit Classes @@ -28,22 +21,22 @@ export type ElectricLinearChargeDensityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type ElectricLinearChargeDensity = - AbstractUnitFrom; +export type ElectricLinearChargeDensity = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricLinearChargeDensityUnit = - ElectricLinearChargeDensityUnitFrom>; +export type ElectricLinearChargeDensityUnit = ElectricLinearChargeDensityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricLinearChargeDensityUnitFrom = - UnitFrom; +export type ElectricLinearChargeDensityUnitFrom = UnitFrom< + ElectricLinearChargeDensityUnitClass, + M +>; /** * A unit of {@link ElectricLinearChargeDensity}. diff --git a/src/units/common/electromagnetic-electrical-potential.ts b/src/units/common/electromagnetic-electrical-potential.ts index b64152533..046e4e4a4 100644 --- a/src/units/common/electromagnetic-electrical-potential.ts +++ b/src/units/common/electromagnetic-electrical-potential.ts @@ -1,27 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { - type Ampere, - type Coulomb, - type Joule, - type Ohm, - type Second, - type Watt, - type Weber, -} from "."; +import type { Ampere, Coulomb, Joule, Ohm, Second, Watt, Weber } from "."; /** * @group Unit Classes @@ -44,17 +36,13 @@ export type ElectricPotential = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ElectricPotentialUnit = - ElectricPotentialUnitFrom>; +export type ElectricPotentialUnit = ElectricPotentialUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricPotentialUnitFrom = UnitFrom< - ElectricPotentialUnitClass, - M ->; +export type ElectricPotentialUnitFrom = UnitFrom; /** * A unit of {@link ElectricPotential}. diff --git a/src/units/common/electromagnetic-electrical-resistance.ts b/src/units/common/electromagnetic-electrical-resistance.ts index 5b58f6905..09d167a5b 100644 --- a/src/units/common/electromagnetic-electrical-resistance.ts +++ b/src/units/common/electromagnetic-electrical-resistance.ts @@ -1,25 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Reciprocal } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Reciprocal } from "../modifiers"; -import { - type Ampere, - type Farad, - type Second, - type Siemens, - type Volt, -} from "."; +import type { Ampere, Farad, Second, Siemens, Volt } from "."; /** * @group Unit Classes @@ -42,17 +29,13 @@ export type ElectricResistance = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ElectricResistanceUnit = - ElectricResistanceUnitFrom>; +export type ElectricResistanceUnit = ElectricResistanceUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectricResistanceUnitFrom = UnitFrom< - ElectricResistanceUnitClass, - M ->; +export type ElectricResistanceUnitFrom = UnitFrom; /** * A unit of {@link ElectricResistance}. diff --git a/src/units/common/electromagnetic-electron-mobility.ts b/src/units/common/electromagnetic-electron-mobility.ts index bc5315af5..c2e2ac85f 100644 --- a/src/units/common/electromagnetic-electron-mobility.ts +++ b/src/units/common/electromagnetic-electron-mobility.ts @@ -1,20 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Volt, type Second } from "."; +import type { Meter, Second, Volt } from "."; /** * @group Unit Classes @@ -36,17 +36,13 @@ export type ElectronMobility = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ElectronMobilityUnit = - ElectronMobilityUnitFrom>; +export type ElectronMobilityUnit = ElectronMobilityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ElectronMobilityUnitFrom = UnitFrom< - ElectronMobilityUnitClass, - M ->; +export type ElectronMobilityUnitFrom = UnitFrom; /** * A unit of {@link ElectronMobility}. @@ -63,12 +59,7 @@ if (import.meta.vitest !== undefined) { describe("SquareMeterPerVoltSecond", () => { it("is square meters per volt second", () => { - assert< - Equals< - SquareMeterPerVoltSecond, - Divide, Multiply> - > - >(); + assert, Multiply>>>(); }); }); } diff --git a/src/units/common/electromagnetic-exposure.ts b/src/units/common/electromagnetic-exposure.ts index 41d5573ab..65bc220eb 100644 --- a/src/units/common/electromagnetic-exposure.ts +++ b/src/units/common/electromagnetic-exposure.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { type Gram, type Coulomb } from "."; +import type { Coulomb, Gram } from "."; /** * @group Unit Classes @@ -35,18 +28,13 @@ export type Exposure = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ExposureUnit = ExposureUnitFrom< - UnitMeta ->; +export type ExposureUnit = ExposureUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ExposureUnitFrom = UnitFrom< - ExposureUnitClass, - M ->; +export type ExposureUnitFrom = UnitFrom; /** * A unit of {@link Exposure}. diff --git a/src/units/common/electromagnetic-magnetic-dipole-moment.ts b/src/units/common/electromagnetic-magnetic-dipole-moment.ts index 1738c20ad..9fd05b92b 100644 --- a/src/units/common/electromagnetic-magnetic-dipole-moment.ts +++ b/src/units/common/electromagnetic-magnetic-dipole-moment.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Joule, type Tesla } from "."; +import type { Joule, Tesla } from "."; /** * @group Unit Classes @@ -27,24 +20,19 @@ export type MagneticDipoleMomentUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type MagneticDipoleMoment = - AbstractUnitFrom; +export type MagneticDipoleMoment = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticDipoleMomentUnit = - MagneticDipoleMomentUnitFrom>; +export type MagneticDipoleMomentUnit = MagneticDipoleMomentUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticDipoleMomentUnitFrom = UnitFrom< - MagneticDipoleMomentUnitClass, - M ->; +export type MagneticDipoleMomentUnitFrom = UnitFrom; /** * A unit of {@link MagneticDipoleMoment}. diff --git a/src/units/common/electromagnetic-magnetic-field-strength.ts b/src/units/common/electromagnetic-magnetic-field-strength.ts index e7670383d..317cccc17 100644 --- a/src/units/common/electromagnetic-magnetic-field-strength.ts +++ b/src/units/common/electromagnetic-magnetic-field-strength.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Ampere, type Meter } from "."; +import type { Ampere, Meter } from "."; /** * @group Unit Classes @@ -27,24 +20,19 @@ export type MagneticFieldStrengthUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type MagneticFieldStrength = - AbstractUnitFrom; +export type MagneticFieldStrength = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticFieldStrengthUnit = - MagneticFieldStrengthUnitFrom>; +export type MagneticFieldStrengthUnit = MagneticFieldStrengthUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticFieldStrengthUnitFrom = UnitFrom< - MagneticFieldStrengthUnitClass, - M ->; +export type MagneticFieldStrengthUnitFrom = UnitFrom; /** * A unit of {@link MagneticFieldStrength}. diff --git a/src/units/common/electromagnetic-magnetic-flux-density.ts b/src/units/common/electromagnetic-magnetic-flux-density.ts index 9e7a9561c..c50674911 100644 --- a/src/units/common/electromagnetic-magnetic-flux-density.ts +++ b/src/units/common/electromagnetic-magnetic-flux-density.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Weber } from "."; +import type { Meter, Weber } from "."; /** * @group Unit Classes @@ -29,24 +22,19 @@ export type MagneticFluxDensityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type MagneticFluxDensity = - AbstractUnitFrom; +export type MagneticFluxDensity = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticFluxDensityUnit = - MagneticFluxDensityUnitFrom>; +export type MagneticFluxDensityUnit = MagneticFluxDensityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticFluxDensityUnitFrom = UnitFrom< - MagneticFluxDensityUnitClass, - M ->; +export type MagneticFluxDensityUnitFrom = UnitFrom; /** * A unit of {@link MagneticFluxDensity}. diff --git a/src/units/common/electromagnetic-magnetic-flux.ts b/src/units/common/electromagnetic-magnetic-flux.ts index 35cf50eb0..5a227323a 100644 --- a/src/units/common/electromagnetic-magnetic-flux.ts +++ b/src/units/common/electromagnetic-magnetic-flux.ts @@ -1,26 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { - type Meter, - type Ampere, - type Henry, - type Second, - type Tesla, - type Volt, -} from "."; +import type { Ampere, Henry, Meter, Second, Tesla, Volt } from "."; /** * @group Unit Classes @@ -43,18 +29,13 @@ export type MagneticFlux = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type MagneticFluxUnit = MagneticFluxUnitFrom< - UnitMeta ->; +export type MagneticFluxUnit = MagneticFluxUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticFluxUnitFrom = UnitFrom< - MagneticFluxUnitClass, - M ->; +export type MagneticFluxUnitFrom = UnitFrom; /** * A unit of {@link MagneticFlux}. diff --git a/src/units/common/electromagnetic-magnetic-moment.ts b/src/units/common/electromagnetic-magnetic-moment.ts index 7a1dbddfc..c0b6c9c22 100644 --- a/src/units/common/electromagnetic-magnetic-moment.ts +++ b/src/units/common/electromagnetic-magnetic-moment.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Weber } from "."; +import type { Meter, Weber } from "."; /** * @group Unit Classes @@ -35,17 +28,13 @@ export type MagneticMoment = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type MagneticMomentUnit = - MagneticMomentUnitFrom>; +export type MagneticMomentUnit = MagneticMomentUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticMomentUnitFrom = UnitFrom< - MagneticMomentUnitClass, - M ->; +export type MagneticMomentUnitFrom = UnitFrom; /** * A unit of {@link MagneticMoment}. diff --git a/src/units/common/electromagnetic-magnetic-permeability.ts b/src/units/common/electromagnetic-magnetic-permeability.ts index ec7f3f69f..2c95ef3e3 100644 --- a/src/units/common/electromagnetic-magnetic-permeability.ts +++ b/src/units/common/electromagnetic-magnetic-permeability.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Henry } from "."; +import type { Henry, Meter } from "."; /** * @group Unit Classes @@ -29,24 +22,19 @@ export type MagneticPermeabilityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type MagneticPermeability = - AbstractUnitFrom; +export type MagneticPermeability = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticPermeabilityUnit = - MagneticPermeabilityUnitFrom>; +export type MagneticPermeabilityUnit = MagneticPermeabilityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticPermeabilityUnitFrom = UnitFrom< - MagneticPermeabilityUnitClass, - M ->; +export type MagneticPermeabilityUnitFrom = UnitFrom; /** * A unit of {@link MagneticPermeability}. diff --git a/src/units/common/electromagnetic-magnetic-reluctance.ts b/src/units/common/electromagnetic-magnetic-reluctance.ts index 4065cc439..25eb777d3 100644 --- a/src/units/common/electromagnetic-magnetic-reluctance.ts +++ b/src/units/common/electromagnetic-magnetic-reluctance.ts @@ -1,24 +1,18 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Reciprocal } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Reciprocal } from "../modifiers"; -import { type ElectricInductance, type ElectricInductanceUnitClass } from "."; +import type { ElectricInductance, ElectricInductanceUnitClass } from "."; /** * @group Unit Classes * @category Electromagnetic */ -export type MagneticReluctanceUnitClass = - Reciprocal; +export type MagneticReluctanceUnitClass = Reciprocal; /** * @group Abstract Units @@ -30,17 +24,13 @@ export type MagneticReluctance = Reciprocal; * @group Unit Generators * @category Electromagnetic */ -export type MagneticReluctanceUnit = - MagneticReluctanceUnitFrom>; +export type MagneticReluctanceUnit = MagneticReluctanceUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticReluctanceUnitFrom = UnitFrom< - MagneticReluctanceUnitClass, - M ->; +export type MagneticReluctanceUnitFrom = UnitFrom; // Tests if (import.meta.vitest !== undefined) { diff --git a/src/units/common/electromagnetic-magnetic-rigidity.ts b/src/units/common/electromagnetic-magnetic-rigidity.ts index 3cc8e8951..71ce534f4 100644 --- a/src/units/common/electromagnetic-magnetic-rigidity.ts +++ b/src/units/common/electromagnetic-magnetic-rigidity.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Tesla, type Meter } from "."; +import type { Meter, Tesla } from "."; /** * @group Unit Classes @@ -35,17 +28,13 @@ export type MagneticRigidity = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type MagneticRigidityUnit = - MagneticRigidityUnitFrom>; +export type MagneticRigidityUnit = MagneticRigidityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticRigidityUnitFrom = UnitFrom< - MagneticRigidityUnitClass, - M ->; +export type MagneticRigidityUnitFrom = UnitFrom; /** * A unit of {@link MagneticRigidity}. diff --git a/src/units/common/electromagnetic-magnetic-susceptibility.ts b/src/units/common/electromagnetic-magnetic-susceptibility.ts index ec206592d..eff474fe7 100644 --- a/src/units/common/electromagnetic-magnetic-susceptibility.ts +++ b/src/units/common/electromagnetic-magnetic-susceptibility.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Henry } from "."; +import type { Henry, Meter } from "."; /** * @group Unit Classes @@ -29,22 +22,19 @@ export type MagneticSusceptibilityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type MagneticSusceptibility = - AbstractUnitFrom; +export type MagneticSusceptibility = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticSusceptibilityUnit = - MagneticSusceptibilityUnitFrom>; +export type MagneticSusceptibilityUnit = MagneticSusceptibilityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticSusceptibilityUnitFrom = - UnitFrom; +export type MagneticSusceptibilityUnitFrom = UnitFrom; /** * A unit of {@link MagneticSusceptibility}. diff --git a/src/units/common/electromagnetic-magnetic-vector-potential.ts b/src/units/common/electromagnetic-magnetic-vector-potential.ts index 6c68546cb..551915c78 100644 --- a/src/units/common/electromagnetic-magnetic-vector-potential.ts +++ b/src/units/common/electromagnetic-magnetic-vector-potential.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Weber, type Meter } from "."; +import type { Meter, Weber } from "."; /** * @group Unit Classes @@ -29,22 +22,19 @@ export type MagneticVectorPotentialUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Electromagnetic */ -export type MagneticVectorPotential = - AbstractUnitFrom; +export type MagneticVectorPotential = AbstractUnitFrom; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticVectorPotentialUnit = - MagneticVectorPotentialUnitFrom>; +export type MagneticVectorPotentialUnit = MagneticVectorPotentialUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagneticVectorPotentialUnitFrom = - UnitFrom; +export type MagneticVectorPotentialUnitFrom = UnitFrom; /** * A unit of {@link MagneticVectorPotential}. diff --git a/src/units/common/electromagnetic-magnetomotive-force.ts b/src/units/common/electromagnetic-magnetomotive-force.ts index bc186d28a..7d8970001 100644 --- a/src/units/common/electromagnetic-magnetomotive-force.ts +++ b/src/units/common/electromagnetic-magnetomotive-force.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Ampere, type Radian } from "."; +import type { Ampere, Radian } from "."; /** * @group Unit Classes @@ -33,17 +26,13 @@ export type MagnetomotiveForce = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type MagnetomotiveForceUnit = - MagnetomotiveForceUnitFrom>; +export type MagnetomotiveForceUnit = MagnetomotiveForceUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type MagnetomotiveForceUnitFrom = UnitFrom< - MagnetomotiveForceUnitClass, - M ->; +export type MagnetomotiveForceUnitFrom = UnitFrom; /** * A unit of {@link MagnetomotiveForce}. diff --git a/src/units/common/electromagnetic-permittivity.ts b/src/units/common/electromagnetic-permittivity.ts index d7e9295ce..363c0c283 100644 --- a/src/units/common/electromagnetic-permittivity.ts +++ b/src/units/common/electromagnetic-permittivity.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Farad, type Meter } from "."; +import type { Farad, Meter } from "."; /** * @group Unit Classes @@ -35,18 +28,13 @@ export type Permittivity = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type PermittivityUnit = PermittivityUnitFrom< - UnitMeta ->; +export type PermittivityUnit = PermittivityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type PermittivityUnitFrom = UnitFrom< - PermittivityUnitClass, - M ->; +export type PermittivityUnitFrom = UnitFrom; /** * A unit of {@link Permittivity}. diff --git a/src/units/common/electromagnetic-resistivity.ts b/src/units/common/electromagnetic-resistivity.ts index bd2ac081f..d9893b4b3 100644 --- a/src/units/common/electromagnetic-resistivity.ts +++ b/src/units/common/electromagnetic-resistivity.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Ohm, type Meter } from "."; +import type { Meter, Ohm } from "."; /** * @group Unit Classes @@ -35,18 +28,13 @@ export type Resistivity = AbstractUnitFrom; * @group Unit Generators * @category Electromagnetic */ -export type ResistivityUnit = ResistivityUnitFrom< - UnitMeta ->; +export type ResistivityUnit = ResistivityUnitFrom>; /** * @group Unit Generators * @category Electromagnetic */ -export type ResistivityUnitFrom = UnitFrom< - ResistivityUnitClass, - M ->; +export type ResistivityUnitFrom = UnitFrom; /** * A unit of {@link Resistivity}. diff --git a/src/units/common/identity.ts b/src/units/common/identity.ts index e584f397e..6e981ac22 100644 --- a/src/units/common/identity.ts +++ b/src/units/common/identity.ts @@ -1,13 +1,13 @@ -import { - type AbstractUnitFrom, - type Unit, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Unit, // eslint-disable-line ts/no-unused-vars + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -22,17 +22,12 @@ export type Identity = AbstractUnitFrom; /** * @group Unit Generators */ -export type IdentityUnit = IdentityUnitFrom< - UnitMeta ->; +export type IdentityUnit = IdentityUnitFrom>; /** * @group Unit Generators */ -export type IdentityUnitFrom = UnitFrom< - IdentityUnitClass, - M ->; +export type IdentityUnitFrom = UnitFrom; /** * A {@link Unit} with no units. diff --git a/src/units/common/kinematic-acceleration.ts b/src/units/common/kinematic-acceleration.ts index a3af845a3..218556216 100644 --- a/src/units/common/kinematic-acceleration.ts +++ b/src/units/common/kinematic-acceleration.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type MeterPerSecond, type Second } from "."; +import type { Meter, MeterPerSecond, Second } from "."; /** * @group Unit Classes @@ -31,18 +24,13 @@ export type Acceleration = AbstractUnitFrom; * @group Unit Generators * @category Kinematic */ -export type AccelerationUnit = AccelerationUnitFrom< - UnitMeta ->; +export type AccelerationUnit = AccelerationUnitFrom>; /** * @group Unit Generators * @category Kinematic */ -export type AccelerationUnitFrom = UnitFrom< - AccelerationUnitClass, - M ->; +export type AccelerationUnitFrom = UnitFrom; /** * A unit of {@link Acceleration}. diff --git a/src/units/common/kinematic-angular-acceleration.ts b/src/units/common/kinematic-angular-acceleration.ts index 172d5fb60..f8eab21ff 100644 --- a/src/units/common/kinematic-angular-acceleration.ts +++ b/src/units/common/kinematic-angular-acceleration.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Radian, type Second, type RadianPerSecond } from "."; +import type { Radian, RadianPerSecond, Second } from "."; /** * @group Unit Classes @@ -28,24 +21,19 @@ export type AngularAccelerationUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Kinematic */ -export type AngularAcceleration = - AbstractUnitFrom; +export type AngularAcceleration = AbstractUnitFrom; /** * @group Unit Generators * @category Kinematic */ -export type AngularAccelerationUnit = - AngularAccelerationUnitFrom>; +export type AngularAccelerationUnit = AngularAccelerationUnitFrom>; /** * @group Unit Generators * @category Kinematic */ -export type AngularAccelerationUnitFrom = UnitFrom< - AngularAccelerationUnitClass, - M ->; +export type AngularAccelerationUnitFrom = UnitFrom; /** * A unit of {@link AngularAcceleration}. diff --git a/src/units/common/kinematic-angular-momentum.ts b/src/units/common/kinematic-angular-momentum.ts index ecdf3ec06..8897e6806 100644 --- a/src/units/common/kinematic-angular-momentum.ts +++ b/src/units/common/kinematic-angular-momentum.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Second, type Joule, type Radian } from "."; +import type { Joule, Radian, Second } from "."; /** * @group Unit Classes @@ -36,17 +36,13 @@ export type AngularMomentum = AbstractUnitFrom; * @group Unit Generators * @category Kinematic */ -export type AngularMomentumUnit = - AngularMomentumUnitFrom>; +export type AngularMomentumUnit = AngularMomentumUnitFrom>; /** * @group Unit Generators * @category Kinematic */ -export type AngularMomentumUnitFrom = UnitFrom< - AngularMomentumUnitClass, - M ->; +export type AngularMomentumUnitFrom = UnitFrom; /** * A unit of {@link AngularMomentum}. @@ -63,9 +59,7 @@ if (import.meta.vitest !== undefined) { describe("JouleSecondPerRadian", () => { it("is joules by seconds per radian", () => { - assert< - Equals, Radian>> - >(); + assert, Radian>>>(); }); }); } diff --git a/src/units/common/kinematic-angular-velocity.ts b/src/units/common/kinematic-angular-velocity.ts index cd11d7bbc..4fd7ea976 100644 --- a/src/units/common/kinematic-angular-velocity.ts +++ b/src/units/common/kinematic-angular-velocity.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Radian, type Second, type RadianPerSecondSquared } from "."; +import type { Radian, RadianPerSecondSquared, Second } from "."; /** * @group Unit Classes @@ -34,17 +34,13 @@ export type AngularVelocity = AbstractUnitFrom; * @group Unit Generators * @category Kinematic */ -export type AngularVelocityUnit = - AngularVelocityUnitFrom>; +export type AngularVelocityUnit = AngularVelocityUnitFrom>; /** * @group Unit Generators * @category Kinematic */ -export type AngularVelocityUnitFrom = UnitFrom< - AngularVelocityUnitClass, - M ->; +export type AngularVelocityUnitFrom = UnitFrom; /** * A unit of {@link AngularVelocity}. @@ -65,9 +61,7 @@ if (import.meta.vitest !== undefined) { }); it("is radian per squared second by seconds", () => { - assert< - Equals> - >(); + assert>>(); }); }); } diff --git a/src/units/common/kinematic-crackle.ts b/src/units/common/kinematic-crackle.ts index 65fed9db5..fe526426d 100644 --- a/src/units/common/kinematic-crackle.ts +++ b/src/units/common/kinematic-crackle.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Second, type MeterPerSecondToTheFourth } from "."; +import type { MeterPerSecondToTheFourth, Second } from "."; /** * @group Unit Classes @@ -36,10 +29,7 @@ export type CrackleUnit = CrackleUnitFrom>; * @group Unit Generators * @category Kinematic */ -export type CrackleUnitFrom = UnitFrom< - CrackleUnitClass, - M ->; +export type CrackleUnitFrom = UnitFrom; /** * A unit of {@link Crackle}. @@ -56,12 +46,7 @@ if (import.meta.vitest !== undefined) { describe("MeterPerSecondToTheFifth", () => { it("is MeterPerSecondToTheFourth per second", () => { - assert< - Equals< - MeterPerSecondToTheFifth, - Divide - > - >(); + assert>>(); }); }); } diff --git a/src/units/common/kinematic-frequency-drift.ts b/src/units/common/kinematic-frequency-drift.ts index fbfa69458..a29b84e6e 100644 --- a/src/units/common/kinematic-frequency-drift.ts +++ b/src/units/common/kinematic-frequency-drift.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Hertz, type Second } from "."; +import type { Hertz, Second } from "."; /** * @group Unit Classes @@ -30,17 +23,13 @@ export type FrequencyDrift = AbstractUnitFrom; * @group Unit Generators * @category Kinematic */ -export type FrequencyDriftUnit = - FrequencyDriftUnitFrom>; +export type FrequencyDriftUnit = FrequencyDriftUnitFrom>; /** * @group Unit Generators * @category Kinematic */ -export type FrequencyDriftUnitFrom = UnitFrom< - FrequencyDriftUnitClass, - M ->; +export type FrequencyDriftUnitFrom = UnitFrom; /** * A unit of {@link FrequencyDrift} equal to one hertz per second. diff --git a/src/units/common/kinematic-frequency.ts b/src/units/common/kinematic-frequency.ts index 659c67b68..7cb1e000b 100644 --- a/src/units/common/kinematic-frequency.ts +++ b/src/units/common/kinematic-frequency.ts @@ -1,26 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; - -import { - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; - -import { type BaseUnitClass } from "../base-units"; -import { type Reciprocal } from "../modifiers"; - -import { - type Duration, - type DurationUnitClass, - type Day, - type Hour, - type Minute, - type Week, - type Year, - type Second, -} from "."; +import { type Equals, assert } from "tsafe"; + +import type { UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; + +import type { BaseUnitClass } from "../base-units"; +import type { Reciprocal } from "../modifiers"; + +import type { Day, Duration, DurationUnitClass, Hour, Minute, Second, Week, Year } from "."; /** * @group Unit Classes @@ -38,18 +24,13 @@ export type Frequency = Reciprocal; * @group Unit Generators * @category Kinematic */ -export type FrequencyUnit = FrequencyUnitFrom< - UnitMeta ->; +export type FrequencyUnit = FrequencyUnitFrom>; /** * @group Unit Generators * @category Kinematic */ -export type FrequencyUnitFrom = UnitFrom< - FrequencyUnitClass, - M ->; +export type FrequencyUnitFrom = UnitFrom; /** * A unit of {@link Frequency}. diff --git a/src/units/common/kinematic-jerk.ts b/src/units/common/kinematic-jerk.ts index 45f8df185..ce2b2fa23 100644 --- a/src/units/common/kinematic-jerk.ts +++ b/src/units/common/kinematic-jerk.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Second, type MeterPerSecondSquared } from "."; +import type { MeterPerSecondSquared, Second } from "."; /** * @group Unit Classes @@ -36,10 +29,7 @@ export type JerkUnit = JerkUnitFrom>; * @group Unit Generators * @category Kinematic */ -export type JerkUnitFrom = UnitFrom< - JerkUnitClass, - M ->; +export type JerkUnitFrom = UnitFrom; /** * A unit of {@link Jerk}. @@ -56,9 +46,7 @@ if (import.meta.vitest !== undefined) { describe("MeterPerSecondCubed", () => { it("is meters per squared second per second", () => { - assert< - Equals> - >(); + assert>>(); }); }); } diff --git a/src/units/common/kinematic-pop.ts b/src/units/common/kinematic-pop.ts index 1f999df42..1b7df1d38 100644 --- a/src/units/common/kinematic-pop.ts +++ b/src/units/common/kinematic-pop.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type MeterPerSecondToTheFifth, type Second } from "."; +import type { MeterPerSecondToTheFifth, Second } from "."; /** * @group Unit Classes @@ -53,12 +46,7 @@ if (import.meta.vitest !== undefined) { describe("MeterPerSecondToTheSixth", () => { it("is MeterPerSecondToTheFifth per second", () => { - assert< - Equals< - MeterPerSecondToTheSixth, - Divide - > - >(); + assert>>(); }); }); } diff --git a/src/units/common/kinematic-snap.ts b/src/units/common/kinematic-snap.ts index 84778cec7..0de748fd5 100644 --- a/src/units/common/kinematic-snap.ts +++ b/src/units/common/kinematic-snap.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type MeterPerSecondCubed, type Second } from "."; +import type { MeterPerSecondCubed, Second } from "."; /** * @group Unit Classes @@ -36,10 +29,7 @@ export type SnapUnit = SnapUnitFrom>; * @group Unit Generators * @category Kinematic */ -export type SnapUnitFrom = UnitFrom< - SnapUnitClass, - M ->; +export type SnapUnitFrom = UnitFrom; /** * A unit of {@link Snap}. @@ -56,9 +46,7 @@ if (import.meta.vitest !== undefined) { describe("MeterPerSecondToTheFourth", () => { it("is MeterPerSecondCubed per second", () => { - assert< - Equals> - >(); + assert>>(); }); }); } diff --git a/src/units/common/kinematic-torque.ts b/src/units/common/kinematic-torque.ts index 72fc4959f..c5e1407c2 100644 --- a/src/units/common/kinematic-torque.ts +++ b/src/units/common/kinematic-torque.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Newton, type NewtonMeter, type Radian } from "."; +import type { Meter, Newton, NewtonMeter, Radian } from "."; /** * @group Unit Classes @@ -42,10 +42,7 @@ export type TorqueUnit = TorqueUnitFrom>; * @group Unit Generators * @category Kinematic */ -export type TorqueUnitFrom = UnitFrom< - TorqueUnitClass, - M ->; +export type TorqueUnitFrom = UnitFrom; /** * A unit of {@link Torque}. @@ -75,9 +72,7 @@ if (import.meta.vitest !== undefined) { }); it("is newton by meters per radians", () => { - assert< - Equals, Radian>> - >(); + assert, Radian>>>(); }); }); } diff --git a/src/units/common/kinematic-velocity.ts b/src/units/common/kinematic-velocity.ts index 80f199eaa..3ffca43c4 100644 --- a/src/units/common/kinematic-velocity.ts +++ b/src/units/common/kinematic-velocity.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Second, type MeterPerSecondSquared } from "."; +import type { Meter, MeterPerSecondSquared, Second } from "."; /** * @group Unit Classes @@ -34,18 +34,13 @@ export type Velocity = AbstractUnitFrom; * @group Unit Generators * @category Kinematic */ -export type VelocityUnit = VelocityUnitFrom< - UnitMeta ->; +export type VelocityUnit = VelocityUnitFrom>; /** * @group Unit Generators * @category Kinematic */ -export type VelocityUnitFrom = UnitFrom< - VelocityUnitClass, - M ->; +export type VelocityUnitFrom = UnitFrom; /** * A unit of {@link Velocity}. diff --git a/src/units/common/kinematic-volumetric-flow.ts b/src/units/common/kinematic-volumetric-flow.ts index 89bcff78d..dfdf2ba5d 100644 --- a/src/units/common/kinematic-volumetric-flow.ts +++ b/src/units/common/kinematic-volumetric-flow.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic } from "../modifiers"; -import { type Meter, type Second } from "."; +import type { Meter, Second } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type VolumetricFlow = AbstractUnitFrom; * @group Unit Classes * @category Kinematic */ -export type VolumetricFlowUnit = - VolumetricFlowUnitFrom>; +export type VolumetricFlowUnit = VolumetricFlowUnitFrom>; /** * @group Unit Classes * @category Kinematic */ -export type VolumetricFlowUnitFrom = UnitFrom< - VolumetricFlowUnitClass, - M ->; +export type VolumetricFlowUnitFrom = UnitFrom; /** * A unit of {@link VolumetricFlow}. diff --git a/src/units/common/mechanical-absorbed-dose-rate.ts b/src/units/common/mechanical-absorbed-dose-rate.ts index d2fe9a13c..cd57ebfe2 100644 --- a/src/units/common/mechanical-absorbed-dose-rate.ts +++ b/src/units/common/mechanical-absorbed-dose-rate.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Gray, type Second } from "."; +import type { Gray, Second } from "."; /** * @group Unit Classes @@ -33,17 +26,13 @@ export type AbsorbedDoseRate = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type AbsorbedDoseRateUnit = - AbsorbedDoseRateUnitFrom>; +export type AbsorbedDoseRateUnit = AbsorbedDoseRateUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type AbsorbedDoseRateUnitFrom = UnitFrom< - AbsorbedDoseRateUnitClass, - M ->; +export type AbsorbedDoseRateUnitFrom = UnitFrom; /** * A unit of {@link AbsorbedDoseRate}. diff --git a/src/units/common/mechanical-action.ts b/src/units/common/mechanical-action.ts index 59580dadc..828063803 100644 --- a/src/units/common/mechanical-action.ts +++ b/src/units/common/mechanical-action.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, - type Multiply, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Joule, type Second } from "."; +import type { Joule, Second } from "."; /** * @group Unit Classes @@ -40,10 +33,7 @@ export type ActionUnit = ActionUnitFrom>; * @group Unit Generators * @category Mechanical */ -export type ActionUnitFrom = UnitFrom< - ActionUnitClass, - M ->; +export type ActionUnitFrom = UnitFrom; /** * A unit of {@link Action}. diff --git a/src/units/common/mechanical-angular-momentum-specific.ts b/src/units/common/mechanical-angular-momentum-specific.ts index 7101e4f59..c13b0f4d4 100644 --- a/src/units/common/mechanical-angular-momentum-specific.ts +++ b/src/units/common/mechanical-angular-momentum-specific.ts @@ -1,27 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type Multiply, - type UnknownUnitMeta, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { - type Gram, - type Meter, - type Newton, - type Second, - type Joule, - type Radian, -} from "."; +import type { Gram, Joule, Meter, Newton, Radian, Second } from "."; /** * @group Unit Classes @@ -37,22 +30,19 @@ export type SpecificAngularMomentumUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Mechanical */ -export type SpecificAngularMomentum = - AbstractUnitFrom; +export type SpecificAngularMomentum = AbstractUnitFrom; /** * @group Unit Generators * @category Mechanical */ -export type SpecificAngularMomentumUnit = - SpecificAngularMomentumUnitFrom>; +export type SpecificAngularMomentumUnit = SpecificAngularMomentumUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type SpecificAngularMomentumUnitFrom = - UnitFrom; +export type SpecificAngularMomentumUnitFrom = UnitFrom; /** * A unit of {@link SpecificAngularMomentum}. @@ -70,8 +60,7 @@ export type JouleSecondPerRadianPerKilogram = SpecificAngularMomentumUnit<{}>; * @category Mechanical * @symbol `Nâ‹…mâ‹…s/rad/kg` */ -export type NewtonMeterSecondPerRadianPerKilogram = - JouleSecondPerRadianPerKilogram; +export type NewtonMeterSecondPerRadianPerKilogram = JouleSecondPerRadianPerKilogram; // Tests if (import.meta.vitest !== undefined) { @@ -79,12 +68,7 @@ if (import.meta.vitest !== undefined) { describe("JouleSecondPerRadianPerKilogram", () => { it("is joules by second per radian per kilogram", () => { - assert< - Equals< - JouleSecondPerRadianPerKilogram, - Divide, Radian>, Kilo> - > - >(); + assert, Radian>, Kilo>>>(); }); }); @@ -93,10 +77,7 @@ if (import.meta.vitest !== undefined) { assert< Equals< NewtonMeterSecondPerRadianPerKilogram, - Divide< - Divide, Second>, Radian>, - Kilo - > + Divide, Second>, Radian>, Kilo> > >(); }); diff --git a/src/units/common/mechanical-area.ts b/src/units/common/mechanical-area.ts index 91da7135c..ba83f290d 100644 --- a/src/units/common/mechanical-area.ts +++ b/src/units/common/mechanical-area.ts @@ -1,20 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Cubic, type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic, Square } from "../modifiers"; -import { type Meter } from "."; +import type { Meter } from "."; /** * @group Unit Classes @@ -38,10 +38,7 @@ export type AreaUnit = AreaUnitFrom>; * @group Unit Generators * @category Mechanical */ -export type AreaUnitFrom = UnitFrom< - AreaUnitClass, - M ->; +export type AreaUnitFrom = UnitFrom; /** * A unit of {@link Area} equal to 100 {@link Square}<{@link Meter}>. diff --git a/src/units/common/mechanical-compressibility.ts b/src/units/common/mechanical-compressibility.ts index 2ded6ce68..e60657050 100644 --- a/src/units/common/mechanical-compressibility.ts +++ b/src/units/common/mechanical-compressibility.ts @@ -1,17 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Reciprocal } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Reciprocal } from "../modifiers"; -import { type PressureUnitClass, type Pressure } from "."; +import type { Pressure, PressureUnitClass } from "."; /** * @group Unit Classes @@ -29,17 +24,13 @@ export type Compressibility = Reciprocal; * @group Unit Generators * @category Mechanical */ -export type CompressibilityUnit = - CompressibilityUnitFrom>; +export type CompressibilityUnit = CompressibilityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type CompressibilityUnitFrom = UnitFrom< - CompressibilityUnitClass, - M ->; +export type CompressibilityUnitFrom = UnitFrom; // Tests if (import.meta.vitest !== undefined) { diff --git a/src/units/common/mechanical-density.ts b/src/units/common/mechanical-density.ts index 48a2d0690..07e6afe55 100644 --- a/src/units/common/mechanical-density.ts +++ b/src/units/common/mechanical-density.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo, type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic, Kilo } from "../modifiers"; -import { type Gram, type Meter } from "."; +import type { Gram, Meter } from "."; /** * @group Unit Classes @@ -37,10 +30,7 @@ export type DensityUnit = DensityUnitFrom>; * @group Unit Generators * @category Mechanical */ -export type DensityUnitFrom = UnitFrom< - DensityUnitClass, - M ->; +export type DensityUnitFrom = UnitFrom; /** * A unit of {@link Density}. diff --git a/src/units/common/mechanical-dynamic-viscosity.ts b/src/units/common/mechanical-dynamic-viscosity.ts index 9b02927c0..ef644cc31 100644 --- a/src/units/common/mechanical-dynamic-viscosity.ts +++ b/src/units/common/mechanical-dynamic-viscosity.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Second, type Pascal } from "."; +import type { Pascal, Second } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type DynamicViscosity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type DynamicViscosityUnit = - DynamicViscosityUnitFrom>; +export type DynamicViscosityUnit = DynamicViscosityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type DynamicViscosityUnitFrom = UnitFrom< - DynamicViscosityUnitClass, - M ->; +export type DynamicViscosityUnitFrom = UnitFrom; /** * A unit of {@link DynamicViscosity}. diff --git a/src/units/common/mechanical-energy-density.ts b/src/units/common/mechanical-energy-density.ts index 66e594c41..3d0dc246a 100644 --- a/src/units/common/mechanical-energy-density.ts +++ b/src/units/common/mechanical-energy-density.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic } from "../modifiers"; -import { type Meter, type Joule } from "."; +import type { Joule, Meter } from "."; /** * @group Unit Classes @@ -35,18 +28,13 @@ export type EnergyDensity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type EnergyDensityUnit = EnergyDensityUnitFrom< - UnitMeta ->; +export type EnergyDensityUnit = EnergyDensityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type EnergyDensityUnitFrom = UnitFrom< - EnergyDensityUnitClass, - M ->; +export type EnergyDensityUnitFrom = UnitFrom; /** * A unit of {@link EnergyDensity}. diff --git a/src/units/common/mechanical-energy-flux-density.ts b/src/units/common/mechanical-energy-flux-density.ts index 9fc184bda..10915a850 100644 --- a/src/units/common/mechanical-energy-flux-density.ts +++ b/src/units/common/mechanical-energy-flux-density.ts @@ -1,20 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Joule, type Second } from "."; +import type { Joule, Meter, Second } from "."; /** * @group Unit Classes @@ -35,17 +35,13 @@ export type EnergyFluxDensity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type EnergyFluxDensityUnit = - EnergyFluxDensityUnitFrom>; +export type EnergyFluxDensityUnit = EnergyFluxDensityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type EnergyFluxDensityUnitFrom = UnitFrom< - EnergyFluxDensityUnitClass, - M ->; +export type EnergyFluxDensityUnitFrom = UnitFrom; /** * A unit of {@link EnergyFluxDensity}. @@ -62,12 +58,7 @@ if (import.meta.vitest !== undefined) { describe("JoulePerSquareMeterSecond", () => { it("is joules per (square meters by seconds)", () => { - assert< - Equals< - JoulePerSquareMeterSecond, - Divide, Second>> - > - >(); + assert, Second>>>>(); }); }); } diff --git a/src/units/common/mechanical-energy.ts b/src/units/common/mechanical-energy.ts index 97d24078c..a48602f94 100644 --- a/src/units/common/mechanical-energy.ts +++ b/src/units/common/mechanical-energy.ts @@ -1,28 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic } from "../modifiers"; -import { - type Pascal, - type Coulomb, - type Volt, - type Meter, - type Watt, - type Second, - type Hour, - type Minute, -} from "."; +import type { Coulomb, Hour, Meter, Minute, Pascal, Second, Volt, Watt } from "."; /** * @group Unit Classes @@ -50,10 +34,7 @@ export type EnergyUnit = EnergyUnitFrom>; * @group Unit Generators * @category Mechanical */ -export type EnergyUnitFrom = UnitFrom< - EnergyUnitClass, - M ->; +export type EnergyUnitFrom = UnitFrom; /** * A unit of {@link Energy}. diff --git a/src/units/common/mechanical-enthalpy.ts b/src/units/common/mechanical-enthalpy.ts index 0902206e6..06ebeab34 100644 --- a/src/units/common/mechanical-enthalpy.ts +++ b/src/units/common/mechanical-enthalpy.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { type Gram, type Joule } from "."; +import type { Gram, Joule } from "."; /** * @group Unit Classes @@ -31,18 +24,13 @@ export type Enthalpy = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type EnthalpyUnit = EnthalpyUnitFrom< - UnitMeta ->; +export type EnthalpyUnit = EnthalpyUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type EnthalpyUnitFrom = UnitFrom< - EnthalpyUnitClass, - M ->; +export type EnthalpyUnitFrom = UnitFrom; /** * A unit of {@link Enthalpy}. diff --git a/src/units/common/mechanical-force.ts b/src/units/common/mechanical-force.ts index 2ec9eaca2..ea453973e 100644 --- a/src/units/common/mechanical-force.ts +++ b/src/units/common/mechanical-force.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { type Gram, type MeterPerSecondSquared } from "."; +import type { Gram, MeterPerSecondSquared } from "."; /** * @group Unit Classes @@ -41,10 +34,7 @@ export type ForceUnit = ForceUnitFrom>; * @group Unit Generators * @category Mechanical */ -export type ForceUnitFrom = UnitFrom< - ForceUnitClass, - M ->; +export type ForceUnitFrom = UnitFrom; /** * A unit of {@link Force}. diff --git a/src/units/common/mechanical-intensity.ts b/src/units/common/mechanical-intensity.ts index ab4c938c2..5fb822510 100644 --- a/src/units/common/mechanical-intensity.ts +++ b/src/units/common/mechanical-intensity.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Watt } from "."; +import type { Meter, Watt } from "."; /** * @group Unit Classes @@ -31,18 +24,13 @@ export type Intensity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type IntensityUnit = IntensityUnitFrom< - UnitMeta ->; +export type IntensityUnit = IntensityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type IntensityUnitFrom = UnitFrom< - IntensityUnitClass, - M ->; +export type IntensityUnitFrom = UnitFrom; /** * A unit of {@link Intensity}. diff --git a/src/units/common/mechanical-length.ts b/src/units/common/mechanical-length.ts index 9d2a06d41..b9296494f 100644 --- a/src/units/common/mechanical-length.ts +++ b/src/units/common/mechanical-length.ts @@ -1,12 +1,6 @@ -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -30,10 +24,7 @@ export type LengthUnit = LengthUnitFrom>; * @group Unit Generators * @category Mechanical */ -export type LengthUnitFrom = UnitFrom< - LengthUnitClass, - M ->; +export type LengthUnitFrom = UnitFrom; /** * A unit of {@link Length}. diff --git a/src/units/common/mechanical-linear-mass-density.ts b/src/units/common/mechanical-linear-mass-density.ts index 557157190..d87ec031f 100644 --- a/src/units/common/mechanical-linear-mass-density.ts +++ b/src/units/common/mechanical-linear-mass-density.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { type Gram, type Meter } from "."; +import type { Gram, Meter } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type LinearMassDensity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type LinearMassDensityUnit = - LinearMassDensityUnitFrom>; +export type LinearMassDensityUnit = LinearMassDensityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type LinearMassDensityUnitFrom = UnitFrom< - LinearMassDensityUnitClass, - M ->; +export type LinearMassDensityUnitFrom = UnitFrom; /** * A unit of {@link LinearMassDensity}. diff --git a/src/units/common/mechanical-mass-flow-rate.ts b/src/units/common/mechanical-mass-flow-rate.ts index bf62c2470..c3686b315 100644 --- a/src/units/common/mechanical-mass-flow-rate.ts +++ b/src/units/common/mechanical-mass-flow-rate.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { type Gram, type Second } from "."; +import type { Gram, Second } from "."; /** * @group Unit Classes @@ -34,18 +27,13 @@ export type MassFlowRate = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type MassFlowRateUnit = MassFlowRateUnitFrom< - UnitMeta ->; +export type MassFlowRateUnit = MassFlowRateUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type MassFlowRateUnitFrom = UnitFrom< - MassFlowRateUnitClass, - M ->; +export type MassFlowRateUnitFrom = UnitFrom; /** * A unit of {@link MassFlowRate}. diff --git a/src/units/common/mechanical-mass.ts b/src/units/common/mechanical-mass.ts index c0ea3bbc3..4da7d08d6 100644 --- a/src/units/common/mechanical-mass.ts +++ b/src/units/common/mechanical-mass.ts @@ -1,12 +1,6 @@ -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -32,10 +26,7 @@ export type MassUnit = MassUnitFrom>; * @group Unit Generators * @category Mechanical */ -export type MassUnitFrom = UnitFrom< - MassUnitClass, - M ->; +export type MassUnitFrom = UnitFrom; /** * A unit of {@link Mass}. diff --git a/src/units/common/mechanical-moment-of-inertia.ts b/src/units/common/mechanical-moment-of-inertia.ts index 4c5bc3ff5..709bd004c 100644 --- a/src/units/common/mechanical-moment-of-inertia.ts +++ b/src/units/common/mechanical-moment-of-inertia.ts @@ -1,20 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo, type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo, Square } from "../modifiers"; -import { type Gram, type Meter, type Steradian } from "."; +import type { Gram, Meter, Steradian } from "."; /** * @group Unit Classes @@ -36,17 +36,13 @@ export type MomentOfInertia = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type MomentOfInertiaUnit = - MomentOfInertiaUnitFrom>; +export type MomentOfInertiaUnit = MomentOfInertiaUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type MomentOfInertiaUnitFrom = UnitFrom< - MomentOfInertiaUnitClass, - M ->; +export type MomentOfInertiaUnitFrom = UnitFrom; /** * A unit of {@link MomentOfInertia}. @@ -63,12 +59,7 @@ if (import.meta.vitest !== undefined) { describe("KilogramSquareMeterPerSteradian", () => { it("is kilograms by square meters per steradian", () => { - assert< - Equals< - KilogramSquareMeterPerSteradian, - Divide, Square>, Steradian> - > - >(); + assert, Square>, Steradian>>>(); }); }); } diff --git a/src/units/common/mechanical-momentum.ts b/src/units/common/mechanical-momentum.ts index 37c89d897..3b344ec45 100644 --- a/src/units/common/mechanical-momentum.ts +++ b/src/units/common/mechanical-momentum.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Newton, type Second } from "."; +import type { Newton, Second } from "."; /** * @group Unit Classes @@ -34,18 +27,13 @@ export type Momentum = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type MomentumUnit = MomentumUnitFrom< - UnitMeta ->; +export type MomentumUnit = MomentumUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type MomentumUnitFrom = UnitFrom< - MomentumUnitClass, - M ->; +export type MomentumUnitFrom = UnitFrom; /** * One newton second corresponds to a one newton of force applied for one second. diff --git a/src/units/common/mechanical-pressure.ts b/src/units/common/mechanical-pressure.ts index d5faee1c5..a0ad47155 100644 --- a/src/units/common/mechanical-pressure.ts +++ b/src/units/common/mechanical-pressure.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Newton } from "."; +import type { Meter, Newton } from "."; /** * @group Unit Classes @@ -35,18 +28,13 @@ export type Pressure = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type PressureUnit = PressureUnitFrom< - UnitMeta ->; +export type PressureUnit = PressureUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type PressureUnitFrom = UnitFrom< - PressureUnitClass, - M ->; +export type PressureUnitFrom = UnitFrom; /** * A unit of {@link Pressure}. diff --git a/src/units/common/mechanical-radiance-spectral.ts b/src/units/common/mechanical-radiance-spectral.ts index 3f3d6532a..17c8e6bff 100644 --- a/src/units/common/mechanical-radiance-spectral.ts +++ b/src/units/common/mechanical-radiance-spectral.ts @@ -1,20 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic } from "../modifiers"; -import { type Meter, type Steradian, type Watt } from "."; +import type { Meter, Steradian, Watt } from "."; /** * @group Unit Classes @@ -37,17 +37,13 @@ export type SpectralRadiance = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type SpectralRadianceUnit = - SpectralRadianceUnitFrom>; +export type SpectralRadianceUnit = SpectralRadianceUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type SpectralRadianceUnitFrom = UnitFrom< - SpectralRadianceUnitClass, - M ->; +export type SpectralRadianceUnitFrom = UnitFrom; /** * A unit of {@link SpectralRadiance}. @@ -64,12 +60,7 @@ if (import.meta.vitest !== undefined) { describe("WattPerSteradianCubicMeter", () => { it("is watts per steradian cubic meter", () => { - assert< - Equals< - WattPerSteradianCubicMeter, - Divide>> - > - >(); + assert>>>>(); }); }); } diff --git a/src/units/common/mechanical-radiance.ts b/src/units/common/mechanical-radiance.ts index 72219b995..d77023ce3 100644 --- a/src/units/common/mechanical-radiance.ts +++ b/src/units/common/mechanical-radiance.ts @@ -1,20 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Watt, type Steradian } from "."; +import type { Meter, Steradian, Watt } from "."; /** * @group Unit Classes @@ -36,18 +36,13 @@ export type Radiance = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type RadianceUnit = RadianceUnitFrom< - UnitMeta ->; +export type RadianceUnit = RadianceUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type RadianceUnitFrom = UnitFrom< - RadianceUnitClass, - M ->; +export type RadianceUnitFrom = UnitFrom; /** * A unit of {@link Radiance}. @@ -64,12 +59,7 @@ if (import.meta.vitest !== undefined) { describe("WattPerSteradianSquareMeter", () => { it("is watts per steradian square meter", () => { - assert< - Equals< - WattPerSteradianSquareMeter, - Divide>> - > - >(); + assert>>>>(); }); }); } diff --git a/src/units/common/mechanical-radiant-exposure.ts b/src/units/common/mechanical-radiant-exposure.ts index 7ffec6e57..65f8e7c88 100644 --- a/src/units/common/mechanical-radiant-exposure.ts +++ b/src/units/common/mechanical-radiant-exposure.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Joule } from "."; +import type { Joule, Meter } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type RadiantExposure = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type RadiantExposureUnit = - RadiantExposureUnitFrom>; +export type RadiantExposureUnit = RadiantExposureUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type RadiantExposureUnitFrom = UnitFrom< - RadiantExposureUnitClass, - M ->; +export type RadiantExposureUnitFrom = UnitFrom; /** * A unit of {@link RadiantExposure}. diff --git a/src/units/common/mechanical-radiant-intensity.ts b/src/units/common/mechanical-radiant-intensity.ts index dd73adb45..8339d65d1 100644 --- a/src/units/common/mechanical-radiant-intensity.ts +++ b/src/units/common/mechanical-radiant-intensity.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Watt, type Steradian } from "."; +import type { Steradian, Watt } from "."; /** * @group Unit Classes @@ -35,17 +28,13 @@ export type RadiantIntensity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type RadiantIntensityUnit = - RadiantIntensityUnitFrom>; +export type RadiantIntensityUnit = RadiantIntensityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type RadiantIntensityUnitFrom = UnitFrom< - RadiantIntensityUnitClass, - M ->; +export type RadiantIntensityUnitFrom = UnitFrom; /** * A unit of {@link RadiantIntensity}. diff --git a/src/units/common/mechanical-specific-energy.ts b/src/units/common/mechanical-specific-energy.ts index de9bb26cd..fc9ebd9d7 100644 --- a/src/units/common/mechanical-specific-energy.ts +++ b/src/units/common/mechanical-specific-energy.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { type Gram, type Joule } from "."; +import type { Gram, Joule } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type SpecificEnergy = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type SpecificEnergyUnit = - SpecificEnergyUnitFrom>; +export type SpecificEnergyUnit = SpecificEnergyUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type SpecificEnergyUnitFrom = UnitFrom< - SpecificEnergyUnitClass, - M ->; +export type SpecificEnergyUnitFrom = UnitFrom; /** * A unit of {@link SpecificEnergy}. diff --git a/src/units/common/mechanical-spectral-intensity.ts b/src/units/common/mechanical-spectral-intensity.ts index 088cb59d7..8badb2412 100644 --- a/src/units/common/mechanical-spectral-intensity.ts +++ b/src/units/common/mechanical-spectral-intensity.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Steradian, type Watt } from "."; +import type { Meter, Steradian, Watt } from "."; /** * @group Unit Classes @@ -36,17 +36,13 @@ export type SpectralIntensity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type SpectralIntensityUnit = - SpectralIntensityUnitFrom>; +export type SpectralIntensityUnit = SpectralIntensityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type SpectralIntensityUnitFrom = UnitFrom< - SpectralIntensityUnitClass, - M ->; +export type SpectralIntensityUnitFrom = UnitFrom; /** * A unit of {@link SpectralIntensity}. @@ -63,9 +59,7 @@ if (import.meta.vitest !== undefined) { describe("WattPerSteradianMeter", () => { it("is watts per steradian meter", () => { - assert< - Equals>> - >(); + assert>>>(); }); }); } diff --git a/src/units/common/mechanical-spectral-irradiance.ts b/src/units/common/mechanical-spectral-irradiance.ts index e56ac9abd..c1fe4e4a1 100644 --- a/src/units/common/mechanical-spectral-irradiance.ts +++ b/src/units/common/mechanical-spectral-irradiance.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type Cubic } from ".."; -import { type BaseUnitClass } from "../base-units"; +import type { Cubic } from ".."; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Watt } from "."; +import type { Meter, Watt } from "."; /** * @group Unit Classes @@ -35,17 +28,13 @@ export type SpectralIrradiance = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type SpectralIrradianceUnit = - SpectralIrradianceUnitFrom>; +export type SpectralIrradianceUnit = SpectralIrradianceUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type SpectralIrradianceUnitFrom = UnitFrom< - SpectralIrradianceUnitClass, - M ->; +export type SpectralIrradianceUnitFrom = UnitFrom; /** * A unit of {@link SpectralIrradiance}. diff --git a/src/units/common/mechanical-spectral-power.ts b/src/units/common/mechanical-spectral-power.ts index b4ff810fd..4fb82d2ab 100644 --- a/src/units/common/mechanical-spectral-power.ts +++ b/src/units/common/mechanical-spectral-power.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Watt, type Meter } from "."; +import type { Meter, Watt } from "."; /** * @group Unit Classes @@ -34,18 +27,13 @@ export type SpectralPower = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type SpectralPowerUnit = SpectralPowerUnitFrom< - UnitMeta ->; +export type SpectralPowerUnit = SpectralPowerUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type SpectralPowerUnitFrom = UnitFrom< - SpectralPowerUnitClass, - M ->; +export type SpectralPowerUnitFrom = UnitFrom; /** * A unit of {@link SpectralPower}. diff --git a/src/units/common/mechanical-stiffness.ts b/src/units/common/mechanical-stiffness.ts index cf4122bc4..968451c73 100644 --- a/src/units/common/mechanical-stiffness.ts +++ b/src/units/common/mechanical-stiffness.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type JoulePerSquareMeter, type Newton, type Meter } from "."; +import type { JoulePerSquareMeter, Meter, Newton } from "."; /** * @group Unit Classes @@ -33,18 +26,13 @@ export type Stiffness = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type StiffnessUnit = StiffnessUnitFrom< - UnitMeta ->; +export type StiffnessUnit = StiffnessUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type StiffnessUnitFrom = UnitFrom< - StiffnessUnitClass, - M ->; +export type StiffnessUnitFrom = UnitFrom; /** * A unit of {@link Stiffness}. diff --git a/src/units/common/mechanical-surface-density.ts b/src/units/common/mechanical-surface-density.ts index 8a4ec3c4f..2623e2b24 100644 --- a/src/units/common/mechanical-surface-density.ts +++ b/src/units/common/mechanical-surface-density.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo, type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo, Square } from "../modifiers"; -import { type Gram, type Meter } from "."; +import type { Gram, Meter } from "."; /** * @group Unit Classes @@ -31,17 +24,13 @@ export type SurfaceDensity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type SurfaceDensityUnit = - SurfaceDensityUnitFrom>; +export type SurfaceDensityUnit = SurfaceDensityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type SurfaceDensityUnitFrom = UnitFrom< - SurfaceDensityUnitClass, - M ->; +export type SurfaceDensityUnitFrom = UnitFrom; /** * A unit of {@link SurfaceDensity}. @@ -58,9 +47,7 @@ if (import.meta.vitest !== undefined) { describe("KilogramPerSquareMeter", () => { it("is kilograms per square meter", () => { - assert< - Equals, Square>> - >(); + assert, Square>>>(); }); }); } diff --git a/src/units/common/mechanical-viscosity.ts b/src/units/common/mechanical-viscosity.ts index b72220881..5c0c9bc45 100644 --- a/src/units/common/mechanical-viscosity.ts +++ b/src/units/common/mechanical-viscosity.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Second } from "."; +import type { Meter, Second } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type KinematicViscosity = AbstractUnitFrom; * @group Unit Generators * @category Mechanical */ -export type KinematicViscosityUnit = - KinematicViscosityUnitFrom>; +export type KinematicViscosityUnit = KinematicViscosityUnitFrom>; /** * @group Unit Generators * @category Mechanical */ -export type KinematicViscosityUnitFrom = UnitFrom< - KinematicViscosityUnitClass, - M ->; +export type KinematicViscosityUnitFrom = UnitFrom; /** * A unit of {@link KinematicViscosity}. diff --git a/src/units/common/mechanical-volume.ts b/src/units/common/mechanical-volume.ts index 81297a66e..2fa39296c 100644 --- a/src/units/common/mechanical-volume.ts +++ b/src/units/common/mechanical-volume.ts @@ -1,25 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { - type Milli, - type Cubic, - type Square, - type Centi, - type Deci, -} from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Centi, Cubic, Deci, Milli, Square } from "../modifiers"; -import { type Meter } from "."; +import type { Meter } from "."; /** * @group Unit Classes @@ -45,10 +32,7 @@ export type VolumeUnit = VolumeUnitFrom>; * @group Unit Classes * @category Mechanical */ -export type VolumeUnitFrom = UnitFrom< - VolumeUnitClass, - M ->; +export type VolumeUnitFrom = UnitFrom; /** * A unit of volume. @@ -79,9 +63,7 @@ if (import.meta.vitest !== undefined) { describe("Liters", () => { it("is milli cubic meter", () => { assert>>>(); - assert< - Equals, Deci>, Deci>> - >(); + assert, Deci>, Deci>>>(); }); }); } diff --git a/src/units/common/mechanical-work.ts b/src/units/common/mechanical-work.ts index e07728c17..d23f9c778 100644 --- a/src/units/common/mechanical-work.ts +++ b/src/units/common/mechanical-work.ts @@ -1,21 +1,9 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; - -import { - type Multiply, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; - -import { - type Joule, - type Energy, - type EnergyUnit, - type EnergyUnitClass, - type EnergyUnitFrom, - type Newton, - type Meter, -} from "."; +import { type Equals, assert } from "tsafe"; + +import type { Multiply, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; + +import type { Energy, EnergyUnit, EnergyUnitClass, EnergyUnitFrom, Joule, Meter, Newton } from "."; /** * @group Unit Classes diff --git a/src/units/common/mechanical-yank.ts b/src/units/common/mechanical-yank.ts index 344a6956e..ab98c3416 100644 --- a/src/units/common/mechanical-yank.ts +++ b/src/units/common/mechanical-yank.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type UnknownUnitMeta, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Newton, type Second } from "."; +import type { Newton, Second } from "."; /** * @group Unit Classes @@ -40,10 +33,7 @@ export type YankUnit = YankUnitFrom>; * @group Unit Classes * @category Mechanical */ -export type YankUnitFrom = UnitFrom< - YankUnitClass, - M ->; +export type YankUnitFrom = UnitFrom; /** * A unit of {@link Yank}. diff --git a/src/units/common/photometric-luminance.ts b/src/units/common/photometric-luminance.ts index 9418aaa45..812e4d84f 100644 --- a/src/units/common/photometric-luminance.ts +++ b/src/units/common/photometric-luminance.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Candela, type Meter } from "."; +import type { Candela, Meter } from "."; /** * @group Unit Classes @@ -34,18 +27,13 @@ export type Luminance = AbstractUnitFrom; * @group Unit Generators * @category Photometric */ -export type LuminanceUnit = LuminanceUnitFrom< - UnitMeta ->; +export type LuminanceUnit = LuminanceUnitFrom>; /** * @group Unit Generators * @category Photometric */ -export type LuminanceUnitFrom = UnitFrom< - LuminanceUnitClass, - M ->; +export type LuminanceUnitFrom = UnitFrom; /** * A unit of {@link Luminance}. diff --git a/src/units/common/photometric-luminous-efficacy.ts b/src/units/common/photometric-luminous-efficacy.ts index da41cca5f..c1e90071f 100644 --- a/src/units/common/photometric-luminous-efficacy.ts +++ b/src/units/common/photometric-luminous-efficacy.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Divide, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Lumen, type Watt } from "."; +import type { Lumen, Watt } from "."; /** * @group Unit Classes @@ -36,17 +29,13 @@ export type LuminousEfficacy = AbstractUnitFrom; * @group Unit Generators * @category Photometric */ -export type LuminousEfficacyUnit = - LuminousEfficacyUnitFrom>; +export type LuminousEfficacyUnit = LuminousEfficacyUnitFrom>; /** * @group Unit Generators * @category Photometric */ -export type LuminousEfficacyUnitFrom = UnitFrom< - LuminousEfficacyUnitClass, - M ->; +export type LuminousEfficacyUnitFrom = UnitFrom; /** * A unit of {@link LuminousEfficacy}. diff --git a/src/units/common/photometric-luminous-energy.ts b/src/units/common/photometric-luminous-energy.ts index ebdc0e7ce..6d9e82d7a 100644 --- a/src/units/common/photometric-luminous-energy.ts +++ b/src/units/common/photometric-luminous-energy.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Lumen, type Second } from "."; +import type { Lumen, Second } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type LuminousEnergy = AbstractUnitFrom; * @group Unit Generators * @category Photometric */ -export type LuminousEnergyUnit = - LuminousEnergyUnitFrom>; +export type LuminousEnergyUnit = LuminousEnergyUnitFrom>; /** * @group Unit Generators * @category Photometric */ -export type LuminousEnergyUnitFrom = UnitFrom< - LuminousEnergyUnitClass, - M ->; +export type LuminousEnergyUnitFrom = UnitFrom; /** * A unit of {@link LuminousEnergy}. diff --git a/src/units/common/photometric-luminous-exposure.ts b/src/units/common/photometric-luminous-exposure.ts index c79c389bd..6ca72a942 100644 --- a/src/units/common/photometric-luminous-exposure.ts +++ b/src/units/common/photometric-luminous-exposure.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Lux, type Second } from "."; +import type { Lux, Second } from "."; /** * @group Unit Classes @@ -34,17 +27,13 @@ export type LuminousExposure = AbstractUnitFrom; * @group Unit Generators * @category Photometric */ -export type LuminousExposureUnit = - LuminousExposureUnitFrom>; +export type LuminousExposureUnit = LuminousExposureUnitFrom>; /** * @group Unit Generators * @category Photometric */ -export type LuminousExposureUnitFrom = UnitFrom< - LuminousExposureUnitClass, - M ->; +export type LuminousExposureUnitFrom = UnitFrom; /** * A unit of {@link LuminousExposure}. diff --git a/src/units/common/photometric-luminous-flux.ts b/src/units/common/photometric-luminous-flux.ts index a31efc6eb..66fb8b4e8 100644 --- a/src/units/common/photometric-luminous-flux.ts +++ b/src/units/common/photometric-luminous-flux.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnitFrom, - type Multiply, - type UnitFrom, - type UnitMeta, - type UnitSubvalues, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Candela, type Steradian } from "."; +import type { Candela, Steradian } from "."; /** * @group Unit Classes @@ -30,18 +23,13 @@ export type LuminousFlux = AbstractUnitFrom; * @group Unit Generators * @category Photometric */ -export type LuminousFluxUnit = LuminousFluxUnitFrom< - UnitMeta ->; +export type LuminousFluxUnit = LuminousFluxUnitFrom>; /** * @group Unit Generators * @category Photometric */ -export type LuminousFluxUnitFrom = UnitFrom< - LuminousFluxUnitClass, - M ->; +export type LuminousFluxUnitFrom = UnitFrom; /** * One Lumen is equal to the amount of light given out through a solid angle by a source of one diff --git a/src/units/common/photometric-luminous-intensity.ts b/src/units/common/photometric-luminous-intensity.ts index 7ad2002b2..168d2a2ee 100644 --- a/src/units/common/photometric-luminous-intensity.ts +++ b/src/units/common/photometric-luminous-intensity.ts @@ -1,12 +1,6 @@ -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -24,17 +18,13 @@ export type LuminousIntensity = AbstractUnitFrom; * @group Unit Generators * @category Photometric */ -export type LuminousIntensityUnit = - LuminousIntensityUnitFrom>; +export type LuminousIntensityUnit = LuminousIntensityUnitFrom>; /** * @group Unit Generators * @category Photometric */ -export type LuminousIntensityUnitFrom = UnitFrom< - LuminousIntensityUnitClass, - M ->; +export type LuminousIntensityUnitFrom = UnitFrom; /** * A unit of luminous intensity. diff --git a/src/units/common/power.ts b/src/units/common/power.ts index a6c86e57e..fb78a10f1 100644 --- a/src/units/common/power.ts +++ b/src/units/common/power.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Multiply, - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Ampere, type Volt, type Joule, type Second } from "."; +import type { Ampere, Joule, Second, Volt } from "."; /** * @group Unit Classes @@ -45,10 +45,7 @@ export type PowerUnit = PowerUnitFrom>; * @category Electromagnetic * @category Mechanical */ -export type PowerUnitFrom = UnitFrom< - PowerUnitClass, - M ->; +export type PowerUnitFrom = UnitFrom; /** * A unit of {@link Power}. diff --git a/src/units/common/thermodynamic-entropy.ts b/src/units/common/thermodynamic-entropy.ts index 6a27277d4..477cc2842 100644 --- a/src/units/common/thermodynamic-entropy.ts +++ b/src/units/common/thermodynamic-entropy.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Joule, type Kelvin } from "."; +import type { Joule, Kelvin } from "."; /** * @group Unit Classes @@ -41,10 +34,7 @@ export type EntropyUnit = EntropyUnitFrom>; * @group Unit Generators * @category Thermodynamic */ -export type EntropyUnitFrom = UnitFrom< - EntropyUnitClass, - M ->; +export type EntropyUnitFrom = UnitFrom; /** * A unit of {@link Entropy}. diff --git a/src/units/common/thermodynamic-specific-entropy.ts b/src/units/common/thermodynamic-specific-entropy.ts index 9fc6cb2d4..b60a3dab9 100644 --- a/src/units/common/thermodynamic-specific-entropy.ts +++ b/src/units/common/thermodynamic-specific-entropy.ts @@ -1,20 +1,20 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Kilo } from "../modifiers"; -import { type Gram, type Joule, type Kelvin } from "."; +import type { Gram, Joule, Kelvin } from "."; /** * @group Unit Classes @@ -36,17 +36,13 @@ export type SpecificEntropy = AbstractUnitFrom; * @group Unit Generators * @category Thermodynamic */ -export type SpecificEntropyUnit = - SpecificEntropyUnitFrom>; +export type SpecificEntropyUnit = SpecificEntropyUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type SpecificEntropyUnitFrom = UnitFrom< - SpecificEntropyUnitClass, - M ->; +export type SpecificEntropyUnitFrom = UnitFrom; /** * A unit of {@link SpecificEntropy}. @@ -63,12 +59,7 @@ if (import.meta.vitest !== undefined) { describe("JoulePerKilogramKelvin", () => { it("is joules per kelvin kilogram", () => { - assert< - Equals< - JoulePerKilogramKelvin, - Divide>> - > - >(); + assert>>>>(); }); }); } diff --git a/src/units/common/thermodynamic-specific-volume.ts b/src/units/common/thermodynamic-specific-volume.ts index b4bee7a5e..7320d338b 100644 --- a/src/units/common/thermodynamic-specific-volume.ts +++ b/src/units/common/thermodynamic-specific-volume.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Kilo, type Cubic } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Cubic, Kilo } from "../modifiers"; -import { type Gram, type Meter } from "."; +import type { Gram, Meter } from "."; /** * @group Unit Classes @@ -31,17 +24,13 @@ export type SpecificVolume = AbstractUnitFrom; * @group Unit Generators * @category Thermodynamic */ -export type SpecificVolumeUnit = - SpecificVolumeUnitFrom>; +export type SpecificVolumeUnit = SpecificVolumeUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type SpecificVolumeUnitFrom = UnitFrom< - SpecificVolumeUnitClass, - M ->; +export type SpecificVolumeUnitFrom = UnitFrom; /** * A unit of {@link SpecificVolume}. diff --git a/src/units/common/thermodynamic-temperature-gradient.ts b/src/units/common/thermodynamic-temperature-gradient.ts index b8868adb2..ac11a59a8 100644 --- a/src/units/common/thermodynamic-temperature-gradient.ts +++ b/src/units/common/thermodynamic-temperature-gradient.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Kelvin, type Meter } from "."; +import type { Kelvin, Meter } from "."; /** * @group Unit Classes @@ -27,24 +20,19 @@ export type TemperatureGradientUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Thermodynamic */ -export type TemperatureGradient = - AbstractUnitFrom; +export type TemperatureGradient = AbstractUnitFrom; /** * @group Unit Generators * @category Thermodynamic */ -export type TemperatureGradientUnit = - TemperatureGradientUnitFrom>; +export type TemperatureGradientUnit = TemperatureGradientUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type TemperatureGradientUnitFrom = UnitFrom< - TemperatureGradientUnitClass, - M ->; +export type TemperatureGradientUnitFrom = UnitFrom; /** * A unit of {@link TemperatureGradient}. diff --git a/src/units/common/thermodynamic-temperature.ts b/src/units/common/thermodynamic-temperature.ts index aae60168f..46f3b5977 100644 --- a/src/units/common/thermodynamic-temperature.ts +++ b/src/units/common/thermodynamic-temperature.ts @@ -1,12 +1,6 @@ -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -26,18 +20,13 @@ export type Temperature = AbstractUnitFrom; * @group Unit Generators * @category Thermodynamic */ -export type TemperatureUnit = TemperatureUnitFrom< - UnitMeta ->; +export type TemperatureUnit = TemperatureUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type TemperatureUnitFrom = UnitFrom< - TemperatureUnitClass, - M ->; +export type TemperatureUnitFrom = UnitFrom; /** * A unit of {@link Temperature}. diff --git a/src/units/common/thermodynamic-thermal-conductivity.ts b/src/units/common/thermodynamic-thermal-conductivity.ts index 66e73b53f..75b4f6b86 100644 --- a/src/units/common/thermodynamic-thermal-conductivity.ts +++ b/src/units/common/thermodynamic-thermal-conductivity.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type Multiply, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, +import type { + AbstractUnitFrom, + Divide, + Multiply, + UnitFrom, + UnitMeta, + UnitSubvalues, + UnknownUnitMeta, } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Meter, type Watt, type Kelvin } from "."; +import type { Kelvin, Meter, Watt } from "."; /** * @group Unit Classes @@ -30,24 +30,19 @@ export type ThermalConductivityUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Thermodynamic */ -export type ThermalConductivity = - AbstractUnitFrom; +export type ThermalConductivity = AbstractUnitFrom; /** * @group Unit Generators * @category Thermodynamic */ -export type ThermalConductivityUnit = - ThermalConductivityUnitFrom>; +export type ThermalConductivityUnit = ThermalConductivityUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type ThermalConductivityUnitFrom = UnitFrom< - ThermalConductivityUnitClass, - M ->; +export type ThermalConductivityUnitFrom = UnitFrom; /** * A unit of {@link ThermalConductivity}. @@ -64,9 +59,7 @@ if (import.meta.vitest !== undefined) { describe("WattPerMeterKelvin", () => { it("is watts per meter kelvin", () => { - assert< - Equals>> - >(); + assert>>>(); }); }); } diff --git a/src/units/common/thermodynamic-thermal-expansion-coefficient.ts b/src/units/common/thermodynamic-thermal-expansion-coefficient.ts index 1e13a36bb..1ed5eb465 100644 --- a/src/units/common/thermodynamic-thermal-expansion-coefficient.ts +++ b/src/units/common/thermodynamic-thermal-expansion-coefficient.ts @@ -1,24 +1,18 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Reciprocal } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Reciprocal } from "../modifiers"; -import { type TemperatureUnitClass, type Temperature } from "."; +import type { Temperature, TemperatureUnitClass } from "."; /** * @group Unit Classes * @category Thermodynamic */ -export type ThermalExpansionCoefficientUnitClass = - Reciprocal; +export type ThermalExpansionCoefficientUnitClass = Reciprocal; /** * @group Abstract Units @@ -30,15 +24,16 @@ export type ThermalExpansionCoefficient = Reciprocal; * @group Unit Generators * @category Thermodynamic */ -export type ThermalExpansionCoefficientUnit = - ThermalExpansionCoefficientUnitFrom>; +export type ThermalExpansionCoefficientUnit = ThermalExpansionCoefficientUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type ThermalExpansionCoefficientUnitFrom = - UnitFrom; +export type ThermalExpansionCoefficientUnitFrom = UnitFrom< + ThermalExpansionCoefficientUnitClass, + M +>; // Tests if (import.meta.vitest !== undefined) { diff --git a/src/units/common/thermodynamic-thermal-resistance.ts b/src/units/common/thermodynamic-thermal-resistance.ts index 632fbebb7..ed4b2da4e 100644 --- a/src/units/common/thermodynamic-thermal-resistance.ts +++ b/src/units/common/thermodynamic-thermal-resistance.ts @@ -1,18 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; -import { type Kelvin, type Watt } from "."; +import type { Kelvin, Watt } from "."; /** * @group Unit Classes @@ -35,17 +28,13 @@ export type ThermalResistance = AbstractUnitFrom; * @group Unit Generators * @category Thermodynamic */ -export type ThermalResistanceUnit = - ThermalResistanceUnitFrom>; +export type ThermalResistanceUnit = ThermalResistanceUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type ThermalResistanceUnitFrom = UnitFrom< - ThermalResistanceUnitClass, - M ->; +export type ThermalResistanceUnitFrom = UnitFrom; /** * A unit of {@link ThermalResistance}. diff --git a/src/units/common/thermodynamic-thermal-transmittance.ts b/src/units/common/thermodynamic-thermal-transmittance.ts index 8c4e9e97e..2bd1472bd 100644 --- a/src/units/common/thermodynamic-thermal-transmittance.ts +++ b/src/units/common/thermodynamic-thermal-transmittance.ts @@ -1,19 +1,12 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type Divide, - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; -import { type Square } from "../modifiers"; +import type { BaseUnitClass } from "../base-units"; +import type { Square } from "../modifiers"; -import { type Meter, type Kelvin, type Watt } from "."; +import type { Kelvin, Meter, Watt } from "."; /** * @group Unit Classes @@ -29,24 +22,19 @@ export type ThermalTransmittanceUnitClass = BaseUnitClass<{ * @group Abstract Units * @category Thermodynamic */ -export type ThermalTransmittance = - AbstractUnitFrom; +export type ThermalTransmittance = AbstractUnitFrom; /** * @group Unit Generators * @category Thermodynamic */ -export type ThermalTransmittanceUnit = - ThermalTransmittanceUnitFrom>; +export type ThermalTransmittanceUnit = ThermalTransmittanceUnitFrom>; /** * @group Unit Generators * @category Thermodynamic */ -export type ThermalTransmittanceUnitFrom = UnitFrom< - ThermalTransmittanceUnitClass, - M ->; +export type ThermalTransmittanceUnitFrom = UnitFrom; /** * A unit of {@link ThermalTransmittance}. @@ -62,12 +50,7 @@ if (import.meta.vitest !== undefined) { describe("WattPerSquareMeterPerKelvin", () => { it("is watt per square meter per kelvin", () => { - assert< - Equals< - WattPerSquareMeterPerKelvin, - Divide>, Kelvin> - > - >(); + assert>, Kelvin>>>(); }); }); } diff --git a/src/units/common/time-duration.ts b/src/units/common/time-duration.ts index c99388cb5..3101b4468 100644 --- a/src/units/common/time-duration.ts +++ b/src/units/common/time-duration.ts @@ -1,12 +1,6 @@ -import { - type AbstractUnitFrom, - type UnitSubvalues, - type UnitFrom, - type UnitMeta, - type UnknownUnitMeta, -} from "#uom-types"; +import type { AbstractUnitFrom, UnitFrom, UnitMeta, UnitSubvalues, UnknownUnitMeta } from "#uom-types"; -import { type BaseUnitClass } from "../base-units"; +import type { BaseUnitClass } from "../base-units"; /** * @group Unit Classes @@ -24,18 +18,13 @@ export type Duration = AbstractUnitFrom; * @group Unit Generators * @category Time */ -export type DurationUnit = DurationUnitFrom< - UnitMeta ->; +export type DurationUnit = DurationUnitFrom>; /** * @group Unit Generators * @category Time */ -export type DurationUnitFrom = UnitFrom< - DurationUnitClass, - M ->; +export type DurationUnitFrom = UnitFrom; /** * A unit of {@link Duration}. diff --git a/src/units/converters/angle.ts b/src/units/converters/angle.ts index 570e17448..9d857f59f 100644 --- a/src/units/converters/angle.ts +++ b/src/units/converters/angle.ts @@ -1,30 +1,19 @@ -import { type UnitConversionRate } from "#uom-types"; +import type { UnitConversionRate } from "#uom-types"; import { div, mul } from "#uom-types/math"; -import { - type Radian, - type Degree, - type Gradian, - type Turn, -} from "#uom-types/units"; +import type { Degree, Gradian, Radian, Turn } from "#uom-types/units"; /** * Convert {@link Radian} to {@link Degree}. */ export function radiansToDegrees(angle: Radian): Degree { - return mul( - angle, - (180 / Math.PI) as UnitConversionRate<{ scalar360: 1; scalar2Ï€: -1 }>, - ); + return mul(angle, (180 / Math.PI) as UnitConversionRate<{ scalar360: 1; scalar2Ï€: -1 }>); } /** * Convert {@link Radian} to {@link Gradian}. */ export function radiansToGradians(angle: Radian): Gradian { - return mul( - angle, - (200 / Math.PI) as UnitConversionRate<{ scalar400: 1; scalar2Ï€: -1 }>, - ); + return mul(angle, (200 / Math.PI) as UnitConversionRate<{ scalar400: 1; scalar2Ï€: -1 }>); } /** @@ -38,20 +27,14 @@ export function radiansToTurns(angle: Radian): Turn { * Convert {@link Degree} to {@link Radian}. */ export function degreesToRadians(angle: Degree): Radian { - return mul( - angle, - (Math.PI / 180) as UnitConversionRate<{ scalar360: -1; scalar2Ï€: 1 }>, - ); + return mul(angle, (Math.PI / 180) as UnitConversionRate<{ scalar360: -1; scalar2Ï€: 1 }>); } /** * Convert {@link Degree} to {@link Gradian}. */ export function degreesToGradians(angle: Degree): Gradian { - return mul( - angle, - (10 / 9) as UnitConversionRate<{ scalar360: -1; scalar400: 1 }>, - ); + return mul(angle, (10 / 9) as UnitConversionRate<{ scalar360: -1; scalar400: 1 }>); } /** @@ -65,20 +48,14 @@ export function degreesToTurns(angle: Degree): Turn { * Convert {@link Gradian} to {@link Radian}. */ export function gradiansToRadians(angle: Gradian): Radian { - return mul( - angle, - (Math.PI / 400) as UnitConversionRate<{ scalar400: -1; scalar2Ï€: 1 }>, - ); + return mul(angle, (Math.PI / 400) as UnitConversionRate<{ scalar400: -1; scalar2Ï€: 1 }>); } /** * Convert {@link Gradian} to {@link Degree}. */ export function gradiansToDegrees(angle: Gradian): Degree { - return mul( - angle, - (9 / 10) as UnitConversionRate<{ scalar360: 1; scalar400: -1 }>, - ); + return mul(angle, (9 / 10) as UnitConversionRate<{ scalar360: 1; scalar400: -1 }>); } /** diff --git a/src/units/converters/area.ts b/src/units/converters/area.ts index 6f13fb5a9..9c787f9be 100644 --- a/src/units/converters/area.ts +++ b/src/units/converters/area.ts @@ -1,11 +1,6 @@ -import { type UnitConversionRate } from "#uom-types"; +import type { UnitConversionRate } from "#uom-types"; import { div, mul } from "#uom-types/math"; -import { - type Meter, - type Are, - type Hectare, - type Square, -} from "#uom-types/units"; +import type { Are, Hectare, Meter, Square } from "#uom-types/units"; /** * Convert {@link Square}<{@link Meter}> to {@link Are}. diff --git a/src/units/converters/duration.ts b/src/units/converters/duration.ts index 91b7dacf8..041da6e0f 100644 --- a/src/units/converters/duration.ts +++ b/src/units/converters/duration.ts @@ -1,13 +1,6 @@ -import { type UnitConversionRate } from "#uom-types"; +import type { UnitConversionRate } from "#uom-types"; import { div, mul } from "#uom-types/math"; -import { - type Second, - type Minute, - type Hour, - type Day, - type Week, - type Year, -} from "#uom-types/units"; +import type { Day, Hour, Minute, Second, Week, Year } from "#uom-types/units"; /** * Convert {@link Second} to {@link Minute}. diff --git a/src/units/converters/energy.ts b/src/units/converters/energy.ts index be7574f5b..d644f0834 100644 --- a/src/units/converters/energy.ts +++ b/src/units/converters/energy.ts @@ -1,6 +1,6 @@ -import { type UnitConversionRate } from "#uom-types"; +import type { UnitConversionRate } from "#uom-types"; import { div, mul } from "#uom-types/math"; -import { type Joule, type WattHour, type WattMinute } from "#uom-types/units"; +import type { Joule, WattHour, WattMinute } from "#uom-types/units"; /** * Convert {@link Joule} to {@link WattMinute}. diff --git a/src/units/converters/frequency.ts b/src/units/converters/frequency.ts index 4a4feb83c..f222ce9e4 100644 --- a/src/units/converters/frequency.ts +++ b/src/units/converters/frequency.ts @@ -1,13 +1,6 @@ -import { type UnitConversionRate } from "#uom-types"; -import { mul, div } from "#uom-types/math"; -import { - type Hertz, - type PerMinute, - type PerHour, - type PerDay, - type PerWeek, - type PerYear, -} from "#uom-types/units"; +import type { UnitConversionRate } from "#uom-types"; +import { div, mul } from "#uom-types/math"; +import type { Hertz, PerDay, PerHour, PerMinute, PerWeek, PerYear } from "#uom-types/units"; /** * Convert {@link Hertz} to {@link PerMinute}. diff --git a/src/units/converters/mass.ts b/src/units/converters/mass.ts index e7bfb2c2b..30ad8d0f9 100644 --- a/src/units/converters/mass.ts +++ b/src/units/converters/mass.ts @@ -1,6 +1,6 @@ -import { type UnitConversionRate } from "#uom-types"; -import { mul, div } from "#uom-types/math"; -import { type Gram, type Tonne } from "#uom-types/units"; +import type { UnitConversionRate } from "#uom-types"; +import { div, mul } from "#uom-types/math"; +import type { Gram, Tonne } from "#uom-types/units"; /** * Convert {@link Gram} to {@link Tonne}. diff --git a/src/units/converters/temperature.ts b/src/units/converters/temperature.ts index d6f356b4f..9f7f96eb7 100644 --- a/src/units/converters/temperature.ts +++ b/src/units/converters/temperature.ts @@ -1,4 +1,4 @@ -import { type Kelvin, type Celsius } from "#uom-types/units"; +import type { Celsius, Kelvin } from "#uom-types/units"; /** * Convert {@link Celsius} to {@link Kelvin}. diff --git a/src/units/converters/volume.ts b/src/units/converters/volume.ts index 0fe290f62..894252bb7 100644 --- a/src/units/converters/volume.ts +++ b/src/units/converters/volume.ts @@ -1,6 +1,6 @@ -import { type UnitConversionRate } from "#uom-types"; -import { mul, div } from "#uom-types/math"; -import { type Cubic, type Meter, type Liter } from "#uom-types/units"; +import type { UnitConversionRate } from "#uom-types"; +import { div, mul } from "#uom-types/math"; +import type { Cubic, Liter, Meter } from "#uom-types/units"; /** * Convert {@link Cubic}<{@link Meter}> to {@link Liter}. diff --git a/src/units/modifiers/exponentials.ts b/src/units/modifiers/exponentials.ts index 4689b8949..0739d4774 100644 --- a/src/units/modifiers/exponentials.ts +++ b/src/units/modifiers/exponentials.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnit, - type Pow, - type PowUnitSubvalues, - type Unit, - type UnitClass, - type UnitConversionRate, - type UnitMeta, - type UnknownAbstractUnit, - type UnknownUnit, - type UnknownUnitClass, - type UnknownUnitConversionRate, - type UnknownUnitMeta, +import type { + AbstractUnit, + Pow, + PowUnitSubvalues, + Unit, + UnitClass, + UnitConversionRate, + UnitMeta, + UnknownAbstractUnit, + UnknownUnit, + UnknownUnitClass, + UnknownUnitConversionRate, + UnknownUnitMeta, } from "#uom-types"; /** @@ -25,19 +25,14 @@ import { * @see {@link Cubic} */ export type Square< - T extends - | UnknownUnit - | UnknownAbstractUnit - | UnknownUnitConversionRate - | UnknownUnitClass - | UnknownUnitMeta, + T extends UnknownUnit | UnknownAbstractUnit | UnknownUnitConversionRate | UnknownUnitClass | UnknownUnitMeta, > = T extends number ? Pow : T extends UnknownUnitClass - ? UnitClass> - : T extends UnknownUnitMeta - ? UnitMeta> - : never; + ? UnitClass> + : T extends UnknownUnitMeta + ? UnitMeta> + : never; /** * Put the given {@link Unit} to the power of 3. @@ -48,19 +43,14 @@ export type Square< * @see {@link Square} */ export type Cubic< - T extends - | UnknownUnit - | UnknownAbstractUnit - | UnknownUnitConversionRate - | UnknownUnitClass - | UnknownUnitMeta, + T extends UnknownUnit | UnknownAbstractUnit | UnknownUnitConversionRate | UnknownUnitClass | UnknownUnitMeta, > = T extends number ? Pow : T extends UnknownUnitClass - ? UnitClass> - : T extends UnknownUnitMeta - ? UnitMeta> - : never; + ? UnitClass> + : T extends UnknownUnitMeta + ? UnitMeta> + : never; // Tests if (import.meta.vitest !== undefined) { @@ -68,41 +58,21 @@ if (import.meta.vitest !== undefined) { describe("Square", () => { it("squares a unit", () => { - assert< - Equals>, Unit<{ a: 2 }, { b: 4 }>> - >(); + assert>, Unit<{ a: 2 }, { b: 4 }>>>(); assert>, AbstractUnit<{ a: 2 }>>>(); - assert< - Equals< - Square>, - UnitConversionRate<{ a: 2 }> - > - >(); - assert< - Equals>, UnitClass<{ a: 2; b: 4 }>> - >(); - assert< - Equals>, UnitMeta<{ a: 2; b: 4 }>> - >(); + assert>, UnitConversionRate<{ a: 2 }>>>(); + assert>, UnitClass<{ a: 2; b: 4 }>>>(); + assert>, UnitMeta<{ a: 2; b: 4 }>>>(); }); }); describe("Cubic", () => { it("cubes a unit", () => { - assert< - Equals>, Unit<{ a: 3 }, { b: 6 }>> - >(); + assert>, Unit<{ a: 3 }, { b: 6 }>>>(); assert>, AbstractUnit<{ a: 3 }>>>(); - assert< - Equals< - Cubic>, - UnitConversionRate<{ a: 3 }> - > - >(); + assert>, UnitConversionRate<{ a: 3 }>>>(); }); - assert< - Equals>, UnitClass<{ a: 3; b: 6 }>> - >(); + assert>, UnitClass<{ a: 3; b: 6 }>>>(); assert>, UnitMeta<{ a: 3; b: 6 }>>>(); }); } diff --git a/src/units/modifiers/reciprocal.ts b/src/units/modifiers/reciprocal.ts index b4a192556..6556f04e5 100644 --- a/src/units/modifiers/reciprocal.ts +++ b/src/units/modifiers/reciprocal.ts @@ -1,19 +1,19 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { - type AbstractUnit, - type Inverse, - type InverseUnitSubvalues, - type Unit, - type UnitClass, - type UnitConversionRate, - type UnitMeta, - type UnknownAbstractUnit, - type UnknownUnit, - type UnknownUnitClass, - type UnknownUnitConversionRate, - type UnknownUnitMeta, +import type { + AbstractUnit, + Inverse, + InverseUnitSubvalues, + Unit, + UnitClass, + UnitConversionRate, + UnitMeta, + UnknownAbstractUnit, + UnknownUnit, + UnknownUnitClass, + UnknownUnitConversionRate, + UnknownUnitMeta, } from "#uom-types"; /** @@ -23,28 +23,21 @@ import { * @category General */ export type Reciprocal< - T extends - | UnknownUnit - | UnknownAbstractUnit - | UnknownUnitConversionRate - | UnknownUnitClass - | UnknownUnitMeta, + T extends UnknownUnit | UnknownAbstractUnit | UnknownUnitConversionRate | UnknownUnitClass | UnknownUnitMeta, > = T extends number ? Inverse : T extends UnknownUnitClass - ? UnitClass> - : T extends UnknownUnitMeta - ? UnitMeta> - : never; + ? UnitClass> + : T extends UnknownUnitMeta + ? UnitMeta> + : never; /** * Invert the {@link UnitClass}. * * @deprecated Use {@link Reciprocal} instead. */ -export type ReciprocalUnitClass = UnitClass< - InverseUnitSubvalues ->; +export type ReciprocalUnitClass = UnitClass>; // Tests if (import.meta.vitest !== undefined) { @@ -52,24 +45,11 @@ if (import.meta.vitest !== undefined) { describe("Reciprocal", () => { it("reciprocals a unit", () => { - assert< - Equals>, Unit<{ a: -1 }, { b: -2 }>> - >(); - assert< - Equals>, AbstractUnit<{ a: -1 }>> - >(); - assert< - Equals< - Reciprocal>, - UnitConversionRate<{ a: -1 }> - > - >(); + assert>, Unit<{ a: -1 }, { b: -2 }>>>(); + assert>, AbstractUnit<{ a: -1 }>>>(); + assert>, UnitConversionRate<{ a: -1 }>>>(); }); - assert< - Equals>, UnitClass<{ a: -1; b: -2 }>> - >(); - assert< - Equals>, UnitMeta<{ a: -1; b: -2 }>> - >(); + assert>, UnitClass<{ a: -1; b: -2 }>>>(); + assert>, UnitMeta<{ a: -1; b: -2 }>>>(); }); } diff --git a/src/utils.ts b/src/utils.ts index 9d72668b6..d958a973f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,7 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { assert, type Equals } from "tsafe"; +import { type Equals, assert } from "tsafe"; -import { type UnitSubvalues } from "./core"; +import type { UnitSubvalues } from "./core"; /** * Remove all key from the object that are `never`. @@ -14,19 +14,13 @@ export type RemoveNeverValues = { * Exclude all unit subvalues with an exponent value of zero. */ export type ExcludeUnitZeroSubvalues = { - [S in keyof U as S extends string - ? U[S] extends 0 - ? never - : S - : never]: U[S]; + [S in keyof U as S extends string ? (U[S] extends 0 ? never : S) : never]: U[S]; }; /** * Get the exponent value of the given key. */ -export type GetExponent = S extends keyof C - ? C[S] - : 0; +export type GetExponent = S extends keyof C ? C[S] : 0; /** * Flatten a complex type such as a union or intersection of objects into a @@ -52,12 +46,7 @@ if (import.meta.vitest !== undefined) { describe("Utils", () => { describe("RemoveNeverValues", () => { it("removes nevers", () => { - assert< - Equals< - { a: 1; c: "c" }, - RemoveNeverValues<{ a: 1; b: never; c: "c" }> - > - >(); + assert>>(); }); }); }); diff --git a/tests/core/units/divide.test-d.ts b/tests/core/units/divide.test-d.ts index a6f7ff0d8..f69bdbc4d 100644 --- a/tests/core/units/divide.test-d.ts +++ b/tests/core/units/divide.test-d.ts @@ -1,11 +1,6 @@ import { expectAssignable, expectType } from "tsd"; -import { - type AbstractUnitFrom, - type UnitClass, - type UnitFrom, - type Divide, -} from "#uom-types"; +import type { AbstractUnitFrom, Divide, UnitClass, UnitFrom } from "#uom-types"; type TestUnitClass1 = UnitClass<{ a: 1; b: 2 }>; type TestUnitClass2 = UnitClass<{ a: -2; b: 2 }>; @@ -23,6 +18,4 @@ type TestAbstractUnit3 = AbstractUnitFrom; expectAssignable(0 as TestUnit1); -expectType( - 0 as Divide, -); +expectType(0 as Divide); diff --git a/tests/core/units/inverse.test-d.ts b/tests/core/units/inverse.test-d.ts index 22e989636..b22e12b39 100644 --- a/tests/core/units/inverse.test-d.ts +++ b/tests/core/units/inverse.test-d.ts @@ -1,11 +1,6 @@ import { expectAssignable, expectType } from "tsd"; -import { - type AbstractUnitFrom, - type UnitClass, - type UnitFrom, - type Inverse, -} from "#uom-types"; +import type { AbstractUnitFrom, Inverse, UnitClass, UnitFrom } from "#uom-types"; type TestUnitClass = UnitClass<{ a: 1 }>; type TestUnitClassInv = UnitClass<{ a: -1 }>; diff --git a/tests/core/units/multiply.test-d.ts b/tests/core/units/multiply.test-d.ts index a5730c0f6..772d9ae12 100644 --- a/tests/core/units/multiply.test-d.ts +++ b/tests/core/units/multiply.test-d.ts @@ -1,11 +1,6 @@ import { expectAssignable, expectType } from "tsd"; -import { - type AbstractUnitFrom, - type UnitClass, - type UnitFrom, - type Multiply, -} from "#uom-types"; +import type { AbstractUnitFrom, Multiply, UnitClass, UnitFrom } from "#uom-types"; type TestUnitClass1 = UnitClass<{ a: 1; b: -2 }>; type TestUnitClass2 = UnitClass<{ a: 2; b: 2 }>; @@ -23,6 +18,4 @@ type TestAbstractUnit3 = AbstractUnitFrom; expectAssignable(0 as TestUnit1); -expectType( - 0 as Multiply, -); +expectType(0 as Multiply); diff --git a/tests/functions/abs.test-d.ts b/tests/math/abs.test-d.ts similarity index 78% rename from tests/functions/abs.test-d.ts rename to tests/math/abs.test-d.ts index 1b0318a93..dffdfc776 100644 --- a/tests/functions/abs.test-d.ts +++ b/tests/math/abs.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { abs } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/abs.test.ts b/tests/math/abs.test.ts similarity index 69% rename from tests/functions/abs.test.ts rename to tests/math/abs.test.ts index 674d64a4e..97ba2aabb 100644 --- a/tests/functions/abs.test.ts +++ b/tests/math/abs.test.ts @@ -1,14 +1,14 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { abs } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(abs(4)).equals(4); expect(abs(-4)).equals(4); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 2 }>; const expected = 4 as TestUnit; const actual: typeof expected = abs(-4 as TestUnit); diff --git a/tests/functions/acos.test-d.ts b/tests/math/acos.test-d.ts similarity index 74% rename from tests/functions/acos.test-d.ts rename to tests/math/acos.test-d.ts index 2c35c88c6..c6dc7ce00 100644 --- a/tests/functions/acos.test-d.ts +++ b/tests/math/acos.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { acos } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Unitless; diff --git a/tests/functions/acos.test.ts b/tests/math/acos.test.ts similarity index 58% rename from tests/functions/acos.test.ts rename to tests/math/acos.test.ts index 6931d648d..d3e879570 100644 --- a/tests/functions/acos.test.ts +++ b/tests/math/acos.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { acos } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 0 as Radian; const actual: Radian = acos(1 as Unitless); diff --git a/tests/functions/acosh.test-d.ts b/tests/math/acosh.test-d.ts similarity index 74% rename from tests/functions/acosh.test-d.ts rename to tests/math/acosh.test-d.ts index 5d9b1d1e4..616e8d2a0 100644 --- a/tests/functions/acosh.test-d.ts +++ b/tests/math/acosh.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { acosh } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Unitless; diff --git a/tests/functions/acosh.test.ts b/tests/math/acosh.test.ts similarity index 58% rename from tests/functions/acosh.test.ts rename to tests/math/acosh.test.ts index df60a3d15..5aee5b360 100644 --- a/tests/functions/acosh.test.ts +++ b/tests/math/acosh.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { acosh } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 0 as Radian; const actual: Radian = acosh(1 as Unitless); diff --git a/tests/functions/add.test-d.ts b/tests/math/add.test-d.ts similarity index 90% rename from tests/functions/add.test-d.ts rename to tests/math/add.test-d.ts index 38af10655..1ab7c8a5e 100644 --- a/tests/functions/add.test-d.ts +++ b/tests/math/add.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { add } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/add.test.ts b/tests/math/add.test.ts similarity index 76% rename from tests/functions/add.test.ts rename to tests/math/add.test.ts index 278e78689..642f0b78f 100644 --- a/tests/functions/add.test.ts +++ b/tests/math/add.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { add } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(add(1, 2)).equals(3); expect(add(4, 2)).equals(6); expect(add(1, -2)).equals(-1); expect(add(-1, -2)).equals(-3); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 3 as TestUnit; diff --git a/tests/functions/asin.test-d.ts b/tests/math/asin.test-d.ts similarity index 74% rename from tests/functions/asin.test-d.ts rename to tests/math/asin.test-d.ts index 025de23cf..6d4c01ead 100644 --- a/tests/functions/asin.test-d.ts +++ b/tests/math/asin.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { asin } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Unitless; diff --git a/tests/functions/asin.test.ts b/tests/math/asin.test.ts similarity index 58% rename from tests/functions/asin.test.ts rename to tests/math/asin.test.ts index a198cc304..19dcfe191 100644 --- a/tests/functions/asin.test.ts +++ b/tests/math/asin.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { asin } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 0 as Radian; const actual: Radian = asin(0 as Unitless); diff --git a/tests/functions/asinh.test-d.ts b/tests/math/asinh.test-d.ts similarity index 74% rename from tests/functions/asinh.test-d.ts rename to tests/math/asinh.test-d.ts index 50947f950..edf3abca5 100644 --- a/tests/functions/asinh.test-d.ts +++ b/tests/math/asinh.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { asinh } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Unitless; diff --git a/tests/functions/asinh.test.ts b/tests/math/asinh.test.ts similarity index 58% rename from tests/functions/asinh.test.ts rename to tests/math/asinh.test.ts index 15f06720e..0bfbbb706 100644 --- a/tests/functions/asinh.test.ts +++ b/tests/math/asinh.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { asinh } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 0 as Radian; const actual: Radian = asinh(0 as Unitless); diff --git a/tests/functions/atan.test-d.ts b/tests/math/atan.test-d.ts similarity index 74% rename from tests/functions/atan.test-d.ts rename to tests/math/atan.test-d.ts index 705bc6ab6..37317547a 100644 --- a/tests/functions/atan.test-d.ts +++ b/tests/math/atan.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { atan } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Unitless; diff --git a/tests/functions/atan.test.ts b/tests/math/atan.test.ts similarity index 60% rename from tests/functions/atan.test.ts rename to tests/math/atan.test.ts index d3bc34dce..1a7f5fbdf 100644 --- a/tests/functions/atan.test.ts +++ b/tests/math/atan.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { atan } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = (Math.PI / 4) as Radian; const actual: Radian = atan(1 as Unitless); diff --git a/tests/functions/atan2.test-d.ts b/tests/math/atan2.test-d.ts similarity index 78% rename from tests/functions/atan2.test-d.ts rename to tests/math/atan2.test-d.ts index 9061a031a..1458d2c79 100644 --- a/tests/functions/atan2.test-d.ts +++ b/tests/math/atan2.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { atan2 } from "#uom-types/math"; -import { type Meter, type Radian, type Unitless } from "#uom-types/units"; +import type { Meter, Radian, Unitless } from "#uom-types/units"; declare const a: Unitless; diff --git a/tests/functions/atan2.test.ts b/tests/math/atan2.test.ts similarity index 70% rename from tests/functions/atan2.test.ts rename to tests/math/atan2.test.ts index 3140da296..9e0bd4b5b 100644 --- a/tests/functions/atan2.test.ts +++ b/tests/math/atan2.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { atan2 } from "#uom-types/math"; -import { type Meter, type Radian } from "#uom-types/units"; +import type { Meter, Radian } from "#uom-types/units"; -test("number", () => { +it("number", () => { const expected = (Math.PI / 4) as Radian; const actual: Radian = atan2(2, 2); expect(actual).approximately(expected, 1e-10); }); -test("unit", () => { +it("unit", () => { const expected = (Math.PI / 4) as Radian; const actual: Radian = atan2(2 as Meter, 2 as Meter); diff --git a/tests/functions/atanh.test-d.ts b/tests/math/atanh.test-d.ts similarity index 74% rename from tests/functions/atanh.test-d.ts rename to tests/math/atanh.test-d.ts index 7d98d63fc..d06712d88 100644 --- a/tests/functions/atanh.test-d.ts +++ b/tests/math/atanh.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { atanh } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Unitless; diff --git a/tests/functions/atanh.test.ts b/tests/math/atanh.test.ts similarity index 59% rename from tests/functions/atanh.test.ts rename to tests/math/atanh.test.ts index c1713549e..608bfefb7 100644 --- a/tests/functions/atanh.test.ts +++ b/tests/math/atanh.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { atanh } from "#uom-types/math"; -import { type Radian, type Unitless } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 0.549 as Radian; const actual: Radian = atanh(0.5 as Unitless); diff --git a/tests/functions/ceil.test-d.ts b/tests/math/ceil.test-d.ts similarity index 78% rename from tests/functions/ceil.test-d.ts rename to tests/math/ceil.test-d.ts index 484d247da..f2aa8a51c 100644 --- a/tests/functions/ceil.test-d.ts +++ b/tests/math/ceil.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { ceil } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/ceil.test.ts b/tests/math/ceil.test.ts similarity index 70% rename from tests/functions/ceil.test.ts rename to tests/math/ceil.test.ts index 8bde4c926..a6c9f0246 100644 --- a/tests/functions/ceil.test.ts +++ b/tests/math/ceil.test.ts @@ -1,14 +1,14 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { ceil } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(ceil(4.123)).equals(5); expect(ceil(-4.123)).equals(-4); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 2 }>; const expected = 5 as TestUnit; const actual: typeof expected = ceil(4.123 as TestUnit); diff --git a/tests/functions/cos.test-d.ts b/tests/math/cos.test-d.ts similarity index 74% rename from tests/functions/cos.test-d.ts rename to tests/math/cos.test-d.ts index 40ec0becf..53689e53a 100644 --- a/tests/functions/cos.test-d.ts +++ b/tests/math/cos.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { cos } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Radian; diff --git a/tests/functions/cos.test.ts b/tests/math/cos.test.ts similarity index 60% rename from tests/functions/cos.test.ts rename to tests/math/cos.test.ts index 4a0d4c96d..d7f0b720c 100644 --- a/tests/functions/cos.test.ts +++ b/tests/math/cos.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { cos } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 1 as Unitless; const actual: Unitless = cos((2 * Math.PI) as Radian); diff --git a/tests/functions/cosh.test-d.ts b/tests/math/cosh.test-d.ts similarity index 74% rename from tests/functions/cosh.test-d.ts rename to tests/math/cosh.test-d.ts index bd1525f3e..91e7c9d59 100644 --- a/tests/functions/cosh.test-d.ts +++ b/tests/math/cosh.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { cosh } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Radian; diff --git a/tests/functions/cosh.test.ts b/tests/math/cosh.test.ts similarity index 60% rename from tests/functions/cosh.test.ts rename to tests/math/cosh.test.ts index f643bfd6d..fedb90a90 100644 --- a/tests/functions/cosh.test.ts +++ b/tests/math/cosh.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { cosh } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 11.592 as Unitless; const actual: Unitless = cosh(Math.PI as Radian); diff --git a/tests/functions/div.test-d.ts b/tests/math/div.test-d.ts similarity index 86% rename from tests/functions/div.test-d.ts rename to tests/math/div.test-d.ts index 26f8cd5ce..b58e6aa19 100644 --- a/tests/functions/div.test-d.ts +++ b/tests/math/div.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { div } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/div.test.ts b/tests/math/div.test.ts similarity index 81% rename from tests/functions/div.test.ts rename to tests/math/div.test.ts index b93876d69..cfc750cfe 100644 --- a/tests/functions/div.test.ts +++ b/tests/math/div.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { div } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(div(1, 2)).equals(0.5); expect(div(4, 2)).equals(2); expect(div(1, -2)).equals(-0.5); expect(div(-1, -2)).equals(0.5); }); -test("unit by number", () => { +it("unit by number", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 6 as TestUnit; @@ -22,7 +22,7 @@ test("unit by number", () => { expect(actual).equals(expected); }); -test("number by unit", () => { +it("number by unit", () => { const a = 6; const b = 3 as Unit<{ a: 1; b: -2; c: 3 }>; const expected = 2 as Unit<{ @@ -36,7 +36,7 @@ test("number by unit", () => { expect(actual).equals(expected); }); -test("unit by unit", () => { +it("unit by unit", () => { const a = 6 as Unit<{ a: 1; b: 2; c: 1 }>; const b = 2 as Unit<{ a: 3; b: 2; c: 3 }>; const expected = 3 as Unit<{ a: -2; c: -2 }>; diff --git a/tests/functions/eq.test-d.ts b/tests/math/eq.test-d.ts similarity index 89% rename from tests/functions/eq.test-d.ts rename to tests/math/eq.test-d.ts index bd7a56951..f0e1696ba 100644 --- a/tests/functions/eq.test-d.ts +++ b/tests/math/eq.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { eq } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/eq.test.ts b/tests/math/eq.test.ts similarity index 77% rename from tests/functions/eq.test.ts rename to tests/math/eq.test.ts index 9a3f29cb3..b6a7830ea 100644 --- a/tests/functions/eq.test.ts +++ b/tests/math/eq.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { eq } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(eq(4, 4)).equals(true); expect(eq(-4, -4)).equals(true); expect(eq(-4, 4)).equals(false); expect(eq(4, -4)).equals(false); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions/floor.test-d.ts b/tests/math/floor.test-d.ts similarity index 78% rename from tests/functions/floor.test-d.ts rename to tests/math/floor.test-d.ts index 435ddd0b4..a94b99fe9 100644 --- a/tests/functions/floor.test-d.ts +++ b/tests/math/floor.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { floor } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/floor.test.ts b/tests/math/floor.test.ts similarity index 70% rename from tests/functions/floor.test.ts rename to tests/math/floor.test.ts index f535ef476..9ae54c30f 100644 --- a/tests/functions/floor.test.ts +++ b/tests/math/floor.test.ts @@ -1,14 +1,14 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { floor } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(floor(4.123)).equals(4); expect(floor(-4.123)).equals(-5); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 2 }>; const expected = 4 as TestUnit; const actual: typeof expected = floor(4.123 as TestUnit); diff --git a/tests/functions/gt.test-d.ts b/tests/math/gt.test-d.ts similarity index 89% rename from tests/functions/gt.test-d.ts rename to tests/math/gt.test-d.ts index 7f36ddbe1..84930e1ef 100644 --- a/tests/functions/gt.test-d.ts +++ b/tests/math/gt.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gt } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/gt.test.ts b/tests/math/gt.test.ts similarity index 75% rename from tests/functions/gt.test.ts rename to tests/math/gt.test.ts index 980e0cd9e..19926cccc 100644 --- a/tests/functions/gt.test.ts +++ b/tests/math/gt.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gt } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(gt(4, 4)).equals(false); expect(gt(4, 3)).equals(true); expect(gt(3, 4)).equals(false); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions/gte.test-d.ts b/tests/math/gte.test-d.ts similarity index 89% rename from tests/functions/gte.test-d.ts rename to tests/math/gte.test-d.ts index c054bdeac..2c64f1b72 100644 --- a/tests/functions/gte.test-d.ts +++ b/tests/math/gte.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gte } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/gte.test.ts b/tests/math/gte.test.ts similarity index 75% rename from tests/functions/gte.test.ts rename to tests/math/gte.test.ts index 6e9a70e3f..219e9454e 100644 --- a/tests/functions/gte.test.ts +++ b/tests/math/gte.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gte } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(gte(4, 4)).equals(true); expect(gte(4, 3)).equals(true); expect(gte(3, 4)).equals(false); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions-ho/add.test-d.ts b/tests/math/higher-order/add.test-d.ts similarity index 90% rename from tests/functions-ho/add.test-d.ts rename to tests/math/higher-order/add.test-d.ts index 8f12891ad..ea840742d 100644 --- a/tests/functions-ho/add.test-d.ts +++ b/tests/math/higher-order/add.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { add } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/add.test.ts b/tests/math/higher-order/add.test.ts similarity index 76% rename from tests/functions-ho/add.test.ts rename to tests/math/higher-order/add.test.ts index 9d4f77baf..0792eac40 100644 --- a/tests/functions-ho/add.test.ts +++ b/tests/math/higher-order/add.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { add } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(add(1)(2)).equals(3); expect(add(4)(2)).equals(6); expect(add(1)(-2)).equals(-1); expect(add(-1)(-2)).equals(-3); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 3 as TestUnit; diff --git a/tests/functions-ho/div.test-d.ts b/tests/math/higher-order/div.test-d.ts similarity index 86% rename from tests/functions-ho/div.test-d.ts rename to tests/math/higher-order/div.test-d.ts index e6f2bb380..18611ff5b 100644 --- a/tests/functions-ho/div.test-d.ts +++ b/tests/math/higher-order/div.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { div } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/div.test.ts b/tests/math/higher-order/div.test.ts similarity index 81% rename from tests/functions-ho/div.test.ts rename to tests/math/higher-order/div.test.ts index 7666c6f5f..39376bd00 100644 --- a/tests/functions-ho/div.test.ts +++ b/tests/math/higher-order/div.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { div } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(div(2)(1)).equals(0.5); expect(div(2)(4)).equals(2); expect(div(-2)(1)).equals(-0.5); expect(div(-2)(-1)).equals(0.5); }); -test("unit by number", () => { +it("unit by number", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 6 as TestUnit; @@ -22,7 +22,7 @@ test("unit by number", () => { expect(actual).equals(expected); }); -test("number by unit", () => { +it("number by unit", () => { const a = 6; const b = 3 as Unit<{ a: 1; b: -2; c: 3 }>; const expected = 2 as Unit<{ @@ -36,7 +36,7 @@ test("number by unit", () => { expect(actual).equals(expected); }); -test("unit by unit", () => { +it("unit by unit", () => { const a = 6 as Unit<{ a: 1; b: 2; c: 1 }>; const b = 2 as Unit<{ a: 3; b: 2; c: 3 }>; const expected = 3 as Unit<{ a: -2; c: -2 }>; diff --git a/tests/functions-ho/eq.test-d.ts b/tests/math/higher-order/eq.test-d.ts similarity index 89% rename from tests/functions-ho/eq.test-d.ts rename to tests/math/higher-order/eq.test-d.ts index 77b592774..51f21edbb 100644 --- a/tests/functions-ho/eq.test-d.ts +++ b/tests/math/higher-order/eq.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { eq } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/eq.test.ts b/tests/math/higher-order/eq.test.ts similarity index 77% rename from tests/functions-ho/eq.test.ts rename to tests/math/higher-order/eq.test.ts index 599ecbe17..55d66e586 100644 --- a/tests/functions-ho/eq.test.ts +++ b/tests/math/higher-order/eq.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { eq } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(eq(4)(4)).equals(true); expect(eq(-4)(-4)).equals(true); expect(eq(-4)(4)).equals(false); expect(eq(4)(-4)).equals(false); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions-ho/gt.test-d.ts b/tests/math/higher-order/gt.test-d.ts similarity index 89% rename from tests/functions-ho/gt.test-d.ts rename to tests/math/higher-order/gt.test-d.ts index 2465bd419..613f329c5 100644 --- a/tests/functions-ho/gt.test-d.ts +++ b/tests/math/higher-order/gt.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gt } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/gt.test.ts b/tests/math/higher-order/gt.test.ts similarity index 75% rename from tests/functions-ho/gt.test.ts rename to tests/math/higher-order/gt.test.ts index a1142141f..ffc905344 100644 --- a/tests/functions-ho/gt.test.ts +++ b/tests/math/higher-order/gt.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gt } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(gt(4)(4)).equals(false); expect(gt(3)(4)).equals(true); expect(gt(4)(3)).equals(false); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions-ho/gte.test-d.ts b/tests/math/higher-order/gte.test-d.ts similarity index 89% rename from tests/functions-ho/gte.test-d.ts rename to tests/math/higher-order/gte.test-d.ts index b17e43ff5..ad0fe1e30 100644 --- a/tests/functions-ho/gte.test-d.ts +++ b/tests/math/higher-order/gte.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gte } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/gte.test.ts b/tests/math/higher-order/gte.test.ts similarity index 75% rename from tests/functions-ho/gte.test.ts rename to tests/math/higher-order/gte.test.ts index 127534d07..fd35f461e 100644 --- a/tests/functions-ho/gte.test.ts +++ b/tests/math/higher-order/gte.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { gte } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(gte(4)(4)).equals(true); expect(gte(3)(4)).equals(true); expect(gte(4)(3)).equals(false); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions-ho/lt.test-d.ts b/tests/math/higher-order/lt.test-d.ts similarity index 89% rename from tests/functions-ho/lt.test-d.ts rename to tests/math/higher-order/lt.test-d.ts index 05dfc3178..b7be97149 100644 --- a/tests/functions-ho/lt.test-d.ts +++ b/tests/math/higher-order/lt.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lt } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/lt.test.ts b/tests/math/higher-order/lt.test.ts similarity index 75% rename from tests/functions-ho/lt.test.ts rename to tests/math/higher-order/lt.test.ts index b9942d758..41413d836 100644 --- a/tests/functions-ho/lt.test.ts +++ b/tests/math/higher-order/lt.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lt } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(lt(4)(4)).equals(false); expect(lt(3)(4)).equals(false); expect(lt(4)(3)).equals(true); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions-ho/lte.test-d.ts b/tests/math/higher-order/lte.test-d.ts similarity index 89% rename from tests/functions-ho/lte.test-d.ts rename to tests/math/higher-order/lte.test-d.ts index 8c36c0f3e..c592104c0 100644 --- a/tests/functions-ho/lte.test-d.ts +++ b/tests/math/higher-order/lte.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lte } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/lte.test.ts b/tests/math/higher-order/lte.test.ts similarity index 75% rename from tests/functions-ho/lte.test.ts rename to tests/math/higher-order/lte.test.ts index f13dd8025..08750e23f 100644 --- a/tests/functions-ho/lte.test.ts +++ b/tests/math/higher-order/lte.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lte } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(lte(4)(4)).equals(true); expect(lte(3)(4)).equals(false); expect(lte(4)(3)).equals(true); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions-ho/mod-safe.test-d.ts b/tests/math/higher-order/mod-safe.test-d.ts similarity index 89% rename from tests/functions-ho/mod-safe.test-d.ts rename to tests/math/higher-order/mod-safe.test-d.ts index 833a0ded3..a9503a10b 100644 --- a/tests/functions-ho/mod-safe.test-d.ts +++ b/tests/math/higher-order/mod-safe.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { modSafe } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/mod-safe.test.ts b/tests/math/higher-order/mod-safe.test.ts similarity index 82% rename from tests/functions-ho/mod-safe.test.ts rename to tests/math/higher-order/mod-safe.test.ts index f3bf7006b..e92068d13 100644 --- a/tests/functions-ho/mod-safe.test.ts +++ b/tests/math/higher-order/mod-safe.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { modSafe } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(modSafe(3)(10)).equals(1); expect(modSafe(3)(11)).equals(2); expect(modSafe(3)(12)).equals(0); expect(modSafe(3)(-8)).equals(1); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 10 as TestUnit; diff --git a/tests/functions-ho/mod.test-d.ts b/tests/math/higher-order/mod.test-d.ts similarity index 89% rename from tests/functions-ho/mod.test-d.ts rename to tests/math/higher-order/mod.test-d.ts index a299c580b..1b1d8683a 100644 --- a/tests/functions-ho/mod.test-d.ts +++ b/tests/math/higher-order/mod.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mod } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/mod.test.ts b/tests/math/higher-order/mod.test.ts similarity index 81% rename from tests/functions-ho/mod.test.ts rename to tests/math/higher-order/mod.test.ts index 27cd30f3f..83914e2ab 100644 --- a/tests/functions-ho/mod.test.ts +++ b/tests/math/higher-order/mod.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mod } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(mod(3)(10)).equals(1); expect(mod(3)(11)).equals(2); expect(mod(3)(12)).equals(0); expect(mod(3)(-8)).equals(-2); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 10 as TestUnit; diff --git a/tests/functions-ho/mul.test-d.ts b/tests/math/higher-order/mul.test-d.ts similarity index 88% rename from tests/functions-ho/mul.test-d.ts rename to tests/math/higher-order/mul.test-d.ts index c79ec130c..93d2606c9 100644 --- a/tests/functions-ho/mul.test-d.ts +++ b/tests/math/higher-order/mul.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mul } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/mul.test.ts b/tests/math/higher-order/mul.test.ts similarity index 78% rename from tests/functions-ho/mul.test.ts rename to tests/math/higher-order/mul.test.ts index ae5dfc1ca..ab6d36093 100644 --- a/tests/functions-ho/mul.test.ts +++ b/tests/math/higher-order/mul.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mul } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(mul(1)(2)).equals(2); expect(mul(4)(2)).equals(8); expect(mul(1)(-2)).equals(-2); expect(mul(-1)(-2)).equals(2); }); -test("unit by number", () => { +it("unit by number", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 3 as TestUnit; @@ -22,7 +22,7 @@ test("unit by number", () => { expect(actual).equals(expected); }); -test("unit by unit", () => { +it("unit by unit", () => { const a = 3 as Unit<{ a: 1; b: 2; c: 1 }>; const b = 2 as Unit<{ a: 3; b: -2; c: 3 }>; const expected = 6 as Unit<{ a: 4; c: 4 }>; diff --git a/tests/functions-ho/pow.test-d.ts b/tests/math/higher-order/pow.test-d.ts similarity index 89% rename from tests/functions-ho/pow.test-d.ts rename to tests/math/higher-order/pow.test-d.ts index a191c6fae..ec35af254 100644 --- a/tests/functions-ho/pow.test-d.ts +++ b/tests/math/higher-order/pow.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { pow } from "#uom-types/math"; declare const a: Unit<{ a: 2 }>; diff --git a/tests/functions-ho/pow.test.ts b/tests/math/higher-order/pow.test.ts similarity index 89% rename from tests/functions-ho/pow.test.ts rename to tests/math/higher-order/pow.test.ts index f7d9fe169..c44dbe66a 100644 --- a/tests/functions-ho/pow.test.ts +++ b/tests/math/higher-order/pow.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { pow } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(pow(-1)(4)).equals(0.25); expect(pow(0)(4)).equals(1); expect(pow(0.5)(4)).equals(2); @@ -13,7 +13,7 @@ test("numbers", () => { expect(pow(5)(4)).equals(1024); }); -test("unit by number", () => { +it("unit by number", () => { const a = 4 as Unit<{ a: -2; b: 2 }>; const expected1 = 0.25 as Unit<{ a: 2; b: -2 }>; diff --git a/tests/functions-ho/root.test-d.ts b/tests/math/higher-order/root.test-d.ts similarity index 85% rename from tests/functions-ho/root.test-d.ts rename to tests/math/higher-order/root.test-d.ts index dd7954910..2c8fce690 100644 --- a/tests/functions-ho/root.test-d.ts +++ b/tests/math/higher-order/root.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { root } from "#uom-types/math"; declare const a: Unit<{ a: 6 }>; diff --git a/tests/functions-ho/root.test.ts b/tests/math/higher-order/root.test.ts similarity index 84% rename from tests/functions-ho/root.test.ts rename to tests/math/higher-order/root.test.ts index c6ceec5b4..e3e443c7d 100644 --- a/tests/functions-ho/root.test.ts +++ b/tests/math/higher-order/root.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { root } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(root(0.5)(64)).equals(4096); expect(root(1)(64)).approximately(64, 1e-10); expect(root(2)(64)).approximately(8, 1e-10); expect(root(3)(64)).approximately(4, 1e-10); }); -test("unit by number", () => { +it("unit by number", () => { const a = 64 as Unit<{ a: -6; b: 6 }>; const expected4 = 64 as Unit<{ a: -6; b: 6 }>; diff --git a/tests/functions-ho/sub.test-d.ts b/tests/math/higher-order/sub.test-d.ts similarity index 90% rename from tests/functions-ho/sub.test-d.ts rename to tests/math/higher-order/sub.test-d.ts index 445a3e279..e0ec0679f 100644 --- a/tests/functions-ho/sub.test-d.ts +++ b/tests/math/higher-order/sub.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sub } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions-ho/sub.test.ts b/tests/math/higher-order/sub.test.ts similarity index 76% rename from tests/functions-ho/sub.test.ts rename to tests/math/higher-order/sub.test.ts index 12be3f710..85d186041 100644 --- a/tests/functions-ho/sub.test.ts +++ b/tests/math/higher-order/sub.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sub } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(sub(2)(1)).equals(-1); expect(sub(2)(4)).equals(2); expect(sub(-2)(1)).equals(3); expect(sub(-2)(-1)).equals(1); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 3 as TestUnit; diff --git a/tests/functions/inverse.test-d.ts b/tests/math/inverse.test-d.ts similarity index 83% rename from tests/functions/inverse.test-d.ts rename to tests/math/inverse.test-d.ts index 6d9ec2c78..a26ad87e4 100644 --- a/tests/functions/inverse.test-d.ts +++ b/tests/math/inverse.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { inverse } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/inverse.test.ts b/tests/math/inverse.test.ts similarity index 71% rename from tests/functions/inverse.test.ts rename to tests/math/inverse.test.ts index ca1c3703d..9c86c45cb 100644 --- a/tests/functions/inverse.test.ts +++ b/tests/math/inverse.test.ts @@ -1,14 +1,14 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { inverse } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(inverse(4)).equals(0.25); expect(inverse(0.25)).equals(4); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: -1; b: 2; c: -2 }>; const expected = 0.25 as TestUnit; const actual: Unit<{ a: 1; b: -2; c: 2 }> = inverse(4 as TestUnit); diff --git a/tests/functions/lt.test-d.ts b/tests/math/lt.test-d.ts similarity index 89% rename from tests/functions/lt.test-d.ts rename to tests/math/lt.test-d.ts index 7468040f4..7bc5fab1e 100644 --- a/tests/functions/lt.test-d.ts +++ b/tests/math/lt.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lt } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/lt.test.ts b/tests/math/lt.test.ts similarity index 75% rename from tests/functions/lt.test.ts rename to tests/math/lt.test.ts index d78bca418..670267634 100644 --- a/tests/functions/lt.test.ts +++ b/tests/math/lt.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lt } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(lt(4, 4)).equals(false); expect(lt(4, 3)).equals(false); expect(lt(3, 4)).equals(true); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions/lte.test-d.ts b/tests/math/lte.test-d.ts similarity index 89% rename from tests/functions/lte.test-d.ts rename to tests/math/lte.test-d.ts index f59b22793..545726b39 100644 --- a/tests/functions/lte.test-d.ts +++ b/tests/math/lte.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lte } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/lte.test.ts b/tests/math/lte.test.ts similarity index 75% rename from tests/functions/lte.test.ts rename to tests/math/lte.test.ts index 39b8e910e..550830b06 100644 --- a/tests/functions/lte.test.ts +++ b/tests/math/lte.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { lte } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(lte(4, 4)).equals(true); expect(lte(4, 3)).equals(false); expect(lte(3, 4)).equals(true); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: 1; b: -2; c: 2 }>; const b = 2 as Unit<{ a: 1; b: -2; c: 2 }>; diff --git a/tests/functions/max.test-d.ts b/tests/math/max.test-d.ts similarity index 79% rename from tests/functions/max.test-d.ts rename to tests/math/max.test-d.ts index 3f6f51810..fef95fb6a 100644 --- a/tests/functions/max.test-d.ts +++ b/tests/math/max.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { max } from "#uom-types/math"; declare const a: Array>; diff --git a/tests/functions/max.test.ts b/tests/math/max.test.ts similarity index 72% rename from tests/functions/max.test.ts rename to tests/math/max.test.ts index 1c098a6b1..8e259d0bd 100644 --- a/tests/functions/max.test.ts +++ b/tests/math/max.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { max } from "#uom-types/math"; -test("number", () => { +it("number", () => { const list = [1, 3, 6, 4, -5, 2]; expect(max(list)).equals(6); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const list = [1, 3, 6, 4, -5, 2] as TestUnit[]; const expected = 6 as TestUnit; diff --git a/tests/functions/min.test-d.ts b/tests/math/min.test-d.ts similarity index 79% rename from tests/functions/min.test-d.ts rename to tests/math/min.test-d.ts index 5ae76a6c6..f24e0a2a5 100644 --- a/tests/functions/min.test-d.ts +++ b/tests/math/min.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { min } from "#uom-types/math"; declare const a: Array>; diff --git a/tests/functions/min.test.ts b/tests/math/min.test.ts similarity index 72% rename from tests/functions/min.test.ts rename to tests/math/min.test.ts index 5e9c41d55..8f3c9881e 100644 --- a/tests/functions/min.test.ts +++ b/tests/math/min.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { min } from "#uom-types/math"; -test("number", () => { +it("number", () => { const list = [1, 3, 6, 4, -5, 2]; expect(min(list)).equals(-5); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const list = [1, 3, 6, 4, -5, 2] as TestUnit[]; const expected = -5 as TestUnit; diff --git a/tests/functions/mod-safe.test-d.ts b/tests/math/mod-safe.test-d.ts similarity index 89% rename from tests/functions/mod-safe.test-d.ts rename to tests/math/mod-safe.test-d.ts index bb7afefec..efc347c4e 100644 --- a/tests/functions/mod-safe.test-d.ts +++ b/tests/math/mod-safe.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { modSafe } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/mod-safe.test.ts b/tests/math/mod-safe.test.ts similarity index 81% rename from tests/functions/mod-safe.test.ts rename to tests/math/mod-safe.test.ts index 45b0e93ed..77232ddb8 100644 --- a/tests/functions/mod-safe.test.ts +++ b/tests/math/mod-safe.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { modSafe } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(modSafe(10, 3)).equals(1); expect(modSafe(11, 3)).equals(2); expect(modSafe(12, 3)).equals(0); expect(modSafe(-8, 3)).equals(1); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 10 as TestUnit; diff --git a/tests/functions/mod.test-d.ts b/tests/math/mod.test-d.ts similarity index 89% rename from tests/functions/mod.test-d.ts rename to tests/math/mod.test-d.ts index 74d77e920..cba9153d6 100644 --- a/tests/functions/mod.test-d.ts +++ b/tests/math/mod.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mod } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/mod.test.ts b/tests/math/mod.test.ts similarity index 81% rename from tests/functions/mod.test.ts rename to tests/math/mod.test.ts index 4168f3df2..c73fa1476 100644 --- a/tests/functions/mod.test.ts +++ b/tests/math/mod.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mod } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(mod(10, 3)).equals(1); expect(mod(11, 3)).equals(2); expect(mod(12, 3)).equals(0); expect(mod(-8, 3)).equals(-2); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 10 as TestUnit; diff --git a/tests/functions/mul.test-d.ts b/tests/math/mul.test-d.ts similarity index 88% rename from tests/functions/mul.test-d.ts rename to tests/math/mul.test-d.ts index 03f759b6e..58569bf40 100644 --- a/tests/functions/mul.test-d.ts +++ b/tests/math/mul.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mul } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/mul.test.ts b/tests/math/mul.test.ts similarity index 78% rename from tests/functions/mul.test.ts rename to tests/math/mul.test.ts index 4b48a04ba..9ed3790b6 100644 --- a/tests/functions/mul.test.ts +++ b/tests/math/mul.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { mul } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(mul(1, 2)).equals(2); expect(mul(4, 2)).equals(8); expect(mul(1, -2)).equals(-2); expect(mul(-1, -2)).equals(2); }); -test("unit by number", () => { +it("unit by number", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 3 as TestUnit; @@ -22,7 +22,7 @@ test("unit by number", () => { expect(actual).equals(expected); }); -test("unit by unit", () => { +it("unit by unit", () => { const a = 3 as Unit<{ a: 1; b: 2; c: 1 }>; const b = 2 as Unit<{ a: 3; b: -2; c: 3 }>; const expected = 6 as Unit<{ a: 4; c: 4 }>; diff --git a/tests/functions/negate.test-d.ts b/tests/math/negate.test-d.ts similarity index 79% rename from tests/functions/negate.test-d.ts rename to tests/math/negate.test-d.ts index e99e248f6..c5cc4c8b4 100644 --- a/tests/functions/negate.test-d.ts +++ b/tests/math/negate.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { negate } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/negate.test.ts b/tests/math/negate.test.ts similarity index 70% rename from tests/functions/negate.test.ts rename to tests/math/negate.test.ts index 260156e1b..fbdef4477 100644 --- a/tests/functions/negate.test.ts +++ b/tests/math/negate.test.ts @@ -1,14 +1,14 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { negate } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(negate(4)).equals(-4); expect(negate(-4)).equals(4); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 2 }>; const expected = -4 as TestUnit; const actual: typeof expected = negate(4 as TestUnit); diff --git a/tests/functions/pow.test-d.ts b/tests/math/pow.test-d.ts similarity index 89% rename from tests/functions/pow.test-d.ts rename to tests/math/pow.test-d.ts index a696a4d1b..50d2486d7 100644 --- a/tests/functions/pow.test-d.ts +++ b/tests/math/pow.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { pow } from "#uom-types/math"; declare const a: Unit<{ a: 2 }>; diff --git a/tests/functions/pow.test.ts b/tests/math/pow.test.ts similarity index 89% rename from tests/functions/pow.test.ts rename to tests/math/pow.test.ts index 573ecacbf..846df7273 100644 --- a/tests/functions/pow.test.ts +++ b/tests/math/pow.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { pow } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(pow(4, -1)).equals(0.25); expect(pow(4, 0)).equals(1); expect(pow(4, 0.5)).equals(2); @@ -13,7 +13,7 @@ test("numbers", () => { expect(pow(4, 5)).equals(1024); }); -test("unit by number", () => { +it("unit by number", () => { const a = 4 as Unit<{ a: -2; b: 2 }>; const expected1 = 0.25 as Unit<{ a: 2; b: -2 }>; diff --git a/tests/functions/root.test-d.ts b/tests/math/root.test-d.ts similarity index 85% rename from tests/functions/root.test-d.ts rename to tests/math/root.test-d.ts index 689901df4..b7eb3ac5b 100644 --- a/tests/functions/root.test-d.ts +++ b/tests/math/root.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { root } from "#uom-types/math"; declare const a: Unit<{ a: 6 }>; diff --git a/tests/functions/root.test.ts b/tests/math/root.test.ts similarity index 85% rename from tests/functions/root.test.ts rename to tests/math/root.test.ts index 859597d8c..68f3e003e 100644 --- a/tests/functions/root.test.ts +++ b/tests/math/root.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { root } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(root(64, -1)).approximately(1 / 64, 1e-10); expect(root(64, 0.5)).approximately(4096, 1e-10); expect(root(64, 1)).approximately(64, 1e-10); @@ -11,7 +11,7 @@ test("numbers", () => { expect(root(64, 3)).approximately(4, 1e-10); }); -test("unit by number", () => { +it("unit by number", () => { const a = 64 as Unit<{ a: -6; b: 6 }>; const expected4 = 64 as Unit<{ a: -6; b: 6 }>; diff --git a/tests/functions/round.test-d.ts b/tests/math/round.test-d.ts similarity index 78% rename from tests/functions/round.test-d.ts rename to tests/math/round.test-d.ts index 8f5857856..a6557e81b 100644 --- a/tests/functions/round.test-d.ts +++ b/tests/math/round.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { round } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/round.test.ts b/tests/math/round.test.ts similarity index 75% rename from tests/functions/round.test.ts rename to tests/math/round.test.ts index 0cce9986e..393ef326c 100644 --- a/tests/functions/round.test.ts +++ b/tests/math/round.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { round } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(round(4.123)).equals(4); expect(round(-4.123)).equals(-4); expect(round(4.987)).equals(5); expect(round(-4.987)).equals(-5); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 2 }>; const a = 4.123 as TestUnit; diff --git a/tests/functions/sin.test-d.ts b/tests/math/sin.test-d.ts similarity index 74% rename from tests/functions/sin.test-d.ts rename to tests/math/sin.test-d.ts index 09275d08f..d4cceff05 100644 --- a/tests/functions/sin.test-d.ts +++ b/tests/math/sin.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { sin } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Radian; diff --git a/tests/functions/sin.test.ts b/tests/math/sin.test.ts similarity index 60% rename from tests/functions/sin.test.ts rename to tests/math/sin.test.ts index 14d261005..6c6f76a72 100644 --- a/tests/functions/sin.test.ts +++ b/tests/math/sin.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { sin } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 0 as Unitless; const actual: Unitless = sin((2 * Math.PI) as Radian); diff --git a/tests/functions/sinh.test-d.ts b/tests/math/sinh.test-d.ts similarity index 74% rename from tests/functions/sinh.test-d.ts rename to tests/math/sinh.test-d.ts index 279e48cda..4c58e8fef 100644 --- a/tests/functions/sinh.test-d.ts +++ b/tests/math/sinh.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { sinh } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Radian; diff --git a/tests/functions/sinh.test.ts b/tests/math/sinh.test.ts similarity index 60% rename from tests/functions/sinh.test.ts rename to tests/math/sinh.test.ts index 9982e7032..9a269ec85 100644 --- a/tests/functions/sinh.test.ts +++ b/tests/math/sinh.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { sinh } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 11.549 as Unitless; const actual: Unitless = sinh(Math.PI as Radian); diff --git a/tests/functions/sqrt.test-d.ts b/tests/math/sqrt.test-d.ts similarity index 78% rename from tests/functions/sqrt.test-d.ts rename to tests/math/sqrt.test-d.ts index 96a0a84a9..63babbe67 100644 --- a/tests/functions/sqrt.test-d.ts +++ b/tests/math/sqrt.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sqrt } from "#uom-types/math"; declare const a: Unit<{ a: 2 }>; diff --git a/tests/functions/sqrt.test.ts b/tests/math/sqrt.test.ts similarity index 66% rename from tests/functions/sqrt.test.ts rename to tests/math/sqrt.test.ts index 7791d1ca6..436e92522 100644 --- a/tests/functions/sqrt.test.ts +++ b/tests/math/sqrt.test.ts @@ -1,13 +1,13 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sqrt } from "#uom-types/math"; -test("number", () => { +it("number", () => { expect(sqrt(4)).equals(2); }); -test("unit", () => { +it("unit", () => { const a = 4 as Unit<{ a: -2; b: 4 }>; const expected = 2 as Unit<{ a: -1; b: 2 }>; const actual: typeof expected = sqrt(a); diff --git a/tests/functions/sub.test-d.ts b/tests/math/sub.test-d.ts similarity index 90% rename from tests/functions/sub.test-d.ts rename to tests/math/sub.test-d.ts index 7862cbead..17ad9ebc8 100644 --- a/tests/functions/sub.test-d.ts +++ b/tests/math/sub.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sub } from "#uom-types/math"; declare const a: Unit<{ a: 1 }>; diff --git a/tests/functions/sub.test.ts b/tests/math/sub.test.ts similarity index 76% rename from tests/functions/sub.test.ts rename to tests/math/sub.test.ts index 03ebac122..6c2498caa 100644 --- a/tests/functions/sub.test.ts +++ b/tests/math/sub.test.ts @@ -1,16 +1,16 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sub } from "#uom-types/math"; -test("numbers", () => { +it("numbers", () => { expect(sub(1, 2)).equals(-1); expect(sub(4, 2)).equals(2); expect(sub(1, -2)).equals(3); expect(sub(-1, -2)).equals(1); }); -test("units", () => { +it("units", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const a = 3 as TestUnit; diff --git a/tests/functions/sum.test-d.ts b/tests/math/sum.test-d.ts similarity index 79% rename from tests/functions/sum.test-d.ts rename to tests/math/sum.test-d.ts index a9b11d0a0..3733c6cd3 100644 --- a/tests/functions/sum.test-d.ts +++ b/tests/math/sum.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from "tsd"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sum } from "#uom-types/math"; declare const a: Array>; diff --git a/tests/functions/sum.test.ts b/tests/math/sum.test.ts similarity index 73% rename from tests/functions/sum.test.ts rename to tests/math/sum.test.ts index 618ec7461..4e811e32a 100644 --- a/tests/functions/sum.test.ts +++ b/tests/math/sum.test.ts @@ -1,15 +1,15 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; -import { type Unit } from "#uom-types"; +import type { Unit } from "#uom-types"; import { sum } from "#uom-types/math"; -test("number", () => { +it("number", () => { const list = [1, 3, 6, 4, -5, 2]; expect(sum(list)).equals(11); }); -test("unit", () => { +it("unit", () => { type TestUnit = Unit<{ a: 1; b: -2; c: 3 }>; const list = [1, 3, 6, 4, -5, 2] as TestUnit[]; const expected = 11 as TestUnit; diff --git a/tests/functions/tan.test-d.ts b/tests/math/tan.test-d.ts similarity index 74% rename from tests/functions/tan.test-d.ts rename to tests/math/tan.test-d.ts index 9f28ea799..5b0b31235 100644 --- a/tests/functions/tan.test-d.ts +++ b/tests/math/tan.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { tan } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Radian; diff --git a/tests/functions/tan.test.ts b/tests/math/tan.test.ts similarity index 60% rename from tests/functions/tan.test.ts rename to tests/math/tan.test.ts index 83ab16702..7242fa81b 100644 --- a/tests/functions/tan.test.ts +++ b/tests/math/tan.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { tan } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 1 as Unitless; const actual: Unitless = tan((Math.PI / 4) as Radian); diff --git a/tests/functions/tanh.test-d.ts b/tests/math/tanh.test-d.ts similarity index 74% rename from tests/functions/tanh.test-d.ts rename to tests/math/tanh.test-d.ts index 516e57f8f..da9d41be9 100644 --- a/tests/functions/tanh.test-d.ts +++ b/tests/math/tanh.test-d.ts @@ -1,7 +1,7 @@ import { expectType } from "tsd"; import { tanh } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; declare const a: Radian; diff --git a/tests/functions/tanh.test.ts b/tests/math/tanh.test.ts similarity index 60% rename from tests/functions/tanh.test.ts rename to tests/math/tanh.test.ts index 8c2c79428..d95464d72 100644 --- a/tests/functions/tanh.test.ts +++ b/tests/math/tanh.test.ts @@ -1,9 +1,9 @@ -import { expect, test } from "vitest"; +import { expect, it } from "vitest"; import { tanh } from "#uom-types/math"; -import { type Unitless, type Radian } from "#uom-types/units"; +import type { Radian, Unitless } from "#uom-types/units"; -test("unit", () => { +it("unit", () => { const expected = 0.996 as Unitless; const actual: Unitless = tanh(Math.PI as Radian); diff --git a/tests/units/in-functions.test.ts b/tests/units/in-functions.test.ts index 19977ef7e..8329579fe 100644 --- a/tests/units/in-functions.test.ts +++ b/tests/units/in-functions.test.ts @@ -1,18 +1,9 @@ -import { expect, test } from "vitest"; - -import { add, mul, add as addHo, mul as mulHo } from "#uom-types/math"; -import { - type Cubic, - type VolumeUnit, - type Square, - type AreaUnit, - type Length, - type Meter, - type Centi, - type Milli, -} from "#uom-types/units"; - -test("unit by number", () => { +import { expect, it } from "vitest"; + +import { add, add as addHo, mul, mul as mulHo } from "#uom-types/math"; +import type { AreaUnit, Centi, Cubic, Length, Meter, Milli, Square, VolumeUnit } from "#uom-types/units"; + +it("unit by number", () => { const a = 3 as Meter; const b = 2; const expected = 6 as Meter; @@ -22,7 +13,7 @@ test("unit by number", () => { expect(actual).equals(expected); }); -test("unit by unit", () => { +it("unit by unit", () => { const a = 3 as Square; const b = 2 as Meter; const expected = 6 as Cubic; @@ -32,7 +23,7 @@ test("unit by unit", () => { expect(actual).equals(expected); }); -test("unit by unit - different scalars", () => { +it("unit by unit - different scalars", () => { const a = 3 as Square; const b = 2 as Centi; const expected = 6 as VolumeUnit<{ scalar10: -2 }>; @@ -42,7 +33,7 @@ test("unit by unit - different scalars", () => { expect(actual).equals(expected); }); -test("generics", () => { +it("generics", () => { function fnAdd(a: T, b: T) { return add(a, b); } @@ -69,7 +60,7 @@ test("generics", () => { expect(actualMul2).equals(expectedMul2); }); -test("generics - higher order", () => { +it("generics - higher order", () => { function fnAdd(a: L) { return addHo(a); }