pmcf 4.25.7 → 4.25.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.25.7",
3
+ "version": "4.25.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/owner.mjs CHANGED
@@ -37,7 +37,7 @@ const OwnerTypeDefinition = {
37
37
  domains: string_set_attribute_writable,
38
38
  timezone: string_attribute_writable,
39
39
  architectures: string_set_attribute_writable,
40
- locales: string_set_attribute_writable,
40
+ locales: { ...string_set_attribute_writable, description: "unix locale" },
41
41
  administratorEmail: { ...email_attribute, writable: true },
42
42
  template: { ...boolean_attribute_writable, private: true }
43
43
  }
@@ -201,7 +201,7 @@ export class Owner extends Base {
201
201
  }
202
202
 
203
203
  subnetNamed(name) {
204
- return [...this.subnets].find(s => s.name == name);
204
+ return this.subnets.values().find(s => s.name == name);
205
205
  }
206
206
 
207
207
  get subnets() {
@@ -232,11 +232,7 @@ export class Owner extends Base {
232
232
  }
233
233
 
234
234
  subnetForAddress(address) {
235
- for (const subnet of this.subnets) {
236
- if (subnet.matchesAddress(address)) {
237
- return subnet;
238
- }
239
- }
235
+ return this.subnets.values().find(subnet => subnet.matchesAddress(address));
240
236
  }
241
237
 
242
238
  get clusters() {
@@ -354,10 +350,7 @@ export class Owner extends Base {
354
350
  }
355
351
 
356
352
  get locales() {
357
- if (this.owner) {
358
- return this.owner.locales.union(this._locales);
359
- }
360
- return this._locales;
353
+ return this.unionFromDirections(["this", "owner"], "_locales");
361
354
  }
362
355
 
363
356
  _timezone;
package/src/subnet.mjs CHANGED
@@ -15,22 +15,20 @@ import {
15
15
  import { networks_attribute } from "./network-support.mjs";
16
16
  import { Base } from "./base.mjs";
17
17
 
18
- const SubnetTypeDefinition = {
19
- name: "subnet",
20
- priority: 1,
21
- owners: ["location", "owner", "network", "root"],
22
- constructWithIdentifierOnly: true,
23
- key: "address",
24
- attributes: {
18
+ export class Subnet extends Base {
19
+ static name = "subnet";
20
+ static priority = 1;
21
+ static owners = ["location", "owner", "network", "root"];
22
+ static constructWithIdentifierOnly = true;
23
+ static key = "address";
24
+ static attributes = {
25
25
  address: name_attribute,
26
26
  networks: networks_attribute,
27
27
  prefixLength: number_attribute,
28
28
  family: string_attribute
29
- }
30
- };
29
+ };
31
30
 
32
- export class Subnet extends Base {
33
- static typeDefinition = SubnetTypeDefinition;
31
+ static typeDefinition = this;
34
32
 
35
33
  static {
36
34
  addType(this);