pmcf 4.29.0 → 4.29.1

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,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.29.0",
3
+ "version": "4.29.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -102,7 +102,21 @@ export class Base {
102
102
 
103
103
  materializeExtends() {}
104
104
 
105
- named(name) {}
105
+ named(name) {
106
+ for (const [path, attribute] of extendingAttributeIterator(
107
+ this.constructor,
108
+ (name, attribute) => /*attribute.owner &&*/ !attribute.type.primitive
109
+ )) {
110
+ const value = this[path];
111
+ if (typeof value?.get === "function") {
112
+ const object = value.get(name);
113
+ // console.log("NAMED", name, object.fullName);
114
+ if (object) {
115
+ return object;
116
+ }
117
+ }
118
+ }
119
+ }
106
120
 
107
121
  typeNamed(typeName, name) {
108
122
  if (this.owner) {
package/src/host.mjs CHANGED
@@ -341,15 +341,6 @@ export class Host extends ServiceOwner {
341
341
  return super.typeNamed(typeName, name);
342
342
  }
343
343
 
344
- named(name) {
345
- const ni = this._networkInterfaces.get(name);
346
- if (ni) {
347
- return ni;
348
- }
349
-
350
- return super.named(name);
351
- }
352
-
353
344
  get network() {
354
345
  for (const ni of this.networkInterfaces.values()) {
355
346
  if (ni._kind !== "loopback" && ni._network) {
@@ -64,14 +64,5 @@ export class ServiceOwner extends Base {
64
64
  throw new Error("invalidType", { cause: typeName });
65
65
  }
66
66
  return super.typeNamed(typeName, name);
67
- }
68
-
69
- /**
70
- *
71
- * @param {string} name
72
- * @returns {Service|undefined}
73
- */
74
- named(name) {
75
- return this.services.get(name);
76
- }
67
+ }
77
68
  }