Skip to content

Commit

Permalink
Add docs to api version compare functions (qzind#886)
Browse files Browse the repository at this point in the history
Co-authored-by: Berenz <[email protected]>
  • Loading branch information
tresf and Berenz authored Nov 25, 2021
1 parent 306402d commit ae4adea
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions js/qz-tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -2552,10 +2552,34 @@ var qz = (function() {
*/
isVersion: _qz.tools.isVersion,

/**
* Checks if the connected QZ Tray application is greater than the specified version.
*
* @param {string|number} major Major version to check
* @param {string|number} [minor] Minor version to check
* @param {string|number} [patch] Patch version to check
* @param {string|number} [build] Build version to check
* @returns {boolean} True if connected version is greater than the version specified.
*
* @memberof qz.api
* @since 2.1.0-4
*/
isVersionGreater: function(major, minor, patch, build) {
return _qz.tools.versionCompare(major, minor, patch, build) > 0;
},

/**
* Checks if the connected QZ Tray application is less than the specified version.
*
* @param {string|number} major Major version to check
* @param {string|number} [minor] Minor version to check
* @param {string|number} [patch] Patch version to check
* @param {string|number} [build] Build version to check
* @returns {boolean} True if connected version is less than the version specified.
*
* @memberof qz.api
* @since 2.1.0-4
*/
isVersionLess: function(major, minor, patch, build) {
return _qz.tools.versionCompare(major, minor, patch, build) < 0;
},
Expand Down

0 comments on commit ae4adea

Please sign in to comment.