MCPcopy Create free account
hub / github.com/CashScript/cashscript / parseType

Function parseType

packages/utils/src/types.ts:186–189  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

184}
185
186export function parseType(str: string): Type {
187 if (str.startsWith('byte')) return BytesType.fromString(str);
188 return PrimitiveType[str.toUpperCase() as keyof typeof PrimitiveType];
189}
190
191export function isPrimitive(type: Type): type is PrimitiveType {
192 return Boolean(PrimitiveType[type.toString().toUpperCase() as keyof typeof PrimitiveType]);

Callers 6

encodeFunctionArgumentFunction · 0.90
visitParameterMethod · 0.90
visitTupleAssignmentMethod · 0.90
visitCastMethod · 0.90
types.test.tsFile · 0.85

Calls 1

fromStringMethod · 0.80

Tested by

no test coverage detected