assemblerjs 1.1.12 → 1.1.13

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.
Files changed (55) hide show
  1. package/dist/index13.js +1 -1
  2. package/dist/index13.mjs +1 -1
  3. package/dist/index18.js +1 -1
  4. package/dist/index18.mjs +1 -1
  5. package/dist/index19.js +1 -1
  6. package/dist/index19.mjs +1 -1
  7. package/dist/index20.js +1 -1
  8. package/dist/index20.mjs +1 -1
  9. package/dist/index21.js +1 -1
  10. package/dist/index21.mjs +1 -1
  11. package/dist/index22.js +1 -1
  12. package/dist/index22.mjs +1 -1
  13. package/dist/index23.js +1 -1
  14. package/dist/index23.mjs +1 -1
  15. package/dist/index24.js +1 -1
  16. package/dist/index24.mjs +1 -1
  17. package/dist/index27.js +1 -1
  18. package/dist/index27.mjs +1 -1
  19. package/dist/index31.js +16 -134
  20. package/dist/index31.mjs +16 -134
  21. package/dist/index32.js +99 -44
  22. package/dist/index32.mjs +99 -44
  23. package/dist/index33.js +23 -74
  24. package/dist/index33.mjs +23 -74
  25. package/dist/index34.js +138 -42
  26. package/dist/index34.mjs +138 -42
  27. package/dist/index35.js +47 -28
  28. package/dist/index35.mjs +47 -28
  29. package/dist/index36.js +66 -149
  30. package/dist/index36.mjs +66 -149
  31. package/dist/index37.js +41 -19
  32. package/dist/index37.mjs +41 -19
  33. package/dist/index38.js +30 -39
  34. package/dist/index38.mjs +30 -38
  35. package/dist/index39.js +151 -94
  36. package/dist/index39.mjs +151 -94
  37. package/dist/index4.js +6 -6
  38. package/dist/index4.mjs +6 -6
  39. package/dist/index40.js +36 -24
  40. package/dist/index40.mjs +35 -24
  41. package/dist/index43.js +941 -28
  42. package/dist/index43.mjs +941 -27
  43. package/dist/index44.js +2 -194
  44. package/dist/index44.mjs +2 -194
  45. package/dist/index45.js +2 -942
  46. package/dist/index45.mjs +2 -942
  47. package/dist/index46.js +29 -2
  48. package/dist/index46.mjs +28 -2
  49. package/dist/index47.js +194 -2
  50. package/dist/index47.mjs +194 -2
  51. package/dist/index48.js +1 -1
  52. package/dist/index48.mjs +1 -1
  53. package/dist/index49.js +2 -2
  54. package/dist/index49.mjs +2 -2
  55. package/package.json +1 -1
package/dist/index40.mjs CHANGED
@@ -1,30 +1,41 @@
1
- class PointcutMatcher {
2
- static parse(t) {
3
- const e = t.match(/^execution\(([^.]+)\.([^)]+)\)$/);
4
- if (!e) {
5
- throw new Error(`Invalid pointcut expression: ${t}`);
1
+ import { EventManager } from './index6.mjs';
2
+
3
+ const registerEvents = (t, n)=>{
4
+ const o = t.concrete !== undefined && t.concrete.prototype instanceof EventManager;
5
+ if (o) {
6
+ const e = n;
7
+ const o = e.channels;
8
+ for (const n of t.events){
9
+ if (!o.has(n)) e.addChannels(n);
10
+ if (!t.privateContext.events.has(n)) t.privateContext.addChannels(n);
6
11
  }
7
- const [, c, r] = e;
8
- return new ExecutionPointcutMatcher(c, r);
9
- }
10
- }
11
- let ExecutionPointcutMatcher = class ExecutionPointcutMatcher {
12
- matches(t) {
13
- const e = t.target.constructor.name;
14
- const c = t.methodName;
15
- return this.classRegex.test(e) && this.methodRegex.test(c);
16
- }
17
- patternToRegex(t) {
18
- if (t === '*') {
19
- return /.*/;
12
+ for (const e of t.events){
13
+ n.on(e, (...n)=>{
14
+ t.privateContext.emit(e, ...n);
15
+ });
16
+ }
17
+ } else {
18
+ for (const e of t.events){
19
+ if (!t.privateContext.events.has(e)) t.privateContext.addChannels(e);
20
20
  }
21
- const e = t.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
22
- return new RegExp(`^${e}$`);
23
21
  }
24
- constructor(t, e){
25
- this.classRegex = this.patternToRegex(t);
26
- this.methodRegex = this.patternToRegex(e);
22
+ };
23
+ const unregisterEvents = (t, n)=>{
24
+ const o = t.concrete !== undefined && t.concrete.prototype instanceof EventManager;
25
+ if (o) {
26
+ const e = n;
27
+ for (const n of t.events){
28
+ e.off(n);
29
+ }
30
+ e.removeChannels(...t.events);
31
+ t.privateContext.removeChannels(...t.events);
32
+ } else {
33
+ for (const e of t.events){
34
+ if (t.privateContext.events.has(e)) {
35
+ t.privateContext.removeChannels(e);
36
+ }
37
+ }
27
38
  }
28
39
  };
29
40
 
30
- export { PointcutMatcher };
41
+ export { registerEvents, unregisterEvents };