@alterior/common 3.4.0 → 3.6.4

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.
@@ -0,0 +1,2 @@
1
+ export declare function disallowNativeAsync(func: Function): void;
2
+ //# sourceMappingURL=check-native-async.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-native-async.d.ts","sourceRoot":"","sources":["../src/check-native-async.ts"],"names":[],"mappings":"AACA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,QAwBjD"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.disallowNativeAsync = void 0;
4
+ function disallowNativeAsync(func) {
5
+ if (typeof func !== 'function')
6
+ return;
7
+ if (func.constructor.name === 'AsyncFunction') {
8
+ console.error();
9
+ console.error(`----------------------------------------------------------------------------------------------------`);
10
+ console.error(`Detected usage of a native async function in a context where it is not allowed.`);
11
+ console.error(`Unfortunately, native async/await is not supported by Alterior, as it breaks Zone tracking.`);
12
+ console.error(`Please ensure compilerOptions.target is set to ES2016 or lower, and keep in mind that `);
13
+ console.error(`dependencies compiled with native async/await support may cause problems for some Alterior features.`);
14
+ console.error(`For more information see https://github.com/angular/angular/issues/31730`);
15
+ console.error();
16
+ console.error(`**Please support the AsyncContext proposal which will help solve this problem**`);
17
+ console.error(` https://github.com/tc39/proposal-async-context`);
18
+ console.error();
19
+ console.error(`Context:`);
20
+ console.error(` - Function name: ${func.name}`);
21
+ console.error(` - Function implementation:`);
22
+ console.error(` ${String(func).replace(/\n/g, "\n ")}`);
23
+ console.error(`----------------------------------------------------------------------------------------------------`);
24
+ console.error();
25
+ throw new Error(`Native async/await is not supported [${func.name}()].`);
26
+ }
27
+ }
28
+ exports.disallowNativeAsync = disallowNativeAsync;
29
+ //# sourceMappingURL=check-native-async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-native-async.js","sourceRoot":"","sources":["../src/check-native-async.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* from './time';
16
16
  export * from './get-param-names';
17
17
  export * from './lazy-subject';
18
+ export * from './check-native-async';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -18,4 +18,5 @@ tslib_1.__exportStar(require("./presentation"), exports);
18
18
  tslib_1.__exportStar(require("./time"), exports);
19
19
  tslib_1.__exportStar(require("./get-param-names"), exports);
20
20
  tslib_1.__exportStar(require("./lazy-subject"), exports);
21
+ tslib_1.__exportStar(require("./check-native-async"), exports);
21
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,kDAAwB;AACxB,qDAA2B;AAC3B,mDAAyB;AACzB,oDAA0B;AAC1B,wDAA8B;AAC9B,mDAAyB;AACzB,oDAA0B;AAC1B,mDAAyB;AACzB,kDAAwB;AACxB,uDAA6B;AAC7B,yDAA+B;AAC/B,kDAAwB;AACxB,yDAA+B;AAC/B,iDAAuB;AACvB,4DAAkC;AAClC,yDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,kDAAwB;AACxB,qDAA2B;AAC3B,mDAAyB;AACzB,oDAA0B;AAC1B,wDAA8B;AAC9B,mDAAyB;AACzB,oDAA0B;AAC1B,mDAAyB;AACzB,kDAAwB;AACxB,uDAA6B;AAC7B,yDAA+B;AAC/B,kDAAwB;AACxB,yDAA+B;AAC/B,iDAAuB;AACvB,4DAAkC;AAClC,yDAA+B;AAC/B,+DAAqC"}
@@ -0,0 +1,2 @@
1
+ export declare function disallowNativeAsync(func: Function): void;
2
+ //# sourceMappingURL=check-native-async.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-native-async.d.ts","sourceRoot":"","sources":["../src/check-native-async.ts"],"names":[],"mappings":"AACA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,QAwBjD"}
@@ -0,0 +1,25 @@
1
+ export function disallowNativeAsync(func) {
2
+ if (typeof func !== 'function')
3
+ return;
4
+ if (func.constructor.name === 'AsyncFunction') {
5
+ console.error();
6
+ console.error(`----------------------------------------------------------------------------------------------------`);
7
+ console.error(`Detected usage of a native async function in a context where it is not allowed.`);
8
+ console.error(`Unfortunately, native async/await is not supported by Alterior, as it breaks Zone tracking.`);
9
+ console.error(`Please ensure compilerOptions.target is set to ES2016 or lower, and keep in mind that `);
10
+ console.error(`dependencies compiled with native async/await support may cause problems for some Alterior features.`);
11
+ console.error(`For more information see https://github.com/angular/angular/issues/31730`);
12
+ console.error();
13
+ console.error(`**Please support the AsyncContext proposal which will help solve this problem**`);
14
+ console.error(` https://github.com/tc39/proposal-async-context`);
15
+ console.error();
16
+ console.error(`Context:`);
17
+ console.error(` - Function name: ${func.name}`);
18
+ console.error(` - Function implementation:`);
19
+ console.error(` ${String(func).replace(/\n/g, "\n ")}`);
20
+ console.error(`----------------------------------------------------------------------------------------------------`);
21
+ console.error();
22
+ throw new Error(`Native async/await is not supported [${func.name}()].`);
23
+ }
24
+ }
25
+ //# sourceMappingURL=check-native-async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-native-async.js","sourceRoot":"","sources":["../src/check-native-async.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,mBAAmB,CAAC,IAAc;IAC9C,IAAI,OAAO,IAAI,KAAK,UAAU;QAC1B,OAAO;IAEX,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,eAAe,EAAE;QAC3C,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACtH,OAAO,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAC;QACjG,OAAO,CAAC,KAAK,CAAC,6FAA6F,CAAC,CAAC;QAC7G,OAAO,CAAC,KAAK,CAAC,wFAAwF,CAAC,CAAC;QACxG,OAAO,CAAC,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACtH,OAAO,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;QAC1F,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAC;QACjG,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACnE,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1B,OAAO,CAAC,KAAK,CAAC,qBAAqB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAChD,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACtH,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC;KAC5E;AACL,CAAC"}
@@ -15,4 +15,5 @@ export * from './presentation';
15
15
  export * from './time';
16
16
  export * from './get-param-names';
17
17
  export * from './lazy-subject';
18
+ export * from './check-native-async';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
package/dist.esm/index.js CHANGED
@@ -15,4 +15,5 @@ export * from './presentation';
15
15
  export * from './time';
16
16
  export * from './get-param-names';
17
17
  export * from './lazy-subject';
18
+ export * from './check-native-async';
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alterior/common",
3
- "version": "3.4.0",
3
+ "version": "3.6.4",
4
4
  "description": "Useful utilities for Typescript apps",
5
5
  "author": "The Alterior Project (https://github.com/alterior-mvc)",
6
6
  "license": "MIT",
@@ -43,5 +43,5 @@
43
43
  "peerDependencies": {
44
44
  "reflect-metadata": "^0.1.13"
45
45
  },
46
- "gitHead": "33b7ce9fa0c1cd53a4a7b46f948be3ffa3e54132"
46
+ "gitHead": "cc4137f515a8c28d15b04882a41d7c718be577fa"
47
47
  }
@@ -0,0 +1,26 @@
1
+
2
+ export function disallowNativeAsync(func: Function) {
3
+ if (typeof func !== 'function')
4
+ return;
5
+
6
+ if (func.constructor.name === 'AsyncFunction') {
7
+ console.error();
8
+ console.error(`----------------------------------------------------------------------------------------------------`);
9
+ console.error(`Detected usage of a native async function in a context where it is not allowed.`);
10
+ console.error(`Unfortunately, native async/await is not supported by Alterior, as it breaks Zone tracking.`);
11
+ console.error(`Please ensure compilerOptions.target is set to ES2016 or lower, and keep in mind that `);
12
+ console.error(`dependencies compiled with native async/await support may cause problems for some Alterior features.`);
13
+ console.error(`For more information see https://github.com/angular/angular/issues/31730`);
14
+ console.error();
15
+ console.error(`**Please support the AsyncContext proposal which will help solve this problem**`);
16
+ console.error(` https://github.com/tc39/proposal-async-context`);
17
+ console.error();
18
+ console.error(`Context:`);
19
+ console.error(` - Function name: ${func.name}`);
20
+ console.error(` - Function implementation:`);
21
+ console.error(` ${String(func).replace(/\n/g, "\n ")}`);
22
+ console.error(`----------------------------------------------------------------------------------------------------`);
23
+ console.error();
24
+ throw new Error(`Native async/await is not supported [${func.name}()].`);
25
+ }
26
+ }
package/src/index.ts CHANGED
@@ -14,4 +14,5 @@ export * from './locks';
14
14
  export * from './presentation';
15
15
  export * from './time';
16
16
  export * from './get-param-names';
17
- export * from './lazy-subject';
17
+ export * from './lazy-subject';
18
+ export * from './check-native-async';