How to use @swim/uri - 5 common examples

To help you get started, we’ve selected a few @swim/uri examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swimos / swim / swim-system-js / swim-mesh-js / @swim / cli / main / index.ts View on Github external
function runReflect(this: Cmd, args: {[name: string]: string | null | undefined}): void {
  const edgeUri = args.edge;
  if (edgeUri) {
    const meshUri = args.mesh;
    const hostUri = args.host;
    const nodeUri = args.node;
    const laneUri = args.lane;
    if (nodeUri) {
      let metaNodeUri: Uri;
      if (meshUri) {
        metaNodeUri = Uri.parse("swim:meta:mesh").appendedPath(meshUri, "node", nodeUri);
      } else if (hostUri) {
        metaNodeUri = Uri.parse("swim:meta:host").appendedPath(hostUri, "node", nodeUri);
      } else {
        metaNodeUri = Uri.parse("swim:meta:node").appendedPath(nodeUri);
      }
      if (laneUri) {
        metaNodeUri = metaNodeUri.appendedPath("lane", laneUri);
        link(edgeUri, metaNodeUri, "linkStats", args.format).open();
      } else {
        if (args.link !== void 0) {
          link(edgeUri, metaNodeUri, "linkStats", args.format).open();
        } else {
          link(edgeUri, metaNodeUri, "routerStats", args.format).open();
        }
      }
    } else if (hostUri !== void 0) {
      let metaNodeUri: Uri;
      if (meshUri) {
        metaNodeUri = Uri.parse("swim:meta:mesh").appendedPath(meshUri);
        if (hostUri) {
github swimos / swim / swim-system-js / swim-mesh-js / @swim / cli / main / index.ts View on Github external
metaNodeUri = Uri.parse("swim:meta:node").appendedPath(nodeUri);
      }
      if (laneUri) {
        metaNodeUri = metaNodeUri.appendedPath("lane", laneUri);
        link(edgeUri, metaNodeUri, "linkStats", args.format).open();
      } else {
        if (args.link !== void 0) {
          link(edgeUri, metaNodeUri, "linkStats", args.format).open();
        } else {
          link(edgeUri, metaNodeUri, "routerStats", args.format).open();
        }
      }
    } else if (hostUri !== void 0) {
      let metaNodeUri: Uri;
      if (meshUri) {
        metaNodeUri = Uri.parse("swim:meta:mesh").appendedPath(meshUri);
        if (hostUri) {
          metaNodeUri = metaNodeUri.appendedPath("host", hostUri);
        }
      } else {
        metaNodeUri = Uri.parse("swim:meta:host");
        if (hostUri) {
          metaNodeUri = metaNodeUri.appendedPath(hostUri);
        }
      }
      if (args.process !== void 0) {
        link(edgeUri, metaNodeUri, "processStats", args.format).open();
      } else if (args.system !== void 0) {
        link(edgeUri, metaNodeUri, "systemStats", args.format).open();
      } else if (args.data !== void 0) {
        link(edgeUri, metaNodeUri, "dataStats", args.format).open();
      } else if (args.router !== void 0) {
github swimos / swim / swim-system-js / swim-mesh-js / @swim / cli / main / index.ts View on Github external
} else {
        if (args.link !== void 0) {
          link(edgeUri, metaNodeUri, "linkStats", args.format).open();
        } else {
          link(edgeUri, metaNodeUri, "routerStats", args.format).open();
        }
      }
    } else if (hostUri !== void 0) {
      let metaNodeUri: Uri;
      if (meshUri) {
        metaNodeUri = Uri.parse("swim:meta:mesh").appendedPath(meshUri);
        if (hostUri) {
          metaNodeUri = metaNodeUri.appendedPath("host", hostUri);
        }
      } else {
        metaNodeUri = Uri.parse("swim:meta:host");
        if (hostUri) {
          metaNodeUri = metaNodeUri.appendedPath(hostUri);
        }
      }
      if (args.process !== void 0) {
        link(edgeUri, metaNodeUri, "processStats", args.format).open();
      } else if (args.system !== void 0) {
        link(edgeUri, metaNodeUri, "systemStats", args.format).open();
      } else if (args.data !== void 0) {
        link(edgeUri, metaNodeUri, "dataStats", args.format).open();
      } else if (args.router !== void 0) {
        link(edgeUri, metaNodeUri, "routerStats", args.format).open();
      } else if (args.link !== void 0) {
        link(edgeUri, metaNodeUri, "linkStats", args.format).open();
      } else {
        link(edgeUri, metaNodeUri, "hostStats", args.format).open();
github swimos / swim / swim-system-js / swim-mesh-js / @swim / cli / main / index.ts View on Github external
}
      if (args.process !== void 0) {
        link(edgeUri, metaNodeUri, "processStats", args.format).open();
      } else if (args.system !== void 0) {
        link(edgeUri, metaNodeUri, "systemStats", args.format).open();
      } else if (args.data !== void 0) {
        link(edgeUri, metaNodeUri, "dataStats", args.format).open();
      } else if (args.router !== void 0) {
        link(edgeUri, metaNodeUri, "routerStats", args.format).open();
      } else if (args.link !== void 0) {
        link(edgeUri, metaNodeUri, "linkStats", args.format).open();
      } else {
        link(edgeUri, metaNodeUri, "hostStats", args.format).open();
      }
    } else if (meshUri !== void 0) {
      let metaNodeUri = Uri.parse("swim:meta:mesh");
      if (meshUri) {
        metaNodeUri = metaNodeUri.appendedPath(meshUri);
      }
      if (args.process !== void 0) {
        link(edgeUri, metaNodeUri, "processStats", args.format).open();
      } else if (args.system !== void 0) {
        link(edgeUri, metaNodeUri, "systemStats", args.format).open();
      } else if (args.data !== void 0) {
        link(edgeUri, metaNodeUri, "dataStats", args.format).open();
      } else if (args.router !== void 0) {
        link(edgeUri, metaNodeUri, "routerStats", args.format).open();
      } else if (args.link !== void 0) {
        link(edgeUri, metaNodeUri, "linkStats", args.format).open();
      } else {
        link(edgeUri, metaNodeUri, "meshStats", args.format).open();
      }
github swimos / swim / swim-system-js / swim-mesh-js / @swim / cli / main / index.ts View on Github external
function runReflect(this: Cmd, args: {[name: string]: string | null | undefined}): void {
  const edgeUri = args.edge;
  if (edgeUri) {
    const meshUri = args.mesh;
    const hostUri = args.host;
    const nodeUri = args.node;
    const laneUri = args.lane;
    if (nodeUri) {
      let metaNodeUri: Uri;
      if (meshUri) {
        metaNodeUri = Uri.parse("swim:meta:mesh").appendedPath(meshUri, "node", nodeUri);
      } else if (hostUri) {
        metaNodeUri = Uri.parse("swim:meta:host").appendedPath(hostUri, "node", nodeUri);
      } else {
        metaNodeUri = Uri.parse("swim:meta:node").appendedPath(nodeUri);
      }
      if (laneUri) {
        metaNodeUri = metaNodeUri.appendedPath("lane", laneUri);
        link(edgeUri, metaNodeUri, "linkStats", args.format).open();
      } else {
        if (args.link !== void 0) {
          link(edgeUri, metaNodeUri, "linkStats", args.format).open();
        } else {
          link(edgeUri, metaNodeUri, "routerStats", args.format).open();
        }
      }
    } else if (hostUri !== void 0) {
      let metaNodeUri: Uri;
      if (meshUri) {

@swim/uri

Rich object model for working with Uniform Resource Identifiers and URI subcomponents, including an efficient and safe codec for parsing and writing compliant URI strings

Apache-2.0
Latest version published 5 months ago

Package Health Score

68 / 100
Full package analysis

Popular @swim/uri functions