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
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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 }, //
|
|
74
|
-
* { numberOfAxles: 3, numberOfTires: 12 } //
|
|
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:
|
|
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
|
|
104
|
-
*
|
|
105
|
-
*
|
|
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 }, //
|
|
116
|
-
* { numberOfAxles: 3, numberOfTires: 12 } //
|
|
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:
|
|
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
|
|
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.
|
|
1
|
+
export declare const version = "v2.14.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED