How to smoothly rotate a model based on the heading values (from 358 degrees to 2 degrees)?

Basically i have a model aircraft and setting the position and heading, pitch, roll. My question is regarding the heading. Everything is working perfectly except that when heading is reaching to a borderline for instance 359 degrees (heading values in degrees ranging from 0 - 359.9999) and the next item/record the heading value is 2.0 degrees, the model just turns/rotates a complete ~360 degrees turn. I believe my code here does not account for this particular scenario where the heading value in in the borderline (358 degrees to 2 degrees).

Here's a sample of my code:

function positionModel() {

    var point = new Cesium.Cartographic(currentFlightData.longitude, currentFlightData.latitude, currentFlightData.altitude);
                var epoint = cesiumViewer.scene.globe.ellipsoid.cartographicToCartesian(point);

                var heading = currentFlightData.heading;
                var pitch = currentFlightData.pitch;
                var roll = currentFlightData.roll;

                var currentTranslation = new Cesium.Cartesian3();
                var currentRotation = new Cesium.Matrix3();

                var eastNorthUp = Cesium.Transforms.eastNorthUpToFixedFrame(epoint);
          
                Cesium.Matrix4.getRotation(eastNorthUp, currentRotation);
                Cesium.Matrix4.getTranslation(eastNorthUp, currentTranslation);

                var headingQuaternion = Cesium.Quaternion.fromAxisAngle(Cesium.Cartesian3.UNIT_Z, -heading );
                var pitchQuaternion = Cesium.Quaternion.fromAxisAngle(Cesium.Cartesian3.UNIT_Y, -pitch);
                var rollQuaternion = Cesium.Quaternion.fromAxisAngle(Cesium.Cartesian3.UNIT_X, -roll);

                var headingPitchQuaternion = Cesium.Quaternion.multiply(headingQuaternion, pitchQuaternion, new Cesium.Quaternion());
                var finalQuaternion = new Cesium.Quaternion();
                Cesium.Quaternion.multiply(headingPitchQuaternion, rollQuaternion, finalQuaternion);

                var rM = new Cesium.Matrix3();
                Cesium.Matrix3.fromQuaternion(finalQuaternion, rM);

                Cesium.Matrix3.multiply(currentRotation, rM, currentRotation);

                var modelMatrix = new Cesium.Matrix4();

                Cesium.Matrix4.fromRotationTranslation(
                    currentRotation,
                    currentTranslation,
                    modelMatrix
                );

                aircraftModel.modelMatrix = modelMatrix;
}

Hi, maybe you can try if Cesium.Quaternion.fromHeadingPitchRoll(h,p,r) will help ?