function extractReadOnlyType()

in src/rule-generated-flow-types.js [256:270]


function extractReadOnlyType(genericType) {
  let currentType = genericType;
  while (
    currentType != null &&
    currentType.type === 'GenericTypeAnnotation' &&
    currentType.id.name === '$ReadOnly' &&
    currentType.typeParameters &&
    currentType.typeParameters.type === 'TypeParameterInstantiation' &&
    Array.isArray(currentType.typeParameters.params) &&
    currentType.typeParameters.params.length === 1
  ) {
    currentType = currentType.typeParameters.params[0];
  }
  return currentType;
}