inferred-types 0.55.14 → 0.55.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5738,7 +5738,7 @@ type InvalidNever = Throw<"invalid-never", `The value of T when calling IsWideTy
5738
5738
  type IsWideType<T, TNever = InvalidNever> = [IsNever<T>] extends [true] ? TNever : [T] extends [ErrorCondition] ? ProxyError<T, "IsWideType"> : IsWideScalar<T> extends true ? true : IsWideContainer<T> extends true ? true : IsWideUnion<T> extends true ? true : false;
5739
5739
 
5740
5740
  type Process$1k<T extends readonly unknown[]> = {
5741
- [K in keyof T]: IsWideType<T[K]>;
5741
+ [K in keyof T]: IsWideType<T[K]> extends true ? true : Or<[IsUndefined<T[K]>, IsNull<T[K]>]> extends true ? true : false;
5742
5742
  };
5743
5743
  /**
5744
5744
  * **IsWideUnion**`<T>`
@@ -12328,6 +12328,160 @@ type FrequencyUom = {
12328
12328
  */
12329
12329
  type Frequency = `${number}${OptSpace}${FrequencyUom}`;
12330
12330
 
12331
+ /**
12332
+ * **MetricCategory**
12333
+ *
12334
+ * A valid "category" for a `Metric` or `Uom`.
12335
+ *
12336
+ * **Related:** `Uom`, `Metric`
12337
+ */
12338
+ type MetricCategory = "Acceleration" | "Area" | "Current" | "Distance" | "Frequency" | "Luminosity" | "Mass" | "Power" | "Pressure" | "Resistance" | "Speed" | "Temperature" | "Time" | "Voltage" | "Volume";
12339
+ type UnitsByCategory<T extends string, M extends readonly [string, string][], R extends string = never> = [] extends M ? R : UnitsByCategory<T, AfterFirst<M>, T extends First<M>[0] ? R | First<M>[1] : R>;
12340
+ /**
12341
+ * **Uom**`<[T]>`
12342
+ *
12343
+ * A _unit of measure_ for a **metric**.
12344
+ *
12345
+ * - you may filter down to only units of a certain category(s) of `MetricCategory`
12346
+ * by adjusting `T`.
12347
+ *
12348
+ * **Related:** `Metric`, `MetricCategory`, `AreaUom`, `SpeedUom`, ...
12349
+ */
12350
+ type Uom<T extends MetricCategory = MetricCategory> = UnitsByCategory<T, [
12351
+ [
12352
+ "Acceleration",
12353
+ AccelerationUom
12354
+ ],
12355
+ [
12356
+ "Area",
12357
+ AreaUom
12358
+ ],
12359
+ [
12360
+ "Current",
12361
+ CurrentUom
12362
+ ],
12363
+ [
12364
+ "Distance",
12365
+ DistanceUom
12366
+ ],
12367
+ [
12368
+ "Frequency",
12369
+ FrequencyUom
12370
+ ],
12371
+ [
12372
+ "Luminosity",
12373
+ LuminosityUom
12374
+ ],
12375
+ [
12376
+ "Mass",
12377
+ MassUom
12378
+ ],
12379
+ [
12380
+ "Power",
12381
+ PowerUom
12382
+ ],
12383
+ [
12384
+ "Pressure",
12385
+ PressureUom
12386
+ ],
12387
+ [
12388
+ "Resistance",
12389
+ ResistanceUom
12390
+ ],
12391
+ [
12392
+ "Speed",
12393
+ SpeedUom
12394
+ ],
12395
+ [
12396
+ "Temperature",
12397
+ TemperatureUom
12398
+ ],
12399
+ [
12400
+ "Time",
12401
+ TimeUom
12402
+ ],
12403
+ [
12404
+ "Volume",
12405
+ VoltageUom
12406
+ ],
12407
+ [
12408
+ "Voltage",
12409
+ VolumeUom
12410
+ ]
12411
+ ]>;
12412
+ /**
12413
+ * **Metric**`<T>`
12414
+ *
12415
+ * A measurement which includes a numeric value plus the Unit of Measure (UOM).
12416
+ *
12417
+ * - you may filter down to only metrics of a certain category(s) of `MetricCategory`
12418
+ * by adjusting `T`.
12419
+ *
12420
+ * **Related:** `Uom`, `MetricCategory`
12421
+ */
12422
+ type Metric<T extends MetricCategory = MetricCategory> = UnitsByCategory<T, [
12423
+ [
12424
+ "Acceleration",
12425
+ Acceleration
12426
+ ],
12427
+ [
12428
+ "Area",
12429
+ Area
12430
+ ],
12431
+ [
12432
+ "Current",
12433
+ Current
12434
+ ],
12435
+ [
12436
+ "Distance",
12437
+ Distance
12438
+ ],
12439
+ [
12440
+ "Frequency",
12441
+ Frequency
12442
+ ],
12443
+ [
12444
+ "Luminosity",
12445
+ Luminosity
12446
+ ],
12447
+ [
12448
+ "Mass",
12449
+ Mass
12450
+ ],
12451
+ [
12452
+ "Power",
12453
+ Power
12454
+ ],
12455
+ [
12456
+ "Pressure",
12457
+ Pressure
12458
+ ],
12459
+ [
12460
+ "Resistance",
12461
+ Resistance
12462
+ ],
12463
+ [
12464
+ "Speed",
12465
+ Speed
12466
+ ],
12467
+ [
12468
+ "Temperature",
12469
+ Temperature
12470
+ ],
12471
+ [
12472
+ "TimeMetric",
12473
+ TimeMetric
12474
+ ],
12475
+ [
12476
+ "Voltage",
12477
+ Voltage
12478
+ ],
12479
+ [
12480
+ "Volume",
12481
+ Volume
12482
+ ]
12483
+ ]>;
12484
+
12331
12485
  type LuminosityMetricsLookup = typeof LUMINOSITY_METRICS_LOOKUP;
12332
12486
  /**
12333
12487
  * The singular name for metrics associated with **luminosity**.
@@ -12556,22 +12710,6 @@ type VolumeUom = {
12556
12710
  */
12557
12711
  type Volume = `${number}${OptSpace}${VolumeUom}`;
12558
12712
 
12559
- /**
12560
- * A measurement which includes a numeric value plus the Unit of Measure (UOM).
12561
- *
12562
- * **Related:** `Uom`
12563
- */
12564
- type Metric = Acceleration | Area | Current | Distance | Frequency | Luminosity | Mass | Power | Pressure | Resistance | Speed | Temperature | TimeMetric | Voltage | Volume;
12565
- type MetricCategory = "Acceleration" | "Area" | "Current" | "Distance" | "Frequency" | "Luminosity" | "Mass" | "Power" | "Pressure" | "Resistance" | "Speed" | "Temperature" | "Time" | "Voltage" | "Volume";
12566
- /**
12567
- * **Uom**
12568
- *
12569
- * A _unit of measure_ for a **metric**.
12570
- *
12571
- * **Related:** `Metric`, `AreaUom`, `SpeedUom`,`MassUom`, `DistanceUom`, ...
12572
- */
12573
- type Uom = AccelerationUom | AreaUom | CurrentUom | DistanceUom | FrequencyUom | LuminosityUom | MassUom | PowerUom | PressureUom | ResistanceUom | SpeedUom | TemperatureUom | TimeUom | VoltageUom | VolumeUom;
12574
-
12575
12713
  /**
12576
12714
  * Handles dropping a non-union type which can be a single
12577
12715
  * character OR a sequence of characters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inferred-types",
3
- "version": "0.55.14",
3
+ "version": "0.55.16",
4
4
  "description": "Functions which provide useful type inference on TS projects",
5
5
  "license": "MIT",
6
6
  "author": "Ken Snyder<ken@ken.net>",