UNPKG

424 BJavaScriptView Raw
1import { getSiName } from '../metadata/util/index.js';
2/** @internal */
3export function unwrapStorageSi(type) {
4 return type.isPlain
5 ? type.asPlain
6 : type.asMap.value;
7}
8/** @internal */
9export function unwrapStorageType(registry, type, isOptional) {
10 const outputType = getSiName(registry.lookup, unwrapStorageSi(type));
11 return isOptional
12 ? `Option<${outputType}>`
13 : outputType;
14}