@openmrs/esm-utils 10.0.1-pre.5539 → 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.
@@ -1,3 +1,3 @@
1
- [0] Successfully compiled: 15 files with swc (393.94ms)
1
+ [0] Successfully compiled: 14 files with swc (174.69ms)
2
2
  [0] swc --strip-leading-paths src -d dist exited with code 0
3
3
  [1] tsc --project tsconfig.build.json exited with code 0
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './age-helpers';
2
2
  export * from './dates';
3
3
  export * from './get-locale';
4
- export * from './is-online';
5
4
  export * from './language-tag';
6
5
  export * from './match-locale';
7
6
  export * from './patient-helpers';
@@ -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,aAAa,CAAC;AAC5B,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"}
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
@@ -2,7 +2,6 @@
2
2
  export * from "./age-helpers.js";
3
3
  export * from "./dates/index.js";
4
4
  export * from "./get-locale.js";
5
- export * from "./is-online.js";
6
5
  export * from "./language-tag.js";
7
6
  export * from "./match-locale.js";
8
7
  export * from "./patient-helpers.js";
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAqBA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,WAMnF"}
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 * as semver from "semver";
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 semver.satisfies(version, requiredVersion, {
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.5539",
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.5539",
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.5539",
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
@@ -2,7 +2,6 @@
2
2
  export * from './age-helpers';
3
3
  export * from './dates';
4
4
  export * from './get-locale';
5
- export * from './is-online';
6
5
  export * from './language-tag';
7
6
  export * from './match-locale';
8
7
  export * from './patient-helpers';
package/src/version.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  /** @module @category Utility */
2
- import * as semver from 'semver';
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 semver.satisfies(version, requiredVersion, {
36
+ return satisfies(version, requiredVersion, {
35
37
  includePrerelease: true,
36
- } as semver.Options);
38
+ });
37
39
  }
@@ -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
@@ -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
- }