crossmintNormalizeConfiguredSigner function

CrossmintJsonMap? crossmintNormalizeConfiguredSigner(
  1. Object? value
)

Implementation

CrossmintJsonMap? crossmintNormalizeConfiguredSigner(Object? value) {
  if (value is String && value.trim().isNotEmpty) {
    return <String, Object?>{
      'type': crossmintTypeFromLocator(value),
      'locator': value,
    };
  }
  if (value is Map<Object?, Object?>) {
    final Object? nestedSigner = value['signer'];
    if (nestedSigner is String && nestedSigner.trim().isNotEmpty) {
      return <String, Object?>{
        'type': crossmintTypeFromLocator(nestedSigner),
        'locator': nestedSigner,
      };
    }
    if (nestedSigner is Map<Object?, Object?>) {
      return crossmintNormalizeMap(nestedSigner);
    }
    return crossmintNormalizeMap(value);
  }
  return null;
}