@danielsimonjr/mathts-core 0.4.1 → 0.5.0

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.
@@ -4352,6 +4352,19 @@ var createUnitClass = /* @__PURE__ */ factory(
4352
4352
  PREFIXES.SHORTLONG = Object.assign({}, PREFIXES.SHORT, PREFIXES.LONG);
4353
4353
  PREFIXES.BINARY_SHORT = Object.assign({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC);
4354
4354
  PREFIXES.BINARY_LONG = Object.assign({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC);
4355
+ PREFIXES.SHORT_UP_ONLY = {
4356
+ "": { name: "", value: 1, scientific: true },
4357
+ k: { name: "k", value: 1e3, scientific: true },
4358
+ M: { name: "M", value: 1e6, scientific: true },
4359
+ G: { name: "G", value: 1e9, scientific: true },
4360
+ T: { name: "T", value: 1e12, scientific: true },
4361
+ P: { name: "P", value: 1e15, scientific: true },
4362
+ E: { name: "E", value: 1e18, scientific: true },
4363
+ Z: { name: "Z", value: 1e21, scientific: true },
4364
+ Y: { name: "Y", value: 1e24, scientific: true },
4365
+ R: { name: "R", value: 1e27, scientific: true },
4366
+ Q: { name: "Q", value: 1e30, scientific: true }
4367
+ };
4355
4368
  const BASE_DIMENSIONS = [
4356
4369
  "MASS",
4357
4370
  "LENGTH",
@@ -4518,6 +4531,89 @@ var createUnitClass = /* @__PURE__ */ factory(
4518
4531
  value: 1e-10,
4519
4532
  offset: 0
4520
4533
  },
4534
+ // Astronomical / nautical / typography length units (ported from
4535
+ // upstream mathjs ece1aab0f + 5f360326b — B-5). `ly` and `pc` are
4536
+ // first-class UNITS with SHORT_UP_ONLY prefixes so kpc/Mpc/Mly/Gly
4537
+ // resolve through the prefix system while sub-multiples throw.
4538
+ astronomicalUnit: {
4539
+ name: "astronomicalUnit",
4540
+ base: BASE_UNITS.LENGTH,
4541
+ prefixes: PREFIXES.NONE,
4542
+ value: 149597870700,
4543
+ // IAU 2012 exact definition
4544
+ offset: 0
4545
+ },
4546
+ lightyear: {
4547
+ name: "lightyear",
4548
+ base: BASE_UNITS.LENGTH,
4549
+ prefixes: PREFIXES.NONE,
4550
+ value: 9460730472580800,
4551
+ // Julian year × c (exact)
4552
+ offset: 0
4553
+ },
4554
+ ly: {
4555
+ name: "ly",
4556
+ base: BASE_UNITS.LENGTH,
4557
+ prefixes: PREFIXES.SHORT_UP_ONLY,
4558
+ value: 9460730472580800,
4559
+ offset: 0
4560
+ },
4561
+ parsec: {
4562
+ name: "parsec",
4563
+ base: BASE_UNITS.LENGTH,
4564
+ prefixes: PREFIXES.LONG,
4565
+ // kiloparsec, megaparsec, gigaparsec
4566
+ value: 30856775814913700,
4567
+ // IAU 2015 exact definition
4568
+ offset: 0
4569
+ },
4570
+ pc: {
4571
+ name: "pc",
4572
+ base: BASE_UNITS.LENGTH,
4573
+ prefixes: PREFIXES.SHORT_UP_ONLY,
4574
+ value: 30856775814913700,
4575
+ offset: 0
4576
+ },
4577
+ nauticalMile: {
4578
+ name: "nauticalMile",
4579
+ base: BASE_UNITS.LENGTH,
4580
+ prefixes: PREFIXES.NONE,
4581
+ value: 1852,
4582
+ // exact
4583
+ offset: 0
4584
+ },
4585
+ fathom: {
4586
+ name: "fathom",
4587
+ base: BASE_UNITS.LENGTH,
4588
+ prefixes: PREFIXES.NONE,
4589
+ value: 1.8288,
4590
+ // 6 ft exactly
4591
+ offset: 0
4592
+ },
4593
+ furlong: {
4594
+ name: "furlong",
4595
+ base: BASE_UNITS.LENGTH,
4596
+ prefixes: PREFIXES.NONE,
4597
+ value: 201.168,
4598
+ // 1/8 mile exactly
4599
+ offset: 0
4600
+ },
4601
+ point: {
4602
+ name: "point",
4603
+ base: BASE_UNITS.LENGTH,
4604
+ prefixes: PREFIXES.NONE,
4605
+ value: 0.0254 / 72,
4606
+ // 1/72 inch (PostScript), exact
4607
+ offset: 0
4608
+ },
4609
+ pica: {
4610
+ name: "pica",
4611
+ base: BASE_UNITS.LENGTH,
4612
+ prefixes: PREFIXES.NONE,
4613
+ value: 0.0254 / 6,
4614
+ // 1/6 inch (12 points), exact
4615
+ offset: 0
4616
+ },
4521
4617
  m: {
4522
4618
  name: "m",
4523
4619
  base: BASE_UNITS.LENGTH,
@@ -5630,6 +5726,19 @@ var createUnitClass = /* @__PURE__ */ factory(
5630
5726
  };
5631
5727
  const ALIASES = {
5632
5728
  meters: "meter",
5729
+ // Astronomical / nautical / typography aliases (B-5 port). Lowercase
5730
+ // 'au' is deliberately ABSENT: it collides with the atomic unit of
5731
+ // length (Bohr radius, ~5.29e-11 m), 21 orders of magnitude smaller.
5732
+ AU: "astronomicalUnit",
5733
+ astronomicalUnits: "astronomicalUnit",
5734
+ lightyears: "lightyear",
5735
+ parsecs: "parsec",
5736
+ nmi: "nauticalMile",
5737
+ nauticalMiles: "nauticalMile",
5738
+ fathoms: "fathom",
5739
+ furlongs: "furlong",
5740
+ points: "point",
5741
+ picas: "pica",
5633
5742
  inches: "inch",
5634
5743
  feet: "foot",
5635
5744
  yards: "yard",
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  pow,
39
39
  round,
40
40
  subtractScalar
41
- } from "./chunk-ZPGSJR5L.js";
41
+ } from "./chunk-BDNTTHO4.js";
42
42
 
43
43
  // src/types/dual-rules.ts
44
44
  var DUAL_UNARY_RULES = {
package/dist/internal.js CHANGED
@@ -69,7 +69,7 @@ import {
69
69
  typeOf,
70
70
  unitDependencies,
71
71
  warnOnce
72
- } from "./chunk-ZPGSJR5L.js";
72
+ } from "./chunk-BDNTTHO4.js";
73
73
  export {
74
74
  Unit as CoreUnit,
75
75
  acosh,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/mathts-core",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Core types, utilities, and configuration for MathTS",
5
5
  "author": "Daniel Simon Jr.",
6
6
  "license": "MIT",