How to use ts-essentials - 3 common examples

To help you get started, weโ€™ve selected a few ts-essentials 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 ethereum-ts / TypeChain / packages / typechain-target-truffle / lib / generation.ts View on Github external
case "void":
      return "void";
    case "bytes":
    case "dynamic-bytes":
      return "string";
    case "array":
      return `(${generateOutputType(evmType.itemType)})[]`;
    case "boolean":
      return "boolean";
    case "string":
      return "string";
    case "tuple":
      return generateTupleType(evmType, generateOutputType);

    default:
      throw new UnreachableCaseError(evmType);
  }
}
github ethereum-ts / TypeChain / packages / typechain-target-truffle / lib / generation.ts View on Github external
return "string | BigNumber";
    case "bytes":
      return "string | BigNumber";
    case "dynamic-bytes":
      return "string";
    case "array":
      return `(${generateInputType(evmType.itemType)})[]`;
    case "boolean":
      return "boolean";
    case "string":
      return "string";
    case "tuple":
      return generateTupleType(evmType, generateInputType);

    default:
      throw new UnreachableCaseError(evmType);
  }
}
github ethereum-ts / TypeChain / packages / web3-legacy / lib / generation.ts View on Github external
case "void":
      return "void";
    case "string":
      return "string";
    case "bytes":
    case "dynamic-bytes":
      return "string";
    case "address":
      return "string";
    case "array":
      return codeGenForOutput(evmType.itemType) + "[]";
    case "tuple":
      return generateTupleType(evmType, codeGenForOutput);

    default:
      throw new UnreachableCaseError(evmType);
  }
}

ts-essentials

All essential TypeScript types in one place

MIT
Latest version published 20 days ago

Package Health Score

94 / 100
Full package analysis

Popular ts-essentials functions