formulab 0.32.1 → 0.33.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/CHANGELOG.md +18 -0
- package/README.md +3 -3
- package/dist/automotive/index.d.ts +1 -1
- package/dist/automotive/index.d.ts.map +1 -1
- package/dist/automotive/index.js +1 -1
- package/dist/automotive/index.js.map +1 -1
- package/dist/automotive/tireCompare.d.ts +6 -0
- package/dist/automotive/tireCompare.d.ts.map +1 -1
- package/dist/automotive/tireCompare.js +51 -1
- package/dist/automotive/tireCompare.js.map +1 -1
- package/dist/automotive/types.d.ts +10 -0
- package/dist/automotive/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.33.0] - 2026-09-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`automotive/tireCompare()` gains ISO 4000-1 / ETRTO Load Index support**, including HL (High
|
|
13
|
+
Load) ratings used by heavy EVs. `TireSpec.loadIndex` (optional, 60-130) resolves to
|
|
14
|
+
`TireData.maxLoadKg` via the new exported `tireLoadCapacityKg()` lookup; when both tires in a
|
|
15
|
+
comparison supply it, `TireResult` additionally carries `loadCapacityDiffKg` and
|
|
16
|
+
`loadCapacityReduced` — a replacement-tire safety check flagging when tire2 is rated to carry
|
|
17
|
+
less than tire1 (the case that matters for heavy EVs, which need HL-rated tires and can't
|
|
18
|
+
safely drop back to a lower-index replacement). SL/XL/HL are not separate tables: they are
|
|
19
|
+
construction/reference-pressure classes that determine which Load Index a given tire size can
|
|
20
|
+
be rated at — the Load Index-to-kg mapping itself is universal, so no separate "HL table" was
|
|
21
|
+
needed once the standard one was verified. Golden-tested against ISO 4000-1 figures (cell-level
|
|
22
|
+
extraction, cross-checked against the UK MOT Inspection Manual's independent table and
|
|
23
|
+
published XL/HL comparison figures — all points agreed exactly). `loadIndex` is fully optional;
|
|
24
|
+
omitting it on either tire preserves the exact prior `tireCompare()` output.
|
|
25
|
+
|
|
8
26
|
## [0.32.1] - 2026-09-02
|
|
9
27
|
|
|
10
28
|
### Fixed
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ A comprehensive collection of engineering formulas and calculations for manufact
|
|
|
11
11
|
|
|
12
12
|
## Features
|
|
13
13
|
|
|
14
|
-
- **
|
|
14
|
+
- **204 industrial calculations + 8 type guards** — OEE, Cpk, SPC control charts, Gage R&R, Weibull, metal weight, CNC machining, GD&T, pipe flow, CBM, NIOSH lifting, PMV/PPD, arc flash, battery SOH, GHG emissions, PID tuning, and more
|
|
15
15
|
- **15 specialized domains** — Quality, Metal, Chemical, Electronics, Construction, Automotive, Logistics, Energy, Safety, Food, Utility, Battery, Environmental, Machining, Industrial Engineering
|
|
16
16
|
- **Zero dependencies** — Lightweight and fast
|
|
17
17
|
- **TypeScript first** — Full type definitions included
|
|
@@ -35,12 +35,12 @@ A comprehensive collection of engineering formulas and calculations for manufact
|
|
|
35
35
|
| Chemical | 12 | pid, reliefValve | Darcy-Weisbach, Fourier, API 520, ISA |
|
|
36
36
|
| Electronics | 11 | awgProperties, resistorDecode | IPC-2221, IEC 60062 |
|
|
37
37
|
| Construction | 13 | momentOfInertia | AISC, Timoshenko, Roark's (momentOfInertia only — see note) |
|
|
38
|
-
| Automotive |
|
|
38
|
+
| Automotive | 10 | chargingLoss, tireLoadCapacityKg | AASHTO, SAE J1772, ISO 4000-1 |
|
|
39
39
|
| Energy | 15 | degreeDay, windOutput | NREL PVWatts, ISO 50001 |
|
|
40
40
|
| Food | 6 | waterActivity, stabilityStudy | HACCP, ICH Q1A |
|
|
41
41
|
| Utility | 16 | — | — |
|
|
42
42
|
| Battery | 10 | stateOfHealth, thermalRunaway | IEEE 1188, IEC 62620, Battery University |
|
|
43
|
-
| Environmental | 10 | gwpCalculator | GHG Protocol, IPCC AR6,
|
|
43
|
+
| Environmental | 10 | gwpCalculator | GHG Protocol, IPCC AR6, Our World in Data/Ember |
|
|
44
44
|
| Machining | 12 | all 12 functions — truePosition, gaugeBlockStack, boltCircle, sineBarHeight, effectiveDiameter, radialChipThinning, cuspHeight, boringBarDeflection, toolDeflection, cycleTimeEstimator, threadOverWires, triangleSolver | Machinery's Handbook, ASME Y14.5/B1.2, Sandvik Coromant |
|
|
45
45
|
| IE | 5 | — | MTM/MOST, Wright's learning curve |
|
|
46
46
|
|
|
@@ -3,7 +3,7 @@ export { batteryRuntime } from './batteryRuntime.js';
|
|
|
3
3
|
export { evCharging } from './evCharging.js';
|
|
4
4
|
export { fuelEconomy } from './fuelEconomy.js';
|
|
5
5
|
export { gearRatio } from './gearRatio.js';
|
|
6
|
-
export { tireCompare } from './tireCompare.js';
|
|
6
|
+
export { tireCompare, tireLoadCapacityKg } from './tireCompare.js';
|
|
7
7
|
export { torque } from './torque.js';
|
|
8
8
|
export { power } from './power.js';
|
|
9
9
|
export { chargingLoss } from './chargingLoss.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/automotive/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/automotive/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAEV,oBAAoB,EACpB,qBAAqB,EAErB,YAAY,EACZ,aAAa,EAEb,aAAa,EACb,cAAc,EAEd,QAAQ,EACR,SAAS,EACT,UAAU,EAEV,cAAc,EACd,eAAe,EAEf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EAEV,UAAU,EACV,WAAW,EACX,YAAY,EAEZ,SAAS,EACT,UAAU,EACV,WAAW,EAEX,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
package/dist/automotive/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { batteryRuntime } from './batteryRuntime.js';
|
|
|
4
4
|
export { evCharging } from './evCharging.js';
|
|
5
5
|
export { fuelEconomy } from './fuelEconomy.js';
|
|
6
6
|
export { gearRatio } from './gearRatio.js';
|
|
7
|
-
export { tireCompare } from './tireCompare.js';
|
|
7
|
+
export { tireCompare, tireLoadCapacityKg } from './tireCompare.js';
|
|
8
8
|
export { torque } from './torque.js';
|
|
9
9
|
export { power } from './power.js';
|
|
10
10
|
export { chargingLoss } from './chargingLoss.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/automotive/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/automotive/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { TireInput, TireResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Look up the maximum load per tire (kg) for a given ISO 4000-1 / ETRTO Load Index.
|
|
4
|
+
*
|
|
5
|
+
* @throws {RangeError} loadIndex is outside the supported 60-130 range
|
|
6
|
+
*/
|
|
7
|
+
export declare function tireLoadCapacityKg(loadIndex: number): number;
|
|
2
8
|
/**
|
|
3
9
|
* Compare two tire sizes and calculate differences
|
|
4
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tireCompare.d.ts","sourceRoot":"","sources":["../../src/automotive/tireCompare.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAsB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tireCompare.d.ts","sourceRoot":"","sources":["../../src/automotive/tireCompare.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAsB,MAAM,YAAY,CAAC;AAsC5E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAM5D;AA+BD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CA2BxD"}
|
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
import { roundTo } from '../utils.js';
|
|
2
2
|
// Conversion constants
|
|
3
3
|
const INCHES_TO_MM = 25.4;
|
|
4
|
+
/**
|
|
5
|
+
* ISO 4000-1 / ETRTO Load Index → maximum load per tire (kg), reference passenger-tire
|
|
6
|
+
* inflation pressure. Covers LI 60-130 — motorcycle/compact-car through the heaviest
|
|
7
|
+
* passenger-adjacent EV pickups (e.g. Rivian R1T, GMC Hummer EV run ~121-126 XL); the full
|
|
8
|
+
* standard table continues to LI 279 for aircraft/mining-truck tires, out of scope for this
|
|
9
|
+
* domain.
|
|
10
|
+
*
|
|
11
|
+
* SL (Standard Load), XL (Extra Load), and HL (High Load, ETRTO 2021 / US 2023) are NOT
|
|
12
|
+
* separate tables — they are construction/reference-pressure classes that determine which LI a
|
|
13
|
+
* given physical tire size can be rated at; the LI-to-kg mapping itself is universal across all
|
|
14
|
+
* three. A "245/45R19 101Y XL" and a "245/45R19 101Y HL" of the same size both carry 825 kg per
|
|
15
|
+
* this table — HL construction is what lets a manufacturer rate that size at LI 101 instead of a
|
|
16
|
+
* lower XL-only rating, not a different number for the same LI.
|
|
17
|
+
*
|
|
18
|
+
* @reference ISO 4000-1 (Passenger car tyres — Part 1: Dimensions), reproduced via
|
|
19
|
+
* en.wikipedia.org/wiki/Tire_code "Load index and load range" table (cell-verified against
|
|
20
|
+
* this project's own extraction, 2026-09-02) and cross-checked at LI 70/91/98/100/101 against
|
|
21
|
+
* the UK Government MOT Inspection Manual Appendix B (gov.uk, single-wheel column, ÷2 —
|
|
22
|
+
* that table is a different reference-pressure class, but its ratios confirm this one) and
|
|
23
|
+
* published HL/XL comparison figures (Tire Review, "Continental Makes its First Tire with New
|
|
24
|
+
* HL Load Index": XL 98 = 750 kg, HL 101 = 825 kg — both match exactly).
|
|
25
|
+
*/
|
|
26
|
+
const TIRE_LOAD_INDEX_KG = {
|
|
27
|
+
60: 250, 61: 257, 62: 265, 63: 272, 64: 280, 65: 290, 66: 300, 67: 307, 68: 315, 69: 325,
|
|
28
|
+
70: 335, 71: 345, 72: 355, 73: 365, 74: 375, 75: 387, 76: 400, 77: 412, 78: 425, 79: 437,
|
|
29
|
+
80: 450, 81: 462, 82: 475, 83: 487, 84: 500, 85: 515, 86: 530, 87: 545, 88: 560, 89: 580,
|
|
30
|
+
90: 600, 91: 615, 92: 630, 93: 650, 94: 670, 95: 690, 96: 710, 97: 730, 98: 750, 99: 775,
|
|
31
|
+
100: 800, 101: 825, 102: 850, 103: 875, 104: 900, 105: 925, 106: 950, 107: 975, 108: 1000,
|
|
32
|
+
109: 1030, 110: 1060, 111: 1090, 112: 1120, 113: 1150, 114: 1180, 115: 1215, 116: 1250,
|
|
33
|
+
117: 1285, 118: 1320, 119: 1360, 120: 1400, 121: 1450, 122: 1500, 123: 1550, 124: 1600,
|
|
34
|
+
125: 1650, 126: 1700, 127: 1750, 128: 1800, 129: 1850, 130: 1900,
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Look up the maximum load per tire (kg) for a given ISO 4000-1 / ETRTO Load Index.
|
|
38
|
+
*
|
|
39
|
+
* @throws {RangeError} loadIndex is outside the supported 60-130 range
|
|
40
|
+
*/
|
|
41
|
+
export function tireLoadCapacityKg(loadIndex) {
|
|
42
|
+
const capacity = TIRE_LOAD_INDEX_KG[loadIndex];
|
|
43
|
+
if (capacity == null) {
|
|
44
|
+
throw new RangeError(`loadIndex must be an integer between 60 and 130 (got ${loadIndex})`);
|
|
45
|
+
}
|
|
46
|
+
return capacity;
|
|
47
|
+
}
|
|
4
48
|
/**
|
|
5
49
|
* Calculate tire dimensions from tire specification
|
|
6
50
|
*
|
|
@@ -14,7 +58,7 @@ const INCHES_TO_MM = 25.4;
|
|
|
14
58
|
* - Revs per km = 1,000,000 / Circumference
|
|
15
59
|
*/
|
|
16
60
|
function calculateTireData(spec) {
|
|
17
|
-
const { width, aspect, rim } = spec;
|
|
61
|
+
const { width, aspect, rim, loadIndex } = spec;
|
|
18
62
|
const sidewallHeight = width * (aspect / 100);
|
|
19
63
|
const rimDiameterMm = rim * INCHES_TO_MM;
|
|
20
64
|
const diameter = rimDiameterMm + (2 * sidewallHeight);
|
|
@@ -24,6 +68,7 @@ function calculateTireData(spec) {
|
|
|
24
68
|
diameter: roundTo(diameter, 2),
|
|
25
69
|
circumference: roundTo(circumference, 2),
|
|
26
70
|
revsPerKm: roundTo(revsPerKm, 2),
|
|
71
|
+
...(loadIndex != null ? { maxLoadKg: tireLoadCapacityKg(loadIndex) } : {}),
|
|
27
72
|
};
|
|
28
73
|
}
|
|
29
74
|
/**
|
|
@@ -42,6 +87,10 @@ export function tireCompare(input) {
|
|
|
42
87
|
// Speedometer correction: positive means speedo reads lower than actual
|
|
43
88
|
// If tire2 is larger, actual speed is higher than displayed
|
|
44
89
|
const speedoCorrection = -diameterDiffPercent;
|
|
90
|
+
const bothHaveLoadIndex = tire1Data.maxLoadKg != null && tire2Data.maxLoadKg != null;
|
|
91
|
+
const loadCapacityDiffKg = bothHaveLoadIndex
|
|
92
|
+
? roundTo(tire2Data.maxLoadKg - tire1Data.maxLoadKg, 2) || 0
|
|
93
|
+
: undefined;
|
|
45
94
|
// Use || 0 to convert -0 to 0 for cleaner output
|
|
46
95
|
return {
|
|
47
96
|
tire1: tire1Data,
|
|
@@ -49,6 +98,7 @@ export function tireCompare(input) {
|
|
|
49
98
|
diameterDiff: roundTo(diameterDiff, 2) || 0,
|
|
50
99
|
diameterDiffPercent: roundTo(diameterDiffPercent, 2) || 0,
|
|
51
100
|
speedoCorrection: roundTo(speedoCorrection, 2) || 0,
|
|
101
|
+
...(bothHaveLoadIndex ? { loadCapacityDiffKg, loadCapacityReduced: loadCapacityDiffKg < 0 } : {}),
|
|
52
102
|
};
|
|
53
103
|
}
|
|
54
104
|
//# sourceMappingURL=tireCompare.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tireCompare.js","sourceRoot":"","sources":["../../src/automotive/tireCompare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,uBAAuB;AACvB,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;;;;;;;;;;GAWG;AACH,SAAS,iBAAiB,CAAC,IAAc;IACvC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"tireCompare.js","sourceRoot":"","sources":["../../src/automotive/tireCompare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,uBAAuB;AACvB,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,kBAAkB,GAA2B;IACjD,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG;IACxF,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE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AACJ,CAAC"}
|
|
@@ -68,6 +68,8 @@ export interface TireSpec {
|
|
|
68
68
|
width: number;
|
|
69
69
|
aspect: number;
|
|
70
70
|
rim: number;
|
|
71
|
+
/** ISO 4000-1 / ETRTO load index (60-130). Optional — omit to skip load capacity comparison. */
|
|
72
|
+
loadIndex?: number;
|
|
71
73
|
}
|
|
72
74
|
export interface TireInput {
|
|
73
75
|
tire1: TireSpec;
|
|
@@ -77,6 +79,8 @@ export interface TireData {
|
|
|
77
79
|
diameter: number;
|
|
78
80
|
circumference: number;
|
|
79
81
|
revsPerKm: number;
|
|
82
|
+
/** Max load per tire (kg), present only when the spec supplied `loadIndex`. */
|
|
83
|
+
maxLoadKg?: number;
|
|
80
84
|
}
|
|
81
85
|
export interface TireResult {
|
|
82
86
|
tire1: TireData;
|
|
@@ -84,6 +88,12 @@ export interface TireResult {
|
|
|
84
88
|
diameterDiff: number;
|
|
85
89
|
diameterDiffPercent: number;
|
|
86
90
|
speedoCorrection: number;
|
|
91
|
+
/** tire2's max load minus tire1's (kg) — present only when both specs supplied `loadIndex`. */
|
|
92
|
+
loadCapacityDiffKg?: number;
|
|
93
|
+
/** true when tire2's load index rates it to carry less than tire1 — a replacement tire that
|
|
94
|
+
* cannot legally/safely substitute for the original (relevant for heavy EVs needing HL-rated
|
|
95
|
+
* tires). Present only when both specs supplied `loadIndex`. */
|
|
96
|
+
loadCapacityReduced?: boolean;
|
|
87
97
|
}
|
|
88
98
|
/**
|
|
89
99
|
* Torque Converter Types
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/automotive/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,E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AAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formulab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Manufacturing & Engineering calculation formulas library - 203 industrial calculations across 15 domains for OEE, Cpk, SPC, FMEA, Nelson Rules, metal weight, CNC machining, GD&T, battery, environmental, pipe flow, logistics, IE time study, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|