formulab 0.9.0 → 0.10.3

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -21
  3. package/README.md +659 -633
  4. package/dist/automotive/brakingDistance.d.ts +4 -0
  5. package/dist/automotive/brakingDistance.d.ts.map +1 -1
  6. package/dist/automotive/brakingDistance.js +8 -4
  7. package/dist/automotive/brakingDistance.js.map +1 -1
  8. package/dist/battery/cRate.d.ts.map +1 -1
  9. package/dist/battery/cRate.js +6 -0
  10. package/dist/battery/cRate.js.map +1 -1
  11. package/dist/chemical/dilution.js +4 -4
  12. package/dist/chemical/dilution.js.map +1 -1
  13. package/dist/chemical/heatTransfer.d.ts +6 -0
  14. package/dist/chemical/heatTransfer.d.ts.map +1 -1
  15. package/dist/chemical/heatTransfer.js +15 -9
  16. package/dist/chemical/heatTransfer.js.map +1 -1
  17. package/dist/chemical/pipeFlow.d.ts +6 -0
  18. package/dist/chemical/pipeFlow.d.ts.map +1 -1
  19. package/dist/chemical/pipeFlow.js +12 -6
  20. package/dist/chemical/pipeFlow.js.map +1 -1
  21. package/dist/construction/aggregate.d.ts +4 -0
  22. package/dist/construction/aggregate.d.ts.map +1 -1
  23. package/dist/construction/aggregate.js +8 -4
  24. package/dist/construction/aggregate.js.map +1 -1
  25. package/dist/construction/momentOfInertia.d.ts +7 -0
  26. package/dist/construction/momentOfInertia.d.ts.map +1 -1
  27. package/dist/construction/momentOfInertia.js +19 -12
  28. package/dist/construction/momentOfInertia.js.map +1 -1
  29. package/dist/construction/roof.js +2 -2
  30. package/dist/construction/roof.js.map +1 -1
  31. package/dist/electronics/awg.d.ts +3 -2
  32. package/dist/electronics/awg.d.ts.map +1 -1
  33. package/dist/electronics/awg.js +3 -3
  34. package/dist/electronics/awg.js.map +1 -1
  35. package/dist/electronics/capacitor.js +1 -1
  36. package/dist/electronics/capacitor.js.map +1 -1
  37. package/dist/electronics/led.js +2 -2
  38. package/dist/electronics/led.js.map +1 -1
  39. package/dist/electronics/ohmsLaw.d.ts +3 -0
  40. package/dist/electronics/ohmsLaw.d.ts.map +1 -1
  41. package/dist/electronics/ohmsLaw.js +11 -8
  42. package/dist/electronics/ohmsLaw.js.map +1 -1
  43. package/dist/electronics/stencil.d.ts +2 -1
  44. package/dist/electronics/stencil.d.ts.map +1 -1
  45. package/dist/electronics/stencil.js +4 -3
  46. package/dist/electronics/stencil.js.map +1 -1
  47. package/dist/electronics/trace.d.ts.map +1 -1
  48. package/dist/electronics/trace.js +4 -7
  49. package/dist/electronics/trace.js.map +1 -1
  50. package/dist/energy/solarOutput.d.ts +4 -0
  51. package/dist/energy/solarOutput.d.ts.map +1 -1
  52. package/dist/energy/solarOutput.js +8 -4
  53. package/dist/energy/solarOutput.js.map +1 -1
  54. package/dist/environmental/scope2Emissions.d.ts +1 -0
  55. package/dist/environmental/scope2Emissions.d.ts.map +1 -1
  56. package/dist/environmental/scope2Emissions.js +2 -1
  57. package/dist/environmental/scope2Emissions.js.map +1 -1
  58. package/dist/machining/boringBarDeflection.d.ts.map +1 -1
  59. package/dist/machining/boringBarDeflection.js +7 -1
  60. package/dist/machining/boringBarDeflection.js.map +1 -1
  61. package/dist/machining/gaugeBlockStack.d.ts.map +1 -1
  62. package/dist/machining/gaugeBlockStack.js +18 -15
  63. package/dist/machining/gaugeBlockStack.js.map +1 -1
  64. package/dist/machining/toolDeflection.d.ts.map +1 -1
  65. package/dist/machining/toolDeflection.js +7 -1
  66. package/dist/machining/toolDeflection.js.map +1 -1
  67. package/dist/machining/triangleSolver.d.ts +2 -1
  68. package/dist/machining/triangleSolver.d.ts.map +1 -1
  69. package/dist/machining/triangleSolver.js +6 -5
  70. package/dist/machining/triangleSolver.js.map +1 -1
  71. package/dist/metal/flangeSpec.d.ts +3 -0
  72. package/dist/metal/flangeSpec.d.ts.map +1 -1
  73. package/dist/metal/flangeSpec.js +6 -3
  74. package/dist/metal/flangeSpec.js.map +1 -1
  75. package/dist/metal/metalWeight.d.ts.map +1 -1
  76. package/dist/metal/metalWeight.js +20 -0
  77. package/dist/metal/metalWeight.js.map +1 -1
  78. package/dist/metal/pipeSpec.d.ts +3 -0
  79. package/dist/metal/pipeSpec.d.ts.map +1 -1
  80. package/dist/metal/pipeSpec.js +6 -3
  81. package/dist/metal/pipeSpec.js.map +1 -1
  82. package/dist/quality/controlChart.d.ts +3 -0
  83. package/dist/quality/controlChart.d.ts.map +1 -1
  84. package/dist/quality/controlChart.js +6 -3
  85. package/dist/quality/controlChart.js.map +1 -1
  86. package/dist/quality/oee.js +2 -2
  87. package/dist/quality/oee.js.map +1 -1
  88. package/dist/safety/ventilationRate.d.ts +3 -0
  89. package/dist/safety/ventilationRate.d.ts.map +1 -1
  90. package/dist/safety/ventilationRate.js +6 -3
  91. package/dist/safety/ventilationRate.js.map +1 -1
  92. package/package.json +15 -17
package/CHANGELOG.md CHANGED
@@ -5,6 +5,48 @@ 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.10.1] - 2026-02-09
9
+
10
+ ### Fixed
11
+
12
+ - **`throw new Error` → `throw new RangeError`** across all 18 remaining files — runtime error type now matches `@throws {RangeError}` JSDoc and ERRORS.md policy. Affected domains: automotive, chemical, construction, electronics, energy, environmental, machining, metal, quality, safety.
13
+
14
+ ### Changed
15
+
16
+ - **README.md** — Updated test count (2,494), error handling section (no legacy NaN/Infinity), utility domain (3 → 16 functions).
17
+
18
+ ## [0.10.0] - 2026-02-09
19
+
20
+ ### Breaking Changes
21
+
22
+ - **`awgProperties()` return type** — Changed from `AwgResult | null` to `AwgResult`. Invalid AWG range (< 0 or > 40) now throws `RangeError` instead of returning `null`.
23
+ - **`metalWeight()`** — Now throws `RangeError` on non-positive dimensions (length, width, thickness, diameter) and when outerDiameter ≤ innerDiameter for pipes.
24
+ - **`cRate()`** — Now throws `RangeError` when capacityAh ≤ 0, currentA ≤ 0, or cRate ≤ 0. Previously returned `Infinity`.
25
+ - **`toolDeflection()`** — Now throws `RangeError` on non-positive toolDiameter/stickout or negative cuttingForce. Stiffness is computed as `3EI/L³` (beam property) instead of `F/δ`.
26
+ - **`boringBarDeflection()`** — Same changes as `toolDeflection()`: validation + stiffness formula fix.
27
+ - **`heatTransfer()`** — All `throw new Error()` changed to `throw new RangeError()`. Removed `Infinity` fallback in radiation thermal resistance.
28
+
29
+ ### Added
30
+
31
+ - **`@throws` JSDoc annotations** for 14 functions across 10 domains — documents every throw condition for IDE/editor hints:
32
+ - automotive: `brakingDistance`
33
+ - chemical: `heatTransfer`, `pipeFlow`
34
+ - construction: `aggregate`, `momentOfInertia`
35
+ - electronics: `ohmsLaw`, `stencil`
36
+ - energy: `solarOutput`
37
+ - environmental: `scope2Emissions`
38
+ - machining: `triangleSolver`
39
+ - metal: `flangeSpec`, `pipeSpec`
40
+ - quality: `controlChart`
41
+ - safety: `ventilationRate`
42
+
43
+ - **26 new validation tests** — error path coverage for `metalWeight`, `cRate`, `toolDeflection`, `boringBarDeflection`, `heatTransfer`, `awgProperties`
44
+
45
+ ### Changed
46
+
47
+ - **ERRORS.md** — Removed legacy migration roadmap (all NaN/Infinity patterns resolved). Updated all 6 function entries to reflect `throw` behavior.
48
+ - Total test count: 2468 → 2494 (+26)
49
+
8
50
  ## [0.9.0] - 2026-02-09
9
51
 
10
52
  ### Added
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 iyulab
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iyulab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.