@travetto/registry 2.1.2 → 2.1.3
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
package/src/service/metadata.ts
CHANGED
|
@@ -37,7 +37,7 @@ export abstract class MetadataRegistry<C extends { class: Class }, M = unknown,
|
|
|
37
37
|
abstract onInstallFinalize<T>(cls: Class<T>): C;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Code to call when
|
|
40
|
+
* Code to call when uninstall is finalized
|
|
41
41
|
*/
|
|
42
42
|
onUninstallFinalize<T>(cls: Class<T>) {
|
|
43
43
|
|
|
@@ -63,7 +63,7 @@ export abstract class MetadataRegistry<C extends { class: Class }, M = unknown,
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Retrieve the class that is being removed
|
|
67
67
|
*/
|
|
68
68
|
getExpired(cls: string | Class): C {
|
|
69
69
|
return this.expired.get(id(cls))!;
|
|
@@ -139,17 +139,17 @@ export abstract class MetadataRegistry<C extends { class: Class }, M = unknown,
|
|
|
139
139
|
/**
|
|
140
140
|
* Register a pending class, with partial config to overlay
|
|
141
141
|
*/
|
|
142
|
-
register(cls: Class,
|
|
142
|
+
register(cls: Class, pConfig: Partial<C> = {}) {
|
|
143
143
|
const conf = this.getOrCreatePending(cls);
|
|
144
|
-
Util.deepAssign(conf,
|
|
144
|
+
Util.deepAssign(conf, pConfig);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Register a pending field, with partial config to overlay
|
|
149
149
|
*/
|
|
150
|
-
registerField(cls: Class, field: F,
|
|
150
|
+
registerField(cls: Class, field: F, pConfig: Partial<M>) {
|
|
151
151
|
const conf = this.getOrCreatePendingField(cls, field);
|
|
152
|
-
Util.deepAssign(conf,
|
|
152
|
+
Util.deepAssign(conf, pConfig);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/**
|
|
@@ -37,6 +37,7 @@ export class MethodSource implements ChangeSource<[Class, Function]> {
|
|
|
37
37
|
if (!prev[k]) {
|
|
38
38
|
this.emit({ type: 'added', curr: [e.curr!, e.curr!.prototype[k]] });
|
|
39
39
|
} else if (next[k].hash !== prev[k].hash) {
|
|
40
|
+
// FIXME: Why is e.prev undefined sometimes?
|
|
40
41
|
this.emit({ type: 'changed', curr: [e.curr!, e.curr!.prototype[k]], prev: [e.prev!, e.prev!.prototype[k]] });
|
|
41
42
|
} else {
|
|
42
43
|
// Method Unchanged
|