@danielsimonjr/mathts-core 0.20.0 → 0.21.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.
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export { addScalar, subtractScalar, multiplyScalar, divideScalar, pow, abs, fix,
17
17
  export type { NumericScalar } from './arithmetic/scalar.js';
18
18
  export { Unit, isUnit as isUnitValue, DimensionMismatchError, UnitParseError, DIMENSIONLESS, dim, } from './types/unit.js';
19
19
  export type { Dimensions, UnitDef, UnitInstance } from './types/unit.js';
20
- export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './types/unit.js';
20
+ export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, REFUSED_UNIT_SPELLINGS, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './types/unit.js';
21
21
  export type { ExactScale, IrrationalName, IrrationalPowers, UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix, } from './types/unit.js';
22
22
  export { UNIT_DIMENSION_LENGTH, SI_DIMENSION_LENGTH, toSiDimensions, toSiDimensionVector, fromSiDimensions, fromSiDimensionVector, } from './types/unit.js';
23
23
  export type { SiDimensionVector, SiDimensionOptions, SiDimensionExponent } from './types/unit.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,YAAY,EACV,WAAW,EACX,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,SAAS,EACT,CAAC,EACD,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,GACV,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG9E,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG3F,OAAO,EACL,QAAQ,EACR,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,SAAS,EACT,WA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AS,EACT,YAAY,EACZ,UAAU,GACX,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,EAEL,SAAS,EACT,iBAAiB,EACjB,KAAK,EACL,MAAM,EACN,mBAAmB,EACnB,YAAY,EAGZ,YAAY,EACZ,kBAAkB,EAGlB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,UAAU,EACV,QAAQ,EACR,MAAM,EACN,WAAW,EAGX,QAAQ,EACR,aAAa,EACb,cAAc,EAGd,MAAM,EAGN,aAAa,EACb,oBAAoB,EAGpB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,aAAa,EACb,aAAa,EACb,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAW5B,eAAO,MAAM,OAAO,EAAE,MAAwB,CAAC;AAI/C,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as BIGNUMBER_LN2, A as irrationalPower, B as addScalar, Bn as I, C as decimalExactScale, D as exactScaleToNumber, E as exactScaleOf, F as ratioExactScale, G as multiplyScalar, H as equal, I as readScaleExpression, In as COMPLEX_NEG_ONE, J as round, K as number, L as DimensionMismatchError, Ln as COMPLEX_ONE, M as multiplyExactScales, N as namedIrrationalScale, O as exactScalesEqual, P as powerExactScale, Pn as isUnit$1, Q as BIGNUMBER_LN10, R as UnitParseError, Rn as COMPLEX_ZERO, S as clearExactScaleNumberCache, T as exactScaleNumberCacheSize, U as fix, V as divideScalar, Vn as isComplex, W as isNumeric, Y as subtractScalar, Yt as format, Z as BIGNUMBER_E, _ as NAMED_IRRATIONALS, _t as factory, a as UNIT_PREFIX_SETS, an as sign, at as BigNumber, b as addExactScales, c as getUnitPrefix, ct as FRACTION_NEG_ONE, d as readUnitScale, dt as FRACTION_THIRD, et as BIGNUMBER_NEG_ONE, f as unitPrefixExactScale, ft as FRACTION_ZERO, g as LN2_EXACT_SCALE, h as unitRowValue, hn as isBigNumber$2, i as NAMED_SCALES, it as BIGNUMBER_ZERO, j as isRationalScale, k as formatExactScale, l as getUnitRow, lt as FRACTION_ONE, m as unitRowExactScale, mn as isBigInt$1, mt as isFraction, nt as BIGNUMBER_PI, o as UNIT_ROWS, ot as isBigNumber, p as unitRowExactOffset, pt as Fraction, q as pow, rt as BIGNUMBER_TEN, s as UNIT_ROW_ALIASES, st as FRACTION_HALF, t as Unit, tn as nearlyEqual, tt as BIGNUMBER_ONE, u as namedExactScale, ut as FRACTION_QUARTER, v as PI_EXACT_SCALE, w as divideExactScales, x as binaryExactScale, y as UNIT_EXACT_SCALE, z as abs, zn as Complex } from "./unit-Dul_E1rh.js";
1
+ import { $ as BIGNUMBER_LN10, A as formatExactScale, B as abs, Bn as Complex, C as clearExactScaleNumberCache, D as exactScaleOf, E as exactScaleNumberCacheSize, F as powerExactScale, Fn as isUnit$1, G as isNumeric, H as divideScalar, Hn as isComplex, I as ratioExactScale, J as pow, K as multiplyScalar, L as readScaleExpression, Ln as COMPLEX_NEG_ONE, M as isRationalScale, N as multiplyExactScales, O as exactScaleToNumber, P as namedIrrationalScale, Q as BIGNUMBER_E, R as DimensionMismatchError, Rn as COMPLEX_ONE, S as binaryExactScale, T as divideExactScales, U as equal, V as addScalar, Vn as I, W as fix, X as subtractScalar, Xt as format, Y as round, _ as LN2_EXACT_SCALE, a as REFUSED_UNIT_SPELLINGS, at as BIGNUMBER_ZERO, b as UNIT_EXACT_SCALE, c as UNIT_ROW_ALIASES, ct as FRACTION_HALF, d as namedExactScale, dt as FRACTION_QUARTER, et as BIGNUMBER_LN2, f as readUnitScale, ft as FRACTION_THIRD, g as unitRowValue, gn as isBigNumber$2, h as unitRowExactScale, hn as isBigInt$1, ht as isFraction, i as NAMED_SCALES, it as BIGNUMBER_TEN, j as irrationalPower, k as exactScalesEqual, l as getUnitPrefix, lt as FRACTION_NEG_ONE, m as unitRowExactOffset, mt as Fraction, nn as nearlyEqual, nt as BIGNUMBER_ONE, o as UNIT_PREFIX_SETS, on as sign, ot as BigNumber, p as unitPrefixExactScale, pt as FRACTION_ZERO, q as number, rt as BIGNUMBER_PI, s as UNIT_ROWS, st as isBigNumber, t as Unit, tt as BIGNUMBER_NEG_ONE, u as getUnitRow, ut as FRACTION_ONE, v as NAMED_IRRATIONALS, vt as factory, w as decimalExactScale, x as addExactScales, y as PI_EXACT_SCALE, z as UnitParseError, zn as COMPLEX_ZERO } from "./unit-D3yD3jbu.js";
2
2
  import typed, { create } from "typed-function";
3
3
  const createRangeClass = /* #__PURE__ */ factory("Range", [], () => {
4
4
  class Range {
@@ -1407,6 +1407,6 @@ function rowMajorStrides(shape) {
1407
1407
  }
1408
1408
  //#endregion
1409
1409
  //#region src/index.ts
1410
- const VERSION = "0.20.0";
1410
+ const VERSION = "0.21.0";
1411
1411
  //#endregion
1412
- export { ALL_UNITS, BASE_UNITS, BEST_PREFIXES, BIGNUMBER_E, BIGNUMBER_LN10, BIGNUMBER_LN2, BIGNUMBER_NEG_ONE, BIGNUMBER_ONE, BIGNUMBER_PI, BIGNUMBER_TEN, BIGNUMBER_ZERO, BigNumber, COMPLEX_NEG_ONE, COMPLEX_ONE, COMPLEX_ZERO, Complex, DEFAULT_CONFIG, DERIVED_UNITS, DIMENSIONLESS, DUAL_UNARY_RULES, DimensionMismatchError, Dual, E, FRACTION_HALF, FRACTION_NEG_ONE, FRACTION_ONE, FRACTION_QUARTER, FRACTION_THIRD, FRACTION_ZERO, Fraction, FunctionRegistry, I, LN10, LN2, LN2_EXACT_SCALE, LOG10E, LOG2E, MATHTS_CONVERSIONS, MATHTS_TYPES, NAMED_IRRATIONALS, NAMED_SCALES, PHI, PI, PI_EXACT_SCALE, Range, SI_DIMENSION_LENGTH, SI_PREFIXES, SQRT1_2, SQRT2, TAU, TypeRegistry, UNIT_ALIASES, UNIT_DIMENSION_LENGTH, UNIT_EXACT_SCALE, UNIT_PREFIX_SETS, UNIT_ROWS, UNIT_ROW_ALIASES, Unit, UnitParseError, VERSION, abs, addExactScales, addScalar, binaryExactScale, boxMuller, clearExactScaleNumberCache, create, createFactory, createMathTSTyped, createRangeClass, createSeededRng, createTypedFunction, decimalExactScale, dim, divideExactScales, divideScalar, equal, exactScaleNumberCacheSize, exactScaleOf, exactScaleToNumber, exactScalesEqual, fix, formatExactScale, fromSiDimensionVector, fromSiDimensions, getPrefix, getUnitDef, getUnitPrefix, getUnitRow, initTypedWasm, irrationalPower, isArray, isBigInt, isBigNumber, isBoolean, isComplex, isDenseMatrix, isDual, isFraction, isFunction, isMatrix, isNull, isNumber, isNumeric, isObject, isRationalScale, isSparseMatrix, isString, isTypedWasmAvailable, isUndefined, isUnit, isUnit$1 as isUnitValue, math, mathTyped, mulberry32, multiplyExactScales, multiplyScalar, namedExactScale, namedIrrationalScale, neumaierCumsum, neumaierSum, norm2, number, pairwiseDot, pairwiseSum, pow, powerExactScale, ratioExactScale, readScaleExpression, readUnitScale, registerNativeTypes, registry, round, rowMajorStrides, scaledDistance, subtractScalar, sumSquaredDeviations, toSiDimensionVector, toSiDimensions, typed, unitPrefixExactScale, unitRowExactOffset, unitRowExactScale, unitRowValue };
1412
+ export { ALL_UNITS, BASE_UNITS, BEST_PREFIXES, BIGNUMBER_E, BIGNUMBER_LN10, BIGNUMBER_LN2, BIGNUMBER_NEG_ONE, BIGNUMBER_ONE, BIGNUMBER_PI, BIGNUMBER_TEN, BIGNUMBER_ZERO, BigNumber, COMPLEX_NEG_ONE, COMPLEX_ONE, COMPLEX_ZERO, Complex, DEFAULT_CONFIG, DERIVED_UNITS, DIMENSIONLESS, DUAL_UNARY_RULES, DimensionMismatchError, Dual, E, FRACTION_HALF, FRACTION_NEG_ONE, FRACTION_ONE, FRACTION_QUARTER, FRACTION_THIRD, FRACTION_ZERO, Fraction, FunctionRegistry, I, LN10, LN2, LN2_EXACT_SCALE, LOG10E, LOG2E, MATHTS_CONVERSIONS, MATHTS_TYPES, NAMED_IRRATIONALS, NAMED_SCALES, PHI, PI, PI_EXACT_SCALE, REFUSED_UNIT_SPELLINGS, Range, SI_DIMENSION_LENGTH, SI_PREFIXES, SQRT1_2, SQRT2, TAU, TypeRegistry, UNIT_ALIASES, UNIT_DIMENSION_LENGTH, UNIT_EXACT_SCALE, UNIT_PREFIX_SETS, UNIT_ROWS, UNIT_ROW_ALIASES, Unit, UnitParseError, VERSION, abs, addExactScales, addScalar, binaryExactScale, boxMuller, clearExactScaleNumberCache, create, createFactory, createMathTSTyped, createRangeClass, createSeededRng, createTypedFunction, decimalExactScale, dim, divideExactScales, divideScalar, equal, exactScaleNumberCacheSize, exactScaleOf, exactScaleToNumber, exactScalesEqual, fix, formatExactScale, fromSiDimensionVector, fromSiDimensions, getPrefix, getUnitDef, getUnitPrefix, getUnitRow, initTypedWasm, irrationalPower, isArray, isBigInt, isBigNumber, isBoolean, isComplex, isDenseMatrix, isDual, isFraction, isFunction, isMatrix, isNull, isNumber, isNumeric, isObject, isRationalScale, isSparseMatrix, isString, isTypedWasmAvailable, isUndefined, isUnit, isUnit$1 as isUnitValue, math, mathTyped, mulberry32, multiplyExactScales, multiplyScalar, namedExactScale, namedIrrationalScale, neumaierCumsum, neumaierSum, norm2, number, pairwiseDot, pairwiseSum, pow, powerExactScale, ratioExactScale, readScaleExpression, readUnitScale, registerNativeTypes, registry, round, rowMajorStrides, scaledDistance, subtractScalar, sumSquaredDeviations, toSiDimensionVector, toSiDimensions, typed, unitPrefixExactScale, unitRowExactOffset, unitRowExactScale, unitRowValue };
package/dist/internal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $t as log1p, An as isRegExp, At as isLegacyFactory, Bt as warnOnce, Cn as isIndex, Ct as canDefineProperty, Dn as isNumber, Dt as deepStrictEqual, En as isNull, Et as deepFlatten, Fn as typeOf, Ft as set, Gt as copysign, Ht as asinh, It as traverse, Jt as expm1, Kt as cosh, Lt as endsWith, Mn as isString, Mt as mapObject, Nn as isUndefined, Nt as pick, On as isObject, Ot as extend, Pn as isUnit, Pt as pickShallow, Qt as log10, Rt as hasOwnProperty, Sn as isFunction, St as MathjsError, Tn as isMatrix, Tt as deepExtend, Ut as atanh, Vt as acosh, Wt as cbrt, X as DEFAULT_CONFIG, Xt as isInteger, Yt as format, Zt as isPowZeroAtInfinity, _n as isCollection, _t as factory, an as sign, bn as isDenseMatrix, bt as sortFactories, cn as tanh, dn as toFixed, en as log2, fn as toPrecision, gn as isBoolean, gt as create, hn as isBigNumber, ht as assertDependencies, in as safeNumberType, jn as isSparseMatrix, jt as lazy, kn as isRange, kt as get, ln as toEngineering, mn as isBigInt, n as unitDependencies, nn as normalizeFormatOptions, on as sinh, pn as isArray, qt as digits, r as createUnitClass, rn as roundDigits, sn as splitNumber, t as Unit, tn as nearlyEqual, un as toExponential, vn as isComplex, vt as isFactory, wn as isMap, wt as clone, xn as isFraction, xt as stripOptionalNotation, yn as isDate, yt as isOptionalDependency, zt as memoize } from "./unit-Dul_E1rh.js";
1
+ import { $t as log10, An as isRange, At as get, Bt as memoize, Cn as isFunction, Ct as MathjsError, Dn as isNull, Dt as deepFlatten, En as isMatrix, Et as deepExtend, Fn as isUnit, Ft as pickShallow, Gt as cbrt, Ht as acosh, In as typeOf, It as set, Jt as digits, Kt as copysign, Lt as traverse, Mn as isSparseMatrix, Mt as lazy, Nn as isString, Nt as mapObject, On as isNumber, Ot as deepStrictEqual, Pn as isUndefined, Pt as pick, Qt as isPowZeroAtInfinity, Rt as endsWith, Sn as isFraction, St as stripOptionalNotation, Tn as isMap, Tt as clone, Ut as asinh, Vt as warnOnce, Wt as atanh, Xt as format, Yt as expm1, Z as DEFAULT_CONFIG, Zt as isInteger, _n as isBoolean, _t as create, an as safeNumberType, bn as isDate, bt as isOptionalDependency, cn as splitNumber, dn as toExponential, en as log1p, fn as toFixed, gn as isBigNumber, gt as assertDependencies, hn as isBigInt, in as roundDigits, jn as isRegExp, jt as isLegacyFactory, kn as isObject, kt as extend, ln as tanh, mn as isArray, n as unitDependencies, nn as nearlyEqual, on as sign, pn as toPrecision, qt as cosh, r as createUnitClass, rn as normalizeFormatOptions, sn as sinh, t as Unit, tn as log2, un as toEngineering, vn as isCollection, vt as factory, wn as isIndex, wt as canDefineProperty, xn as isDenseMatrix, xt as sortFactories, yn as isComplex, yt as isFactory, zt as hasOwnProperty } from "./unit-D3yD3jbu.js";
2
2
  //#region src/error/DimensionError.ts
3
3
  var DimensionError = class DimensionError extends RangeError {
4
4
  actual;
@@ -1 +1 @@
1
- {"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../../src/types/unit/Unit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAcV,eAAe,EAQhB,MAAM,iBAAiB,CAAC;AAgJzB,eAAO,MAAM,eAAe,6DA4oF3B,CAAC"}
1
+ {"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../../src/types/unit/Unit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAcV,eAAe,EAQhB,MAAM,iBAAiB,CAAC;AAiJzB,eAAO,MAAM,eAAe,6DAqpF3B,CAAC"}
@@ -4,7 +4,7 @@ export { unitDependencies } from './dependencies.js';
4
4
  export type { BigNumberValue, ComplexValue, ComplexConstructor, BigNumberConstructor, FractionConstructor, FractionValue, Numeric, PrefixDef, PrefixTable, BaseUnitDef, UnitDef, UnitComponent, UnitSystemEntry, UnitSystem, UnitJSON, ConverterFn, TypeConverters, ParseOptions, UnitFormatOptions, CreateUnitOptions, CreateUnitDefObject, UnitConfig, SubtractScalar, ScalarBinaryOp, ScalarUnaryOp, UnitDependencies, UnitInstance, UnitConstructor, } from './unit-types.js';
5
5
  export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, } from './exact-scale.js';
6
6
  export type { ExactScale, IrrationalName, IrrationalPowers } from './exact-scale.js';
7
- export { NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './unit-table.js';
7
+ export { NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, REFUSED_UNIT_SPELLINGS, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './unit-table.js';
8
8
  export type { UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix } from './unit-table.js';
9
9
  /** The core `Unit` class, pre-wired to core's numeric primitives. */
10
10
  export declare const Unit: UnitConstructor;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/unit/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,OAAO,EACP,SAAS,EACT,WAAW,EACX,WAAW,EACX,OAAO,EACP,aAAa,EACb,eAAe,EACf,UAAU,EACV,QAAQ,EACR,WAAW,EACX,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE1F,qEAAqE;AACrE,eAAO,MAAM,IAAI,EAAE,eAEC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/unit/index.ts"],"names":[],"mappings":"AAUA,OAAO,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AAM,IAAI,EAAE,eAEC,CAAC"}
@@ -86,6 +86,18 @@ export declare const UNIT_ROWS: Readonly<Record<string, UnitRow>>;
86
86
  * row it names, so it has that row's scale, dimension and prefixes.
87
87
  */
88
88
  export declare const UNIT_ROW_ALIASES: Readonly<Record<string, string>>;
89
+ /**
90
+ * Unit spellings the parser refuses. Each maps a spelling to the reason it is
91
+ * not a unit of fixed scale: the logarithmic units (dB, dBm, dBW, Np) convert
92
+ * no multiplicative scale, and Mach is a ratio to the local speed of sound.
93
+ * Where the parser would report a unit as not found, a spelling here gets a
94
+ * `UnitParseError` with this reason instead.
95
+ *
96
+ * A lookup MUST use `Object.hasOwn` or a null-prototype object, so a spelling
97
+ * like `__proto__` or `toString` never reads off `Object.prototype` as a
98
+ * refused reason.
99
+ */
100
+ export declare const REFUSED_UNIT_SPELLINGS: Readonly<Record<string, string>>;
89
101
  /** The exact value of a name in {@link NAMED_SCALES}, or undefined for an unknown name. */
90
102
  export declare function namedExactScale(name: string): ExactScale | undefined;
91
103
  /** The exact value of a scale expression over {@link NAMED_SCALES}. */
@@ -1 +1 @@
1
- {"version":3,"file":"unit-table.d.ts","sourceRoot":"","sources":["../../../src/types/unit/unit-table.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,kBAAkB,CAAC;AAE1B,mFAAmF;AACnF,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,SAAS,GACT,aAAa,GACb,oBAAoB,GACpB,qBAAqB,GACrB,OAAO,GACP,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,UAAU,GACV,iBAAiB,GACjB,sBAAsB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,eAAe,GACf,uBAAuB,GACvB,WAAW,GACX,OAAO,GACP,KAAK,GACL,aAAa,GACb,MAAM,GACN,UAAU,GACV,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AM,GAAG,OAAO,GAAG,SAAS,CAK5D;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAGtE;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAIvE"}
@@ -21,7 +21,7 @@
21
21
  */
22
22
  export { Unit, createUnitClass, unitDependencies } from './unit/index.js';
23
23
  export type { UnitInstance } from './unit/index.js';
24
- export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './unit/index.js';
24
+ export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, REFUSED_UNIT_SPELLINGS, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './unit/index.js';
25
25
  export type { ExactScale, IrrationalName, IrrationalPowers, UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix, } from './unit/index.js';
26
26
  export { DimensionMismatchError, UnitParseError } from './unit/errors.js';
27
27
  export { isUnit } from '../is.js';
@@ -1 +1 @@
1
- {"version":3,"file":"unit.d.ts","sourceRoot":"","sources":["../../src/types/unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,UAAU,GACX,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG1E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"unit.d.ts","sourceRoot":"","sources":["../../src/types/unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,UAAU,GACX,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG1E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC"}
@@ -3657,7 +3657,7 @@ const UNIT_ROWS = Object.freeze({
3657
3657
  },
3658
3658
  psi: {
3659
3659
  base: "PRESSURE",
3660
- prefixes: "NONE",
3660
+ prefixes: "SHORT",
3661
3661
  scale: "lbf/inch^2"
3662
3662
  },
3663
3663
  atm: {
@@ -3672,7 +3672,7 @@ const UNIT_ROWS = Object.freeze({
3672
3672
  },
3673
3673
  torr: {
3674
3674
  base: "PRESSURE",
3675
- prefixes: "NONE",
3675
+ prefixes: "SHORT",
3676
3676
  scale: "standard_atmosphere/760"
3677
3677
  },
3678
3678
  mmHg: {
@@ -4078,6 +4078,14 @@ const UNIT_ROW_ALIASES = Object.freeze({
4078
4078
  Ohm: "ohm",
4079
4079
  Å: "angstrom"
4080
4080
  });
4081
+ const REFUSED_UNIT_SPELLINGS = Object.freeze({
4082
+ dB: "dB is a logarithmic unit; give the quantity in its linear unit, or a reference level",
4083
+ dBm: "dBm is a logarithmic unit (decibels over 1 mW); give watts",
4084
+ dBW: "dBW is a logarithmic unit (decibels over 1 W); give watts",
4085
+ Np: "Np is a logarithmic unit (the neper); give the quantity in its linear unit, or a reference level",
4086
+ Mach: "Mach is a ratio to the local speed of sound; give m/s, or the ratio as a bare number",
4087
+ mach: "mach is a ratio to the local speed of sound; give m/s, or the ratio as a bare number"
4088
+ });
4081
4089
  const namedCache = /* @__PURE__ */ new Map();
4082
4090
  function namedExactScale(name) {
4083
4091
  const cached = namedCache.get(name);
@@ -4428,7 +4436,11 @@ const createUnitClass = /* #__PURE__ */ factory("Unit", [
4428
4436
  if (uStr === null) throw new UnitParseError("Unexpected \"" + oldC + "\" in \"" + text + "\" at index " + index.toString());
4429
4437
  } else break;
4430
4438
  const res = _findUnit(uStr);
4431
- if (res === null) throw new UnitParseError("Unit \"" + uStr + "\" not found.");
4439
+ if (res === null) {
4440
+ const refused = Object.hasOwn(REFUSED_UNIT_SPELLINGS, uStr) ? REFUSED_UNIT_SPELLINGS[uStr] : void 0;
4441
+ if (refused !== void 0) throw new UnitParseError("Unit \"" + uStr + "\" is refused: " + refused);
4442
+ throw new UnitParseError("Unit \"" + uStr + "\" not found.");
4443
+ }
4432
4444
  let power = powerMultiplierCurrent * powerMultiplierStackProduct;
4433
4445
  skipWhitespace();
4434
4446
  if (parseCharacter("^")) {
@@ -5943,4 +5955,4 @@ const unitDependencies = {
5943
5955
  //#region src/types/unit/index.ts
5944
5956
  const Unit = createUnitClass(unitDependencies);
5945
5957
  //#endregion
5946
- export { BIGNUMBER_LN2 as $, log1p as $t, irrationalPower as A, isRegExp as An, isLegacyFactory as At, addScalar as B, I as Bn, warnOnce as Bt, decimalExactScale as C, isIndex as Cn, canDefineProperty as Ct, exactScaleToNumber as D, isNumber as Dn, deepStrictEqual as Dt, exactScaleOf as E, isNull as En, deepFlatten as Et, ratioExactScale as F, typeOf as Fn, set as Ft, multiplyScalar as G, copysign as Gt, equal as H, asinh as Ht, readScaleExpression as I, COMPLEX_NEG_ONE as In, traverse as It, round as J, expm1 as Jt, number as K, cosh as Kt, DimensionMismatchError as L, COMPLEX_ONE as Ln, endsWith as Lt, multiplyExactScales as M, isString as Mn, mapObject as Mt, namedIrrationalScale as N, isUndefined as Nn, pick as Nt, exactScalesEqual as O, isObject as On, extend as Ot, powerExactScale as P, isUnit as Pn, pickShallow as Pt, BIGNUMBER_LN10 as Q, log10 as Qt, UnitParseError as R, COMPLEX_ZERO as Rn, hasOwnProperty as Rt, clearExactScaleNumberCache as S, isFunction as Sn, MathjsError as St, exactScaleNumberCacheSize as T, isMatrix as Tn, deepExtend as Tt, fix as U, atanh as Ut, divideScalar as V, isComplex$1 as Vn, acosh as Vt, isNumeric as W, cbrt as Wt, DEFAULT_CONFIG as X, isInteger as Xt, subtractScalar$1 as Y, format as Yt, BIGNUMBER_E as Z, isPowZeroAtInfinity as Zt, NAMED_IRRATIONALS as _, isCollection as _n, factory as _t, UNIT_PREFIX_SETS as a, sign as an, BigNumber as at, addExactScales as b, isDenseMatrix as bn, sortFactories as bt, getUnitPrefix as c, tanh as cn, FRACTION_NEG_ONE as ct, readUnitScale as d, toFixed as dn, FRACTION_THIRD as dt, log2 as en, BIGNUMBER_NEG_ONE as et, unitPrefixExactScale as f, toPrecision as fn, FRACTION_ZERO as ft, LN2_EXACT_SCALE as g, isBoolean as gn, create as gt, unitRowValue as h, isBigNumber$1 as hn, assertDependencies as ht, NAMED_SCALES as i, safeNumberType as in, BIGNUMBER_ZERO as it, isRationalScale as j, isSparseMatrix as jn, lazy as jt, formatExactScale as k, isRange as kn, get as kt, getUnitRow as l, toEngineering as ln, FRACTION_ONE as lt, unitRowExactScale as m, isBigInt as mn, isFraction as mt, unitDependencies as n, normalizeFormatOptions as nn, BIGNUMBER_PI as nt, UNIT_ROWS as o, sinh as on, isBigNumber as ot, unitRowExactOffset as p, isArray as pn, Fraction as pt, pow as q, digits as qt, createUnitClass as r, roundDigits as rn, BIGNUMBER_TEN as rt, UNIT_ROW_ALIASES as s, splitNumber as sn, FRACTION_HALF as st, Unit as t, nearlyEqual as tn, BIGNUMBER_ONE as tt, namedExactScale as u, toExponential as un, FRACTION_QUARTER as ut, PI_EXACT_SCALE as v, isComplex as vn, isFactory as vt, divideExactScales as w, isMap as wn, clone as wt, binaryExactScale as x, isFraction$1 as xn, stripOptionalNotation as xt, UNIT_EXACT_SCALE as y, isDate as yn, isOptionalDependency as yt, abs as z, Complex as zn, memoize as zt };
5958
+ export { BIGNUMBER_LN10 as $, log10 as $t, formatExactScale as A, isRange as An, get as At, abs as B, Complex as Bn, memoize as Bt, clearExactScaleNumberCache as C, isFunction as Cn, MathjsError as Ct, exactScaleOf as D, isNull as Dn, deepFlatten as Dt, exactScaleNumberCacheSize as E, isMatrix as En, deepExtend as Et, powerExactScale as F, isUnit as Fn, pickShallow as Ft, isNumeric as G, cbrt as Gt, divideScalar as H, isComplex$1 as Hn, acosh as Ht, ratioExactScale as I, typeOf as In, set as It, pow as J, digits as Jt, multiplyScalar as K, copysign as Kt, readScaleExpression as L, COMPLEX_NEG_ONE as Ln, traverse as Lt, isRationalScale as M, isSparseMatrix as Mn, lazy as Mt, multiplyExactScales as N, isString as Nn, mapObject as Nt, exactScaleToNumber as O, isNumber as On, deepStrictEqual as Ot, namedIrrationalScale as P, isUndefined as Pn, pick as Pt, BIGNUMBER_E as Q, isPowZeroAtInfinity as Qt, DimensionMismatchError as R, COMPLEX_ONE as Rn, endsWith as Rt, binaryExactScale as S, isFraction$1 as Sn, stripOptionalNotation as St, divideExactScales as T, isMap as Tn, clone as Tt, equal as U, asinh as Ut, addScalar as V, I as Vn, warnOnce as Vt, fix as W, atanh as Wt, subtractScalar$1 as X, format as Xt, round as Y, expm1 as Yt, DEFAULT_CONFIG as Z, isInteger as Zt, LN2_EXACT_SCALE as _, isBoolean as _n, create as _t, REFUSED_UNIT_SPELLINGS as a, safeNumberType as an, BIGNUMBER_ZERO as at, UNIT_EXACT_SCALE as b, isDate as bn, isOptionalDependency as bt, UNIT_ROW_ALIASES as c, splitNumber as cn, FRACTION_HALF as ct, namedExactScale as d, toExponential as dn, FRACTION_QUARTER as dt, log1p as en, BIGNUMBER_LN2 as et, readUnitScale as f, toFixed as fn, FRACTION_THIRD as ft, unitRowValue as g, isBigNumber$1 as gn, assertDependencies as gt, unitRowExactScale as h, isBigInt as hn, isFraction as ht, NAMED_SCALES as i, roundDigits as in, BIGNUMBER_TEN as it, irrationalPower as j, isRegExp as jn, isLegacyFactory as jt, exactScalesEqual as k, isObject as kn, extend as kt, getUnitPrefix as l, tanh as ln, FRACTION_NEG_ONE as lt, unitRowExactOffset as m, isArray as mn, Fraction as mt, unitDependencies as n, nearlyEqual as nn, BIGNUMBER_ONE as nt, UNIT_PREFIX_SETS as o, sign as on, BigNumber as ot, unitPrefixExactScale as p, toPrecision as pn, FRACTION_ZERO as pt, number as q, cosh as qt, createUnitClass as r, normalizeFormatOptions as rn, BIGNUMBER_PI as rt, UNIT_ROWS as s, sinh as sn, isBigNumber as st, Unit as t, log2 as tn, BIGNUMBER_NEG_ONE as tt, getUnitRow as u, toEngineering as un, FRACTION_ONE as ut, NAMED_IRRATIONALS as v, isCollection as vn, factory as vt, decimalExactScale as w, isIndex as wn, canDefineProperty as wt, addExactScales as x, isDenseMatrix as xn, sortFactories as xt, PI_EXACT_SCALE as y, isComplex as yn, isFactory as yt, UnitParseError as z, COMPLEX_ZERO as zn, hasOwnProperty as zt };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/mathts-core",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Core types, utilities, and configuration for MathTS",
5
5
  "author": "Daniel Simon Jr.",
6
6
  "license": "MIT",