pmcf 2.35.3 → 2.35.5

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": "2.35.3",
3
+ "version": "2.35.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/service.mjs CHANGED
@@ -316,7 +316,11 @@ export function serviceEndpoints(sources, options = {}) {
316
316
  .map(service => service.endpoints(options.endpoints))
317
317
  .flat();
318
318
 
319
- const res = new Set(options.select ? all.map(options.select) : all);
319
+ const res = [...new Set(options.select ? all.map(options.select) : all)];
320
320
 
321
- return options.join ? [...res].join(options.join) : res;
321
+ if(options.limit < res.length) {
322
+ res.length = options.limit;
323
+ }
324
+
325
+ return options.join ? res.join(options.join) : res;
322
326
  }
@@ -211,10 +211,11 @@ export class DNSService extends ExtraSourceService {
211
211
 
212
212
  const forwarders = serviceEndpoints(this.source, {
213
213
  services: { type: "dns", priority: ">=20" },
214
- select: e => e.address
214
+ select: e => e.address,
215
+ limit: 5
215
216
  });
216
217
 
217
- if (forwarders.size) {
218
+ if (forwarders.length) {
218
219
  await writeLines(
219
220
  join(p1, "etc/named/options"),
220
221
  `forwarders.conf`,
@@ -234,7 +235,7 @@ export class DNSService extends ExtraSourceService {
234
235
  if (acls.length) {
235
236
  await writeLines(join(p1, "etc/named"), `0-acl-${name}.conf`, acls);
236
237
  }
237
- if (forwarders.size || acls.length) {
238
+ if (forwarders.length || acls.length) {
238
239
  yield packageData;
239
240
  }
240
241
 
@@ -42,7 +42,8 @@ export class SystemdResolvedService extends ExtraSourceService {
42
42
  services: { type: "dns", priority },
43
43
  endpoints: e => e.networkInterface.kind !== "loopback",
44
44
  select: endpoint => endpoint.address,
45
- join: " "
45
+ join: " ",
46
+ limit: 5
46
47
  };
47
48
  };
48
49
 
@@ -1,4 +1,4 @@
1
- export function serviceEndpoints(sources: any, options?: {}): string | Set<any>;
1
+ export function serviceEndpoints(sources: any, options?: {}): string | any[];
2
2
  export namespace endpointProperties {
3
3
  export namespace port {
4
4
  let type: string;
@@ -247,8 +247,8 @@ export class SystemdResolvedService extends ExtraSourceService {
247
247
  systemdConfig(name: any): {
248
248
  name: string;
249
249
  content: (string | {
250
- DNS: string | Set<any>;
251
- FallbackDNS: string | Set<any>;
250
+ DNS: string | any[];
251
+ FallbackDNS: string | any[];
252
252
  Domains: string;
253
253
  DNSSEC: string;
254
254
  MulticastDNS: string;
@@ -247,7 +247,7 @@ export class SystemdTimesyncdService extends ExtraSourceService {
247
247
  systemdConfig(name: any): {
248
248
  name: string;
249
249
  content: (string | {
250
- NTP: string | Set<any>;
250
+ NTP: string | any[];
251
251
  })[];
252
252
  };
253
253
  }