pmcf 4.17.4 → 4.18.0

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-info CHANGED
@@ -1,26 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import { prepare } from "../src/cli.mjs";
3
3
 
4
- const { root, args, options } = await prepare({
5
- service: {
6
- type: "string"
7
- },
8
- address: {
9
- type: "boolean"
10
- }
11
- });
4
+ const { root, args, options } = await prepare({});
12
5
 
13
6
  for (const name of args) {
14
- const object = await root.load(name);
15
- if (options.service) {
16
- for (const service of root.findServices(`type="${options.service}"`)) {
17
- console.log(service.toString());
18
- }
19
- } else if (options.address) {
20
- for (const na of object.networkAddresses()) {
21
- console.log(na.toString());
22
- }
23
- } else {
24
- console.log(object.toJSON());
7
+ const [path, expression] = name.split("?");
8
+
9
+ const object = await root.load(path);
10
+
11
+ let result = object.expression(expression);
12
+
13
+ if (result instanceof Iterator) {
14
+ result = Array.from(result);
25
15
  }
16
+
17
+ console.log(result);
26
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.17.4",
3
+ "version": "4.18.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/owner.mjs CHANGED
@@ -169,7 +169,7 @@ export class Owner extends Base {
169
169
  return this.typeNamed("location", name);
170
170
  }
171
171
 
172
- locations() {
172
+ get locations() {
173
173
  return this.typeList("location");
174
174
  }
175
175
 
package/types/owner.d.mts CHANGED
@@ -192,7 +192,7 @@ export class Owner extends Base {
192
192
  addObject(object: any): void;
193
193
  findServices(filter: any): Generator<any, void, any>;
194
194
  locationNamed(name: any): any;
195
- locations(): any;
195
+ get locations(): any;
196
196
  hostNamed(name: any): any;
197
197
  directHosts(): Set<any>;
198
198
  hosts(): Set<any>;