How to use the @swim/structure.Num.from function in @swim/structure

To help you get started, we’ve selected a few @swim/structure 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-core-js / @swim / recon / main / ReconStructureParser.ts View on Github external
num(value: number | string): Value {
    if (typeof value === "number") {
      return Num.from(value);
    } else if (typeof value === "string") {
      return Num.from(+value);
    } else {
      throw new TypeError("" + value);
    }
  }
github swimos / swim / swim-system-js / swim-core-js / @swim / recon / main / ReconStructureParser.ts View on Github external
num(value: number | string): Value {
    if (typeof value === "number") {
      return Num.from(value);
    } else if (typeof value === "string") {
      return Num.from(+value);
    } else {
      throw new TypeError("" + value);
    }
  }