pmcf 1.102.0 → 1.102.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 +1 -1
- package/src/service.mjs +4 -3
- package/src/services/dns.mjs +2 -3
- package/src/services/ntp.mjs +2 -1
- package/types/service.d.mts +1 -1
package/package.json
CHANGED
package/src/service.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Base } from "./base.mjs";
|
|
2
2
|
import { addType } from "./types.mjs";
|
|
3
|
-
import { asArray } from "./utils.mjs";
|
|
3
|
+
import { asArray,isLocalhost } from "./utils.mjs";
|
|
4
4
|
import { networkAddressProperties } from "./network-support.mjs";
|
|
5
5
|
import {
|
|
6
6
|
DNSRecord,
|
|
@@ -277,12 +277,13 @@ export const sortByPriority = (a, b) => a.priority - b.priority;
|
|
|
277
277
|
export function serviceAddresses(
|
|
278
278
|
sources,
|
|
279
279
|
filter,
|
|
280
|
-
addressType = "rawAddresses"
|
|
280
|
+
addressType = "rawAddresses",
|
|
281
|
+
addressFilter = a=>!isLocalhost(a)
|
|
281
282
|
) {
|
|
282
283
|
return asArray(sources)
|
|
283
284
|
.map(ft => Array.from(ft.findServices(filter)))
|
|
284
285
|
.flat()
|
|
285
286
|
.sort(sortByPriority)
|
|
286
287
|
.map(s => s[addressType])
|
|
287
|
-
.flat();
|
|
288
|
+
.flat().filter(addressFilter);
|
|
288
289
|
}
|
package/src/services/dns.mjs
CHANGED
|
@@ -5,8 +5,7 @@ import {
|
|
|
5
5
|
writeLines,
|
|
6
6
|
isIPv6Address,
|
|
7
7
|
normalizeIPAddress,
|
|
8
|
-
isLinkLocal
|
|
9
|
-
isLocalhost
|
|
8
|
+
isLinkLocal
|
|
10
9
|
} from "../utils.mjs";
|
|
11
10
|
import { DNSRecord, dnsFullName } from "../dns-utils.mjs";
|
|
12
11
|
import { addType } from "../types.mjs";
|
|
@@ -158,7 +157,7 @@ export class DNSService extends Service {
|
|
|
158
157
|
DNS: serviceAddresses(this, {
|
|
159
158
|
...DNS_SERVICE_FILTER,
|
|
160
159
|
priority: "<10"
|
|
161
|
-
}).
|
|
160
|
+
}).join(" "),
|
|
162
161
|
FallbackDNS: serviceAddresses(this, {
|
|
163
162
|
...DNS_SERVICE_FILTER,
|
|
164
163
|
priority: ">=10"
|
package/src/services/ntp.mjs
CHANGED
package/types/service.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function serviceAddresses(sources: any, filter: any, addressType?: string): any[];
|
|
1
|
+
export function serviceAddresses(sources: any, filter: any, addressType?: string, addressFilter?: (a: any) => boolean): any[];
|
|
2
2
|
export namespace ServiceTypeDefinition {
|
|
3
3
|
export let name: string;
|
|
4
4
|
export let owners: string[];
|