onroute-policy-engine 2.13.0 → 2.14.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.
@@ -58,9 +58,9 @@ export declare function CheckBridgeFormula(policy: Policy, _vehicleConfiguration
58
58
  * Validates the number of tires per axle unit against regulatory requirements.
59
59
  *
60
60
  * This function checks that each axle unit has a valid number of tires based on
61
- * the number of axles in that unit. The validation allows for 2, 4, or 8 tires
62
- * per axle (2, 4, or 8 * number of axles). This ensures compliance with tire
63
- * count regulations for commercial vehicles.
61
+ * the number of axles in that unit and the axle unit position. Axle unit 1 is
62
+ * the steer axle unit, axle unit 2 is the drive axle unit, and axle units 3+
63
+ * use the generic axle unit allowance.
64
64
  *
65
65
  * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
66
66
  * @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
@@ -70,15 +70,15 @@ export declare function CheckBridgeFormula(policy: Policy, _vehicleConfiguration
70
70
  * @example
71
71
  * // For a vehicle with 2 axle units
72
72
  * const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
73
- * { numberOfAxles: 2, numberOfTires: 4 }, // 2 axles × 2 tires = 4 (valid)
74
- * { numberOfAxles: 3, numberOfTires: 12 } // 3 axles × 4 tires = 12 (valid)
73
+ * { numberOfAxles: 2, numberOfTires: 4 }, // tandem steer: 4 (valid)
74
+ * { numberOfAxles: 3, numberOfTires: 12 } // tridem drive: 12 (valid)
75
75
  * ]);
76
76
  * // Returns pass results for both axle units
77
77
  *
78
78
  * @example
79
79
  * // Invalid tire count example
80
80
  * const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
81
- * { numberOfAxles: 2, numberOfTires: 6 } // 2 axles × 3 tires = 6 (invalid - not 2, 4, or 8 per axle)
81
+ * { numberOfAxles: 1, numberOfTires: 8 } // single drive: 8 (invalid)
82
82
  * ]);
83
83
  * // Returns fail result for the axle unit
84
84
  *
@@ -100,9 +100,9 @@ function CheckBridgeFormula(policy, _vehicleConfiguration, axleConfiguration) {
100
100
  * Validates the number of tires per axle unit against regulatory requirements.
101
101
  *
102
102
  * This function checks that each axle unit has a valid number of tires based on
103
- * the number of axles in that unit. The validation allows for 2, 4, or 8 tires
104
- * per axle (2, 4, or 8 * number of axles). This ensures compliance with tire
105
- * count regulations for commercial vehicles.
103
+ * the number of axles in that unit and the axle unit position. Axle unit 1 is
104
+ * the steer axle unit, axle unit 2 is the drive axle unit, and axle units 3+
105
+ * use the generic axle unit allowance.
106
106
  *
107
107
  * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
108
108
  * @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
@@ -112,15 +112,15 @@ function CheckBridgeFormula(policy, _vehicleConfiguration, axleConfiguration) {
112
112
  * @example
113
113
  * // For a vehicle with 2 axle units
114
114
  * const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
115
- * { numberOfAxles: 2, numberOfTires: 4 }, // 2 axles × 2 tires = 4 (valid)
116
- * { numberOfAxles: 3, numberOfTires: 12 } // 3 axles × 4 tires = 12 (valid)
115
+ * { numberOfAxles: 2, numberOfTires: 4 }, // tandem steer: 4 (valid)
116
+ * { numberOfAxles: 3, numberOfTires: 12 } // tridem drive: 12 (valid)
117
117
  * ]);
118
118
  * // Returns pass results for both axle units
119
119
  *
120
120
  * @example
121
121
  * // Invalid tire count example
122
122
  * const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
123
- * { numberOfAxles: 2, numberOfTires: 6 } // 2 axles × 3 tires = 6 (invalid - not 2, 4, or 8 per axle)
123
+ * { numberOfAxles: 1, numberOfTires: 8 } // single drive: 8 (invalid)
124
124
  * ]);
125
125
  * // Returns fail result for the axle unit
126
126
  *
@@ -143,7 +143,10 @@ function CheckNumTiresPerAxle(_policy, _vehicleConfiguration, axleConfiguration)
143
143
  message = `Number of axles for axle unit ${axleNum} is not permittable.`;
144
144
  }
145
145
  else {
146
- const checkResult = [numAxles * 2, numAxles * 4, numAxles * 8].includes(numTires);
146
+ const multipliers = axleNum === 1 ? [2] : axleNum === 2 ? [2, 4] : [2, 4, 8];
147
+ const checkResult = multipliers
148
+ .map((multiplier) => numAxles * multiplier)
149
+ .includes(numTires);
147
150
  message = checkResult
148
151
  ? `No. of Wheels for Axle Unit ${axleNum} is permittable.`
149
152
  : `No. of Wheels for Axle Unit ${axleNum} is not permittable.`;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v2.13.0";
1
+ export declare const version = "v2.14.0";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = 'v2.13.0';
5
+ exports.version = 'v2.14.0';
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "testEnvironment": "node"
93
93
  },
94
- "version": "v2.13.0"
94
+ "version": "v2.14.0"
95
95
  }