@onecx/accelerator 6.2.0 → 6.3.0

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@onecx/accelerator",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "peerDependencies": {
6
6
  "tslib": "^2.6.3",
7
7
  "rxjs": "^7.8.1",
8
8
  "@nx/devkit": "^20.3.0",
9
- "@onecx/nx-migration-utils": "^6.2.0"
9
+ "@onecx/nx-migration-utils": "^6.3.0"
10
10
  },
11
11
  "type": "commonjs",
12
12
  "main": "./src/index.js",
package/src/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './lib/topic/syncable-topic';
4
4
  export * from './lib/topic/topic-publisher';
5
5
  export * from './lib/utils/path.utils';
6
6
  export * from './lib/utils/date.utils';
7
+ export * from './lib/utils/is-test.utils';
package/src/index.js CHANGED
@@ -7,4 +7,5 @@ tslib_1.__exportStar(require("./lib/topic/syncable-topic"), exports);
7
7
  tslib_1.__exportStar(require("./lib/topic/topic-publisher"), exports);
8
8
  tslib_1.__exportStar(require("./lib/utils/path.utils"), exports);
9
9
  tslib_1.__exportStar(require("./lib/utils/date.utils"), exports);
10
+ tslib_1.__exportStar(require("./lib/utils/is-test.utils"), exports);
10
11
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/accelerator/src/index.ts"],"names":[],"mappings":";;;AAAA,4DAAiC;AACjC,uEAA4C;AAC5C,qEAA0C;AAC1C,sEAA2C;AAC3C,iEAAsC;AACtC,iEAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/accelerator/src/index.ts"],"names":[],"mappings":";;;AAAA,4DAAiC;AACjC,uEAA4C;AAC5C,qEAA0C;AAC1C,sEAA2C;AAC3C,iEAAsC;AACtC,iEAAsC;AACtC,oEAAyC"}
@@ -9,6 +9,8 @@ import { Topic } from './topic';
9
9
  * Keep in mind that there can be multiple instances of the Topic
10
10
  * so you cannot rely on the fact that the shell has already checked
11
11
  * that it is initialized.
12
+ *
13
+ * @deprecated Should not be used anymore because reading async data in a sync way is dangerous and leads to errors. Use `Topic` instead.
12
14
  */
13
15
  export declare class SyncableTopic<T> extends Topic<T> {
14
16
  constructor(name: string, version: number);
@@ -12,6 +12,8 @@ const topic_1 = require("./topic");
12
12
  * Keep in mind that there can be multiple instances of the Topic
13
13
  * so you cannot rely on the fact that the shell has already checked
14
14
  * that it is initialized.
15
+ *
16
+ * @deprecated Should not be used anymore because reading async data in a sync way is dangerous and leads to errors. Use `Topic` instead.
15
17
  */
16
18
  class SyncableTopic extends topic_1.Topic {
17
19
  constructor(name, version) {
@@ -1 +1 @@
1
- {"version":3,"file":"syncable-topic.js","sourceRoot":"","sources":["../../../../../../libs/accelerator/src/lib/topic/syncable-topic.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAG/B;;;;;;;;;;GAUG;AACH,MAAa,aAAiB,SAAQ,aAAQ;IAC5C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACtB,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAuB,IAAI,CAAC,IAAI,CAAC,KAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9E,CAAC;CACF;AAdD,sCAcC"}
1
+ {"version":3,"file":"syncable-topic.js","sourceRoot":"","sources":["../../../../../../libs/accelerator/src/lib/topic/syncable-topic.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAG/B;;;;;;;;;;;;GAYG;AACH,MAAa,aAAiB,SAAQ,aAAQ;IAC5C,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACtB,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAuB,IAAI,CAAC,IAAI,CAAC,KAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9E,CAAC;CACF;AAdD,sCAcC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utility function to determine if the code is running in a test environment.
3
+ * It checks for the presence of Jasmine or Jest environment variables.
4
+ *
5
+ * @returns {boolean} - Returns true if running in a test environment, otherwise false.
6
+ */
7
+ export declare function isTest(): boolean;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTest = isTest;
4
+ /**
5
+ * Utility function to determine if the code is running in a test environment.
6
+ * It checks for the presence of Jasmine or Jest environment variables.
7
+ *
8
+ * @returns {boolean} - Returns true if running in a test environment, otherwise false.
9
+ */
10
+ function isTest() {
11
+ if (typeof globalThis.jasmine !== 'undefined') {
12
+ return true;
13
+ }
14
+ if (typeof process !== 'undefined' && process.env?.["JEST_WORKER_ID"] !== undefined) {
15
+ return true;
16
+ }
17
+ return false;
18
+ }
19
+ //# sourceMappingURL=is-test.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-test.utils.js","sourceRoot":"","sources":["../../../../../../libs/accelerator/src/lib/utils/is-test.utils.ts"],"names":[],"mappings":";;AAMA,wBAQC;AAdD;;;;;GAKG;AACH,SAAgB,MAAM;IACpB,IAAG,OAAQ,UAAkB,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,SAAS,EAAE,CAAC;QACnF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}