assemblerjs 1.1.7 → 1.1.9

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 (69) hide show
  1. package/dist/index11.js +2 -2
  2. package/dist/index11.mjs +2 -2
  3. package/dist/index13.js +2 -2
  4. package/dist/index13.mjs +2 -2
  5. package/dist/index16.js +1 -1
  6. package/dist/index16.mjs +1 -1
  7. package/dist/index17.js +1 -1
  8. package/dist/index17.mjs +1 -1
  9. package/dist/index18.js +1 -1
  10. package/dist/index18.mjs +1 -1
  11. package/dist/index19.js +1 -1
  12. package/dist/index19.mjs +1 -1
  13. package/dist/index2.js +2 -2
  14. package/dist/index2.mjs +2 -2
  15. package/dist/index20.js +1 -1
  16. package/dist/index20.mjs +1 -1
  17. package/dist/index21.js +1 -1
  18. package/dist/index21.mjs +1 -1
  19. package/dist/index22.js +2 -2
  20. package/dist/index22.mjs +2 -2
  21. package/dist/index23.js +2 -2
  22. package/dist/index23.mjs +2 -2
  23. package/dist/index24.js +2 -2
  24. package/dist/index24.mjs +2 -2
  25. package/dist/index25.js +1 -1
  26. package/dist/index25.mjs +1 -1
  27. package/dist/index26.js +1 -1
  28. package/dist/index26.mjs +1 -1
  29. package/dist/index29.js +38 -15
  30. package/dist/index29.mjs +37 -12
  31. package/dist/index3.js +1 -1
  32. package/dist/index3.mjs +1 -1
  33. package/dist/index30.js +130 -100
  34. package/dist/index30.mjs +130 -98
  35. package/dist/index31.js +36 -103
  36. package/dist/index31.mjs +36 -103
  37. package/dist/index32.js +70 -41
  38. package/dist/index32.mjs +70 -41
  39. package/dist/index33.js +37 -75
  40. package/dist/index33.mjs +37 -75
  41. package/dist/index34.js +29 -39
  42. package/dist/index34.mjs +29 -39
  43. package/dist/index35.js +151 -26
  44. package/dist/index35.mjs +151 -26
  45. package/dist/index36.js +16 -133
  46. package/dist/index36.mjs +13 -133
  47. package/dist/index37.js +100 -33
  48. package/dist/index37.mjs +98 -32
  49. package/dist/index38.js +101 -18
  50. package/dist/index38.mjs +101 -18
  51. package/dist/index39.js +24 -101
  52. package/dist/index39.mjs +24 -101
  53. package/dist/index4.js +6 -6
  54. package/dist/index4.mjs +6 -6
  55. package/dist/index40.js +18 -24
  56. package/dist/index40.mjs +18 -24
  57. package/dist/index41.js +29 -49
  58. package/dist/index41.mjs +28 -49
  59. package/dist/index43.js +49 -29
  60. package/dist/index43.mjs +49 -28
  61. package/dist/index44.js +4 -4
  62. package/dist/index44.mjs +4 -4
  63. package/dist/index48.js +1 -1
  64. package/dist/index48.mjs +1 -1
  65. package/dist/index49.js +2 -2
  66. package/dist/index49.mjs +2 -2
  67. package/dist/index50.js +1 -1
  68. package/dist/index50.mjs +1 -1
  69. package/package.json +1 -1
package/dist/index31.mjs CHANGED
@@ -1,119 +1,52 @@
1
- import { HookManager } from './index33.mjs';
2
- import { SingletonStrategy, TransientStrategy } from './index43.mjs';
3
- import { DebugLogger } from './index36.mjs';
4
- import { isClass } from '@assemblerjs/core';
5
- import { resolveInstanceInjectionTuple } from './index42.mjs';
6
- import { resolveInjectionTuple } from './index41.mjs';
7
- import { Injectable } from './index44.mjs';
1
+ import { DebugLogger } from './index35.mjs';
8
2
 
9
- function c(e) {
10
- if (e?.name) return e.name;
11
- if (typeof e === 'string') return e;
12
- if (typeof e === 'symbol') return e.toString();
13
- if (typeof e === 'number') return String(e);
14
- if (typeof e === 'boolean') return String(e);
15
- if (typeof e === 'object' && e !== null) {
16
- try {
17
- const t = JSON.stringify(e);
18
- if (t.length > 100) {
19
- return t.substring(0, 100) + '...';
20
- }
21
- return t;
22
- } catch {
23
- return `[${e.constructor?.name || 'Object'}]`;
24
- }
25
- }
26
- return String(e);
27
- }
28
- function l(e) {
29
- if (isClass(e)) return 'class';
30
- if (typeof e === 'string') return 'string';
31
- if (typeof e === 'symbol') return 'symbol';
32
- return 'unknown';
3
+ function t(e) {
4
+ return typeof e === 'symbol' ? 'symbol' : 'string';
33
5
  }
34
- class InjectableManager {
35
- setContexts(e, t) {
36
- this.privateContext = e;
37
- this.publicContext = t;
38
- }
39
- register(i, s = false) {
40
- const a = DebugLogger.getInstance();
41
- const c = s === true ? resolveInstanceInjectionTuple(i) : resolveInjectionTuple(i);
42
- if (this.has(c.identifier)) {
43
- const e = `An assemblage is already registered with identifier '${c.identifier.name}'.`;
44
- a.log('error', 'Duplicate registration', {
45
- identifier: c.identifier.name,
46
- error: e
6
+ class ObjectManager {
7
+ use(r, o) {
8
+ if (this.has(r)) {
9
+ const o = typeof r === 'symbol' ? r.toString() : String(r);
10
+ const s = `Object/value '${o}' is already registered (cannot register twice).`;
11
+ DebugLogger.getInstance().log('error', 'Duplicate object/value registration', {
12
+ identifier: o,
13
+ type: t(r),
14
+ error: s
47
15
  });
48
- throw new Error(e);
49
- }
50
- const l = Injectable.of(c, this.privateContext, this.publicContext);
51
- a.logRegistration(l);
52
- this.injectables.set(l.identifier, l);
53
- if (l.concrete) {
54
- HookManager.callHook(l.concrete, 'onRegister', this.publicContext, l.configuration);
16
+ throw new Error(s);
55
17
  }
56
- return l;
18
+ this.objects.set(r, o);
19
+ return o;
57
20
  }
58
21
  has(e) {
59
- return this.injectables.has(e);
60
- }
61
- require(e, t, r) {
62
- if (!this.injectables.has(e)) {
63
- const t = this.resolvingStack.has(e);
64
- const n = t ? 'Circular dependency detected' : 'Dependency not registered';
65
- const i = c(e);
66
- const s = l(e);
67
- const a = t ? `Circular dependency detected: '${i}' is already being resolved.` : `Dependency '${i}' has not been registered (Class/Service not found in current assemblies).`;
68
- DebugLogger.getInstance().log('error', n, {
69
- identifier: i,
70
- caller: r ? c(r) : 'unknown',
71
- type: s,
72
- error: a
22
+ return this.objects.has(e);
23
+ }
24
+ require(r) {
25
+ if (!this.objects.has(r)) {
26
+ const o = typeof r === 'symbol' ? r.toString() : String(r);
27
+ const s = `Object/value '${o}' has not been registered in the object store.`;
28
+ DebugLogger.getInstance().log('error', 'Object/value not found', {
29
+ identifier: o,
30
+ type: t(r),
31
+ error: s
73
32
  });
74
- throw new Error(a);
75
- }
76
- const n = this.injectables.get(e);
77
- this.resolvingStack.add(n.identifier);
78
- try {
79
- if (n.isSingleton) {
80
- return this.singletonStrategy.resolve(n, t);
81
- } else {
82
- return this.transientStrategy.resolve(n, t);
83
- }
84
- } finally{
85
- this.resolvingStack.delete(n.identifier);
86
- }
87
- }
88
- concrete(e) {
89
- const t = this.injectables.get(e);
90
- if (t) return t.concrete;
91
- return;
92
- }
93
- tagged(...e) {
94
- const t = [];
95
- for (const r of e){
96
- for (const [e, n] of this.injectables){
97
- if (n.tags.includes(r)) t.push(n.build());
98
- }
33
+ throw new Error(s);
99
34
  }
100
- return t;
35
+ return this.objects.get(r);
101
36
  }
102
- dispose() {
103
- for (const [e, t] of this.injectables){
104
- t.dispose();
37
+ addGlobal(e, t) {
38
+ if (this.globals.has(e)) {
39
+ throw new Error(`Global value with key '${e}' has already been registered.`);
105
40
  }
106
- this.resolvingStack.clear();
41
+ this.globals.set(e, t);
107
42
  }
108
- get size() {
109
- return this.injectables.size;
43
+ global(e) {
44
+ return this.globals.get(e);
110
45
  }
111
46
  constructor(){
112
- this.injectables = new Map();
113
- this.resolvingStack = new Set();
114
- this.singletonStrategy = new SingletonStrategy();
115
- this.transientStrategy = new TransientStrategy();
47
+ this.objects = new Map();
48
+ this.globals = new Map();
116
49
  }
117
50
  }
118
51
 
119
- export { InjectableManager };
52
+ export { ObjectManager };
package/dist/index32.js CHANGED
@@ -2,55 +2,84 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const debugLogger = require('./index36.js');
5
+ const core = require('@assemblerjs/core');
6
+ const debugLogger = require('./index35.js');
6
7
 
7
- function t(e) {
8
- return typeof e === 'symbol' ? 'symbol' : 'string';
9
- }
10
- class ObjectManager {
11
- use(r, o) {
12
- if (this.has(r)) {
13
- const o = typeof r === 'symbol' ? r.toString() : String(r);
14
- const s = `Object/value '${o}' is already registered (cannot register twice).`;
15
- debugLogger.DebugLogger.getInstance().log('error', 'Duplicate object/value registration', {
16
- identifier: o,
17
- type: t(r),
18
- error: s
19
- });
20
- throw new Error(s);
21
- }
22
- this.objects.set(r, o);
23
- return o;
8
+ class HookManager {
9
+ prepareInitHook(o, t) {
10
+ this.initCache.push({
11
+ instance: o,
12
+ configuration: t
13
+ });
14
+ return this.initCache;
24
15
  }
25
- has(e) {
26
- return this.objects.has(e);
27
- }
28
- require(r) {
29
- if (!this.objects.has(r)) {
30
- const o = typeof r === 'symbol' ? r.toString() : String(r);
31
- const s = `Object/value '${o}' has not been registered in the object store.`;
32
- debugLogger.DebugLogger.getInstance().log('error', 'Object/value not found', {
33
- identifier: o,
34
- type: t(r),
35
- error: s
36
- });
37
- throw new Error(s);
16
+ callInitHooks(o) {
17
+ for (const t of this.initCache){
18
+ HookManager.callHookImmediate(t.instance, 'onInit', o, t.configuration);
38
19
  }
39
- return this.objects.get(r);
40
20
  }
41
- addGlobal(e, t) {
42
- if (this.globals.has(e)) {
43
- throw new Error(`Global value with key '${e}' has already been registered.`);
21
+ callInitedHooks(o) {
22
+ for (const t of [
23
+ ...this.initCache
24
+ ].reverse()){
25
+ HookManager.callHookImmediate(t.instance, 'onInited', o, t.configuration);
44
26
  }
45
- this.globals.set(e, t);
46
27
  }
47
- global(e) {
48
- return this.globals.get(e);
28
+ clearCache() {
29
+ this.initCache.length = 0;
30
+ }
31
+ getCache() {
32
+ return this.initCache;
49
33
  }
50
34
  constructor(){
51
- this.objects = new Map();
52
- this.globals = new Map();
35
+ this.initCache = [];
53
36
  }
54
37
  }
38
+ HookManager.callHook = (e, i, n, a)=>{
39
+ const c = debugLogger.DebugLogger.getInstance();
40
+ const r = c.logHook(i, e, a);
41
+ return new Promise((t, c)=>{
42
+ const s = e[i];
43
+ if (s) {
44
+ if (core.isAsync(s)) {
45
+ s.bind(e)(n, a).then(()=>{
46
+ if (r) r();
47
+ t();
48
+ }).catch((o)=>{
49
+ if (r) r();
50
+ c(o);
51
+ });
52
+ return;
53
+ }
54
+ try {
55
+ s.bind(e)(n, a);
56
+ if (r) r();
57
+ t();
58
+ } catch (o) {
59
+ if (r) r();
60
+ c(o);
61
+ }
62
+ } else {
63
+ if (r) r();
64
+ t();
65
+ }
66
+ });
67
+ };
68
+ HookManager.callHookImmediate = (e, i, n, a)=>{
69
+ const c = debugLogger.DebugLogger.getInstance();
70
+ const r = c.logHook(i, e, a);
71
+ const s = e[i];
72
+ if (s) {
73
+ if (core.isAsync(s)) {
74
+ s.bind(e)(n, a).catch(()=>{});
75
+ if (r) r();
76
+ return;
77
+ }
78
+ s.bind(e)(n, a);
79
+ if (r) r();
80
+ } else {
81
+ if (r) r();
82
+ }
83
+ };
55
84
 
56
- exports.ObjectManager = ObjectManager;
85
+ exports.HookManager = HookManager;
package/dist/index32.mjs CHANGED
@@ -1,52 +1,81 @@
1
- import { DebugLogger } from './index36.mjs';
1
+ import { isAsync } from '@assemblerjs/core';
2
+ import { DebugLogger } from './index35.mjs';
2
3
 
3
- function t(e) {
4
- return typeof e === 'symbol' ? 'symbol' : 'string';
5
- }
6
- class ObjectManager {
7
- use(r, o) {
8
- if (this.has(r)) {
9
- const o = typeof r === 'symbol' ? r.toString() : String(r);
10
- const s = `Object/value '${o}' is already registered (cannot register twice).`;
11
- DebugLogger.getInstance().log('error', 'Duplicate object/value registration', {
12
- identifier: o,
13
- type: t(r),
14
- error: s
15
- });
16
- throw new Error(s);
17
- }
18
- this.objects.set(r, o);
19
- return o;
4
+ class HookManager {
5
+ prepareInitHook(o, t) {
6
+ this.initCache.push({
7
+ instance: o,
8
+ configuration: t
9
+ });
10
+ return this.initCache;
20
11
  }
21
- has(e) {
22
- return this.objects.has(e);
23
- }
24
- require(r) {
25
- if (!this.objects.has(r)) {
26
- const o = typeof r === 'symbol' ? r.toString() : String(r);
27
- const s = `Object/value '${o}' has not been registered in the object store.`;
28
- DebugLogger.getInstance().log('error', 'Object/value not found', {
29
- identifier: o,
30
- type: t(r),
31
- error: s
32
- });
33
- throw new Error(s);
12
+ callInitHooks(o) {
13
+ for (const t of this.initCache){
14
+ HookManager.callHookImmediate(t.instance, 'onInit', o, t.configuration);
34
15
  }
35
- return this.objects.get(r);
36
16
  }
37
- addGlobal(e, t) {
38
- if (this.globals.has(e)) {
39
- throw new Error(`Global value with key '${e}' has already been registered.`);
17
+ callInitedHooks(o) {
18
+ for (const t of [
19
+ ...this.initCache
20
+ ].reverse()){
21
+ HookManager.callHookImmediate(t.instance, 'onInited', o, t.configuration);
40
22
  }
41
- this.globals.set(e, t);
42
23
  }
43
- global(e) {
44
- return this.globals.get(e);
24
+ clearCache() {
25
+ this.initCache.length = 0;
26
+ }
27
+ getCache() {
28
+ return this.initCache;
45
29
  }
46
30
  constructor(){
47
- this.objects = new Map();
48
- this.globals = new Map();
31
+ this.initCache = [];
49
32
  }
50
33
  }
34
+ HookManager.callHook = (e, i, n, a)=>{
35
+ const c = DebugLogger.getInstance();
36
+ const r = c.logHook(i, e, a);
37
+ return new Promise((t, c)=>{
38
+ const s = e[i];
39
+ if (s) {
40
+ if (isAsync(s)) {
41
+ s.bind(e)(n, a).then(()=>{
42
+ if (r) r();
43
+ t();
44
+ }).catch((o)=>{
45
+ if (r) r();
46
+ c(o);
47
+ });
48
+ return;
49
+ }
50
+ try {
51
+ s.bind(e)(n, a);
52
+ if (r) r();
53
+ t();
54
+ } catch (o) {
55
+ if (r) r();
56
+ c(o);
57
+ }
58
+ } else {
59
+ if (r) r();
60
+ t();
61
+ }
62
+ });
63
+ };
64
+ HookManager.callHookImmediate = (e, i, n, a)=>{
65
+ const c = DebugLogger.getInstance();
66
+ const r = c.logHook(i, e, a);
67
+ const s = e[i];
68
+ if (s) {
69
+ if (isAsync(s)) {
70
+ s.bind(e)(n, a).catch(()=>{});
71
+ if (r) r();
72
+ return;
73
+ }
74
+ s.bind(e)(n, a);
75
+ if (r) r();
76
+ } else {
77
+ if (r) r();
78
+ }
79
+ };
51
80
 
52
- export { ObjectManager };
81
+ export { HookManager };
package/dist/index33.js CHANGED
@@ -2,84 +2,46 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const core = require('@assemblerjs/core');
6
- const debugLogger = require('./index36.js');
5
+ const hookManager = require('./index32.js');
6
+ const debugLogger = require('./index35.js');
7
+ const schema = require('./index37.js');
7
8
 
8
- class HookManager {
9
- prepareInitHook(o, t) {
10
- this.initCache.push({
11
- instance: o,
12
- configuration: t
13
- });
14
- return this.initCache;
15
- }
16
- callInitHooks(o) {
17
- for (const t of this.initCache){
18
- HookManager.callHookImmediate(t.instance, 'onInit', o, t.configuration);
19
- }
20
- }
21
- callInitedHooks(o) {
22
- for (const t of [
23
- ...this.initCache
24
- ].reverse()){
25
- HookManager.callHookImmediate(t.instance, 'onInited', o, t.configuration);
9
+ class AssemblerBuilder {
10
+ build(t, a) {
11
+ const n = debugLogger.DebugLogger.getInstance();
12
+ schema.setDefinitionValue('singleton', true, t);
13
+ n.logPhaseStart('registration');
14
+ const r = this.assembler.register([
15
+ t
16
+ ]);
17
+ n.logPhaseEnd('registration');
18
+ n.logPhaseStart('resolution');
19
+ const i = this.assembler.require(r.identifier, a);
20
+ n.logPhaseEnd('resolution');
21
+ const l = this.assembler.hookManager.getCache().find((e)=>e.instance === i);
22
+ if (!l) {
23
+ throw new Error('Root instance not found in assemblages cache.');
26
24
  }
25
+ const h = this.assembler.hookManager.getCache().indexOf(l);
26
+ this.assembler.hookManager.getCache().splice(h, 1);
27
+ n.logPhaseStart('hooks:onInit');
28
+ this.assembler.hookManager.callInitHooks(this.assembler.publicContext);
29
+ const c = a ? {
30
+ ...r.configuration,
31
+ ...a
32
+ } : r.configuration;
33
+ hookManager.HookManager.callHookImmediate(i, 'onInit', this.assembler.publicContext, c);
34
+ n.logPhaseEnd('hooks:onInit');
35
+ n.logPhaseStart('hooks:onInited');
36
+ this.assembler.hookManager.callInitedHooks(this.assembler.publicContext);
37
+ hookManager.HookManager.callHookImmediate(i, 'onInited', this.assembler.publicContext, c);
38
+ n.logPhaseEnd('hooks:onInited');
39
+ this.assembler.hookManager.clearCache();
40
+ return i;
27
41
  }
28
- clearCache() {
29
- this.initCache.length = 0;
30
- }
31
- getCache() {
32
- return this.initCache;
33
- }
34
- constructor(){
35
- this.initCache = [];
42
+ constructor(e){
43
+ this.assembler = e;
36
44
  }
37
45
  }
38
- HookManager.callHook = (e, i, n, a)=>{
39
- const c = debugLogger.DebugLogger.getInstance();
40
- const r = c.logHook(i, e, a);
41
- return new Promise((t, c)=>{
42
- const s = e[i];
43
- if (s) {
44
- if (core.isAsync(s)) {
45
- s.bind(e)(n, a).then(()=>{
46
- if (r) r();
47
- t();
48
- }).catch((o)=>{
49
- if (r) r();
50
- c(o);
51
- });
52
- return;
53
- }
54
- try {
55
- s.bind(e)(n, a);
56
- if (r) r();
57
- t();
58
- } catch (o) {
59
- if (r) r();
60
- c(o);
61
- }
62
- } else {
63
- if (r) r();
64
- t();
65
- }
66
- });
67
- };
68
- HookManager.callHookImmediate = (e, i, n, a)=>{
69
- const c = debugLogger.DebugLogger.getInstance();
70
- const r = c.logHook(i, e, a);
71
- const s = e[i];
72
- if (s) {
73
- if (core.isAsync(s)) {
74
- s.bind(e)(n, a).catch(()=>{});
75
- if (r) r();
76
- return;
77
- }
78
- s.bind(e)(n, a);
79
- if (r) r();
80
- } else {
81
- if (r) r();
82
- }
83
- };
84
46
 
85
- exports.HookManager = HookManager;
47
+ exports.AssemblerBuilder = AssemblerBuilder;
package/dist/index33.mjs CHANGED
@@ -1,81 +1,43 @@
1
- import { isAsync } from '@assemblerjs/core';
2
- import { DebugLogger } from './index36.mjs';
1
+ import { HookManager } from './index32.mjs';
2
+ import { DebugLogger } from './index35.mjs';
3
+ import { setDefinitionValue } from './index37.mjs';
3
4
 
4
- class HookManager {
5
- prepareInitHook(o, t) {
6
- this.initCache.push({
7
- instance: o,
8
- configuration: t
9
- });
10
- return this.initCache;
11
- }
12
- callInitHooks(o) {
13
- for (const t of this.initCache){
14
- HookManager.callHookImmediate(t.instance, 'onInit', o, t.configuration);
15
- }
16
- }
17
- callInitedHooks(o) {
18
- for (const t of [
19
- ...this.initCache
20
- ].reverse()){
21
- HookManager.callHookImmediate(t.instance, 'onInited', o, t.configuration);
5
+ class AssemblerBuilder {
6
+ build(t, a) {
7
+ const n = DebugLogger.getInstance();
8
+ setDefinitionValue('singleton', true, t);
9
+ n.logPhaseStart('registration');
10
+ const r = this.assembler.register([
11
+ t
12
+ ]);
13
+ n.logPhaseEnd('registration');
14
+ n.logPhaseStart('resolution');
15
+ const i = this.assembler.require(r.identifier, a);
16
+ n.logPhaseEnd('resolution');
17
+ const l = this.assembler.hookManager.getCache().find((e)=>e.instance === i);
18
+ if (!l) {
19
+ throw new Error('Root instance not found in assemblages cache.');
22
20
  }
21
+ const h = this.assembler.hookManager.getCache().indexOf(l);
22
+ this.assembler.hookManager.getCache().splice(h, 1);
23
+ n.logPhaseStart('hooks:onInit');
24
+ this.assembler.hookManager.callInitHooks(this.assembler.publicContext);
25
+ const c = a ? {
26
+ ...r.configuration,
27
+ ...a
28
+ } : r.configuration;
29
+ HookManager.callHookImmediate(i, 'onInit', this.assembler.publicContext, c);
30
+ n.logPhaseEnd('hooks:onInit');
31
+ n.logPhaseStart('hooks:onInited');
32
+ this.assembler.hookManager.callInitedHooks(this.assembler.publicContext);
33
+ HookManager.callHookImmediate(i, 'onInited', this.assembler.publicContext, c);
34
+ n.logPhaseEnd('hooks:onInited');
35
+ this.assembler.hookManager.clearCache();
36
+ return i;
23
37
  }
24
- clearCache() {
25
- this.initCache.length = 0;
26
- }
27
- getCache() {
28
- return this.initCache;
29
- }
30
- constructor(){
31
- this.initCache = [];
38
+ constructor(e){
39
+ this.assembler = e;
32
40
  }
33
41
  }
34
- HookManager.callHook = (e, i, n, a)=>{
35
- const c = DebugLogger.getInstance();
36
- const r = c.logHook(i, e, a);
37
- return new Promise((t, c)=>{
38
- const s = e[i];
39
- if (s) {
40
- if (isAsync(s)) {
41
- s.bind(e)(n, a).then(()=>{
42
- if (r) r();
43
- t();
44
- }).catch((o)=>{
45
- if (r) r();
46
- c(o);
47
- });
48
- return;
49
- }
50
- try {
51
- s.bind(e)(n, a);
52
- if (r) r();
53
- t();
54
- } catch (o) {
55
- if (r) r();
56
- c(o);
57
- }
58
- } else {
59
- if (r) r();
60
- t();
61
- }
62
- });
63
- };
64
- HookManager.callHookImmediate = (e, i, n, a)=>{
65
- const c = DebugLogger.getInstance();
66
- const r = c.logHook(i, e, a);
67
- const s = e[i];
68
- if (s) {
69
- if (isAsync(s)) {
70
- s.bind(e)(n, a).catch(()=>{});
71
- if (r) r();
72
- return;
73
- }
74
- s.bind(e)(n, a);
75
- if (r) r();
76
- } else {
77
- if (r) r();
78
- }
79
- };
80
42
 
81
- export { HookManager };
43
+ export { AssemblerBuilder };