@jfvilas/kwirth-common 0.4.30 → 0.4.31

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.
package/dist/Version.d.ts CHANGED
@@ -5,5 +5,5 @@
5
5
  * @returns true if version1 version is higher than version2
6
6
  */
7
7
  declare const versionGreatOrEqualThan: (version1: string, version2: string) => boolean;
8
- declare const versionGreatThan: (version1: string, version2: string) => boolean;
9
- export { versionGreatOrEqualThan, versionGreatThan };
8
+ declare const versionGreaterThan: (version1: string, version2: string) => boolean;
9
+ export { versionGreatOrEqualThan, versionGreaterThan };
package/dist/Version.js CHANGED
@@ -15,29 +15,32 @@ See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.versionGreatThan = exports.versionGreatOrEqualThan = void 0;
18
+ exports.versionGreaterThan = exports.versionGreatOrEqualThan = void 0;
19
19
  /**
20
20
  *
21
21
  * @param version1 version to check against a specifi level
22
22
  * @param version2 level you want to compare to
23
23
  * @returns true if version1 version is higher than version2
24
24
  */
25
+ // const versionGreatOrEqualThan = (version1: string, version2: string): boolean => {
26
+ // const v1 = version1.split('.').map(Number)
27
+ // const v2 = version2.split('.').map(Number)
28
+ // for (let i = 0; i < Math.max(v1.length, v2.length); i++) {
29
+ // const num1 = v1[i] || 0
30
+ // const num2 = v2[i] || 0
31
+ // if (num1 > num2)
32
+ // return true
33
+ // else if (num1 < num2)
34
+ // return false
35
+ // }
36
+ // // versions are equal
37
+ // return true
38
+ // }
25
39
  const versionGreatOrEqualThan = (version1, version2) => {
26
- const v1 = version1.split('.').map(Number);
27
- const v2 = version2.split('.').map(Number);
28
- for (let i = 0; i < Math.max(v1.length, v2.length); i++) {
29
- const num1 = v1[i] || 0;
30
- const num2 = v2[i] || 0;
31
- if (num1 >= num2)
32
- return true;
33
- else if (num1 < num2)
34
- return false;
35
- }
36
- // versions are equal
37
- return true;
40
+ return versionGreaterThan(version1, version2) || (version1 === version2);
38
41
  };
39
42
  exports.versionGreatOrEqualThan = versionGreatOrEqualThan;
40
- const versionGreatThan = (version1, version2) => {
43
+ const versionGreaterThan = (version1, version2) => {
41
44
  const v1 = version1.split('.').map(Number);
42
45
  const v2 = version2.split('.').map(Number);
43
46
  for (let i = 0; i < Math.max(v1.length, v2.length); i++) {
@@ -51,4 +54,4 @@ const versionGreatThan = (version1, version2) => {
51
54
  // versions are equal
52
55
  return false;
53
56
  };
54
- exports.versionGreatThan = versionGreatThan;
57
+ exports.versionGreaterThan = versionGreaterThan;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jfvilas/kwirth-common",
3
- "version": "0.4.30",
3
+ "version": "0.4.31",
4
4
  "description": "Common interfaces for integrating applications with Kwirth",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q && tsc"