pmcf 6.34.6 → 6.35.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/bin/pmcf-package CHANGED
@@ -6,8 +6,8 @@ import { tmpdir } from "node:os";
6
6
  import { cwd, env } from "node:process";
7
7
  import { packageDirectory } from "package-directory";
8
8
  import { createPublishingDetails } from "npm-pkgbuild";
9
+ import { asArray } from "pacc";
9
10
  import { prepare } from "../src/cli.mjs";
10
- import { asArray } from "../src/utils.mjs";
11
11
 
12
12
  const { root, args, options } = await prepare({
13
13
  publish: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.34.6",
3
+ "version": "6.35.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -53,8 +53,8 @@
53
53
  "aggregated-map": "^1.0.10",
54
54
  "content-entry-transform": "^1.7.1",
55
55
  "ip-utilties": "^3.13.0",
56
- "npm-pkgbuild": "^20.9.0",
57
- "pacc": "^11.2.6",
56
+ "npm-pkgbuild": "^20.9.1",
57
+ "pacc": "^11.4.1",
58
58
  "package-directory": "^8.2.0",
59
59
  "yaml": "^2.9.0"
60
60
  },
@@ -2,7 +2,8 @@ import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
2
2
  import {
3
3
  string_attribute_writable,
4
4
  number_attribute_writable,
5
- priority_attribute
5
+ priority_attribute,
6
+ asArray
6
7
  } from "pacc";
7
8
  import {
8
9
  Base,
@@ -15,7 +16,6 @@ import {
15
16
  FAMILY_UNIX,
16
17
  FAMILY_DNS
17
18
  } from "pmcf";
18
- import { asArray } from "./utils.mjs";
19
19
  import {
20
20
  networkAddressAttributes,
21
21
  extends_attribute,
package/src/dns-utils.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { decodeIPv4, decodeIPv6, FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
2
- import { asIterator } from "./utils.mjs";
2
+ import { asIterator } from "pacc";
3
3
 
4
4
  const typeOrder = {
5
5
  SOA: 0,
package/src/host.mjs CHANGED
@@ -7,7 +7,8 @@ import {
7
7
  string_attribute_writable,
8
8
  string_set_attribute_writable,
9
9
  number_attribute_writable,
10
- priority_attribute
10
+ priority_attribute,
11
+ asArray
11
12
  } from "pacc";
12
13
  import { addresses, addType, assign } from "pmcf";
13
14
  import {
@@ -22,7 +23,6 @@ import {
22
23
  domainFromDominName,
23
24
  domainName,
24
25
  writeLines,
25
- asArray,
26
26
  union
27
27
  } from "./utils.mjs";
28
28
  import { loadHooks } from "./hooks.mjs";
@@ -2,14 +2,14 @@ import {
2
2
  default_attribute,
3
3
  string_attribute,
4
4
  type_attribute,
5
- getAttribute
5
+ getAttribute,
6
+ asArray
6
7
  } from "pacc";
7
8
  import { familyIP, formatCIDR, decodeIP, addressType } from "ip-utilties";
8
9
  import { Subnet } from "./subnet.mjs";
9
10
  import { Owner, addType } from "pmcf";
10
11
  import { NetworkInterface } from "./network-interfaces/network-interface.mjs";
11
12
  import { family_attribute, subnet_attribute } from "./common-attributes.mjs";
12
- import { asArray } from "./utils.mjs";
13
13
  /**
14
14
  *
15
15
  */
@@ -1,7 +1,7 @@
1
1
  import { join } from "node:path";
2
2
  import { AggregatedMap } from "aggregated-map";
3
- import { addType } from "pacc";
4
- import { writeLines, sectionLines, asArray } from "../utils.mjs";
3
+ import { addType, asArray } from "pacc";
4
+ import { writeLines, sectionLines } from "../utils.mjs";
5
5
  import { NetworkAddress, Host, cidrAddresses } from "pmcf";
6
6
  import { ServiceOwner } from "../service-owner.mjs";
7
7
 
package/src/owner.mjs CHANGED
@@ -4,9 +4,10 @@ import { AggregatedMap } from "aggregated-map";
4
4
  import {
5
5
  string_set_attribute_writable,
6
6
  string_attribute_writable,
7
- email_attribute
7
+ email_attribute,
8
+ asArray
8
9
  } from "pacc";
9
- import { asArray, union } from "./utils.mjs";
10
+ import { union } from "./utils.mjs";
10
11
  import { ServiceOwner } from "./service-owner.mjs";
11
12
  import { Subnet, SUBNET_GLOBAL_IPV4, SUBNET_GLOBAL_IPV6 } from "./subnet.mjs";
12
13
  import {
@@ -1,6 +1,6 @@
1
- import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
1
+ import { asArray } from "pacc";
2
+ import { FAMILY_IPV6 } from "ip-utilties";
2
3
  import { FAMILY_UNIX, FAMILY_IPV4_IPV6 } from "./endpoint.mjs";
3
- import { asArray } from "./utils.mjs";
4
4
 
5
5
  export const ServiceTypes = {
6
6
  "alpm-repo": {
@@ -16,7 +16,8 @@ import {
16
16
  boolean_attribute_writable_false,
17
17
  integer_attribute_writable,
18
18
  integer_attribute,
19
- secret_attribute_writable
19
+ secret_attribute_writable,
20
+ asArray
20
21
  } from "pacc";
21
22
  import {
22
23
  Base,
@@ -27,7 +28,7 @@ import {
27
28
  addType,
28
29
  FAMILY_IPV4_IPV6
29
30
  } from "pmcf";
30
- import { yesno, writeLines, asArray } from "../utils.mjs";
31
+ import { yesno, writeLines } from "../utils.mjs";
31
32
  import {
32
33
  DNSRecord,
33
34
  dnsFullName,
package/src/type.mjs CHANGED
@@ -1,7 +1,6 @@
1
- import { addType as addTypeBasic, toInternal, registerToken, DOT } from "pacc";
1
+ import { addType as addTypeBasic, toInternal, registerToken, DOT, asArray } from "pacc";
2
2
  import { normalizeIP } from "ip-utilties";
3
3
  import { addServiceType } from "pmcf";
4
- import { asArray } from "./utils.mjs";
5
4
 
6
5
  const SLASH = { ...DOT, str: "/" };
7
6
 
package/src/utils.mjs CHANGED
@@ -91,50 +91,6 @@ export function bridgeToJSON(bridge) {
91
91
  return [...bridge].map(n => n.fullName || `(${n})`).sort();
92
92
  }
93
93
 
94
- /**
95
- * Convert scalar or iterable into Array.
96
- * @param {any} value
97
- * @returns {Array<any>}
98
- */
99
- export function asArray(value) {
100
- switch (typeof value) {
101
- case "undefined":
102
- return [];
103
- case "object":
104
- if (Array.isArray(value)) {
105
- return value;
106
- }
107
-
108
- if (value instanceof Iterator || value[Symbol.iterator]) {
109
- return [...value];
110
- }
111
- }
112
-
113
- return [value];
114
- }
115
-
116
- /**
117
- * @param {any} value
118
- * @returns {Iterable<any>}
119
- */
120
- export function asIterator(value) {
121
- switch (typeof value) {
122
- case "undefined":
123
- return [];
124
- case "string":
125
- case "number":
126
- case "boolean":
127
- case "bigint":
128
- return [value];
129
- }
130
-
131
- if (value[Symbol.iterator]) {
132
- return value;
133
- }
134
-
135
- return asArray(value);
136
- }
137
-
138
94
  export const filterConfigurable = attribute =>
139
95
  !attribute.private && attribute.configurable;
140
96