pmcf 4.14.9 → 4.14.11

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.14.9",
3
+ "version": "4.14.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,8 +25,10 @@ export async function generateKnownHosts(hosts, dir) {
25
25
  try {
26
26
  const [alg, key, desc] = (await host.publicKey("ed25519")).split(/\s+/);
27
27
 
28
- for(const domainName of host.domainNames) {
29
- keys.push(`${domainName} ${alg} ${key}`);
28
+ for (const domainName of host.domainNames) {
29
+ if (domainName !== "localhost") {
30
+ keys.push(`${domainName} ${alg} ${key}`);
31
+ }
30
32
  }
31
33
 
32
34
  for (const addr of host.networkAddresses(
package/src/root.mjs CHANGED
@@ -49,7 +49,7 @@ export class Root extends Location {
49
49
  }
50
50
 
51
51
  async load(name, options) {
52
- name = name.replace(/\/([^\/]+\.json)?$/, "");
52
+ name = name.replace(/\/?([^\/]+\.json)?$/, "");
53
53
 
54
54
  const object = this.named(name);
55
55
  if (object) {
@@ -75,10 +75,17 @@ export class Root extends Location {
75
75
  (a, b) => (b.priority || 1.0) - (a.priority || 1.0)
76
76
  )) {
77
77
  if (type.clazz?.typeFileName) {
78
- for await (const name of glob( "**/" + type.clazz.typeFileName, {
78
+ for await (const name of glob("**/" + type.clazz.typeFileName, {
79
79
  cwd: this.directory
80
80
  })) {
81
- await this.load(name, { type });
81
+ if (type === this.constructor) {
82
+ const data = JSON.parse(
83
+ await readFile(join(this.directory, name), "utf8")
84
+ );
85
+ this._properties = data.properties;
86
+ } else {
87
+ await this.load(name, { type });
88
+ }
82
89
  }
83
90
  }
84
91
  }
package/src/utils.mjs CHANGED
@@ -13,7 +13,7 @@ export function yesno(flag) {
13
13
  */
14
14
  export function domainName(name, defaultDomain) {
15
15
  const dcs = name.split(".");
16
- return defaultDomain === undefined || dcs.length > 1
16
+ return defaultDomain === undefined || dcs.length > 1 || name === "localhost"
17
17
  ? name
18
18
  : [name, defaultDomain].join(".");
19
19
  }