@openmrs/esm-utils 10.0.1-pre.5542 → 10.0.1-pre.5545
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/.turbo/turbo-build.log +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +4 -2
- package/package.json +4 -6
- package/src/index.ts +0 -1
- package/src/version.ts +5 -3
- package/dist/is-online.d.ts +0 -14
- package/dist/is-online.d.ts.map +0 -1
- package/dist/is-online.js +0 -14
- package/src/is-online.ts +0 -17
package/.turbo/turbo-build.log
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAuBA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,WAMnF"}
|
package/dist/version.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/** @module @category Utility */ import
|
|
1
|
+
/** @module @category Utility */ // Deep import so the bundle only pulls `satisfies` (+ its Range/Comparator/SemVer core)
|
|
2
|
+
// rather than the whole semver index, which is CommonJS and can't be tree-shaken.
|
|
3
|
+
import satisfies from "semver/functions/satisfies.js";
|
|
2
4
|
function normalizeOnlyVersion(version) {
|
|
3
5
|
const [major, minor, patch] = version.split('.');
|
|
4
6
|
return `${major}.${minor}.${patch}`;
|
|
@@ -23,7 +25,7 @@ function normalizeFullVersion(version) {
|
|
|
23
25
|
*
|
|
24
26
|
*/ export function isVersionSatisfied(requiredVersion, installedVersion) {
|
|
25
27
|
const version = normalizeFullVersion(installedVersion);
|
|
26
|
-
return
|
|
28
|
+
return satisfies(version, requiredVersion, {
|
|
27
29
|
includePrerelease: true
|
|
28
30
|
});
|
|
29
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-utils",
|
|
3
|
-
"version": "10.0.1-pre.
|
|
3
|
+
"version": "10.0.1-pre.5545",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Helper utilities for OpenMRS",
|
|
6
6
|
"type": "module",
|
|
@@ -58,13 +58,12 @@
|
|
|
58
58
|
"semver": "^7.7.3"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@openmrs/esm-globals": "^10.0.1-pre.
|
|
61
|
+
"@openmrs/esm-globals": "^10.0.1-pre.5545",
|
|
62
62
|
"dayjs": "1.x",
|
|
63
|
-
"i18next": "25.x"
|
|
64
|
-
"rxjs": "6.x"
|
|
63
|
+
"i18next": "25.x"
|
|
65
64
|
},
|
|
66
65
|
"devDependencies": {
|
|
67
|
-
"@openmrs/esm-globals": "10.0.1-pre.
|
|
66
|
+
"@openmrs/esm-globals": "10.0.1-pre.5545",
|
|
68
67
|
"@swc/cli": "0.8.1",
|
|
69
68
|
"@swc/core": "1.15.21",
|
|
70
69
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -75,7 +74,6 @@
|
|
|
75
74
|
"dayjs": "^1.11.13",
|
|
76
75
|
"happy-dom": "^20.6.0",
|
|
77
76
|
"rimraf": "^6.1.3",
|
|
78
|
-
"rxjs": "^6.5.3",
|
|
79
77
|
"vitest": "^4.1.2"
|
|
80
78
|
},
|
|
81
79
|
"stableVersion": "10.0.0"
|
package/src/index.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @module @category Utility */
|
|
2
|
-
import
|
|
2
|
+
// Deep import so the bundle only pulls `satisfies` (+ its Range/Comparator/SemVer core)
|
|
3
|
+
// rather than the whole semver index, which is CommonJS and can't be tree-shaken.
|
|
4
|
+
import satisfies from 'semver/functions/satisfies.js';
|
|
3
5
|
|
|
4
6
|
function normalizeOnlyVersion(version: string) {
|
|
5
7
|
const [major, minor, patch] = version.split('.');
|
|
@@ -31,7 +33,7 @@ function normalizeFullVersion(version: string) {
|
|
|
31
33
|
export function isVersionSatisfied(requiredVersion: string, installedVersion: string) {
|
|
32
34
|
const version = normalizeFullVersion(installedVersion);
|
|
33
35
|
|
|
34
|
-
return
|
|
36
|
+
return satisfies(version, requiredVersion, {
|
|
35
37
|
includePrerelease: true,
|
|
36
|
-
}
|
|
38
|
+
});
|
|
37
39
|
}
|
package/dist/is-online.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines if the application should behave as if it is online.
|
|
3
|
-
* When offline mode is enabled (`window.offlineEnabled`), this returns the
|
|
4
|
-
* provided `online` parameter or falls back to `navigator.onLine`.
|
|
5
|
-
* When offline mode is disabled, this always returns `true`.
|
|
6
|
-
*
|
|
7
|
-
* @param online Optional override for the online status. If provided and offline
|
|
8
|
-
* mode is enabled, this value is returned directly.
|
|
9
|
-
* @returns `true` if the application should behave as online, `false` otherwise.
|
|
10
|
-
*
|
|
11
|
-
* @category Utility
|
|
12
|
-
*/
|
|
13
|
-
export declare function isOnline(online?: boolean): boolean;
|
|
14
|
-
//# sourceMappingURL=is-online.d.ts.map
|
package/dist/is-online.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-online.d.ts","sourceRoot":"","sources":["../src/is-online.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,WAExC"}
|
package/dist/is-online.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines if the application should behave as if it is online.
|
|
3
|
-
* When offline mode is enabled (`window.offlineEnabled`), this returns the
|
|
4
|
-
* provided `online` parameter or falls back to `navigator.onLine`.
|
|
5
|
-
* When offline mode is disabled, this always returns `true`.
|
|
6
|
-
*
|
|
7
|
-
* @param online Optional override for the online status. If provided and offline
|
|
8
|
-
* mode is enabled, this value is returned directly.
|
|
9
|
-
* @returns `true` if the application should behave as online, `false` otherwise.
|
|
10
|
-
*
|
|
11
|
-
* @category Utility
|
|
12
|
-
*/ export function isOnline(online) {
|
|
13
|
-
return window.offlineEnabled ? online ?? navigator.onLine : true;
|
|
14
|
-
}
|
package/src/is-online.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type {} from '@openmrs/esm-globals';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Determines if the application should behave as if it is online.
|
|
5
|
-
* When offline mode is enabled (`window.offlineEnabled`), this returns the
|
|
6
|
-
* provided `online` parameter or falls back to `navigator.onLine`.
|
|
7
|
-
* When offline mode is disabled, this always returns `true`.
|
|
8
|
-
*
|
|
9
|
-
* @param online Optional override for the online status. If provided and offline
|
|
10
|
-
* mode is enabled, this value is returned directly.
|
|
11
|
-
* @returns `true` if the application should behave as online, `false` otherwise.
|
|
12
|
-
*
|
|
13
|
-
* @category Utility
|
|
14
|
-
*/
|
|
15
|
-
export function isOnline(online?: boolean) {
|
|
16
|
-
return window.offlineEnabled ? online ?? navigator.onLine : true;
|
|
17
|
-
}
|