parserResolver static method

TypeElementParser? parserResolver({
  1. Type? t,
  2. Object? obj,
  3. Type? type,
})

Implementation

static TypeElementParser? parserResolver({Type? t, Object? obj, Type? type}) {
  if (obj != null) {
    if (obj is File) {
      return parseFile;
    } else if (obj is Directory) {
      return parseDirectory;
    }
  }

  type ??= obj?.runtimeType ?? t;

  if (type == File) {
    return parseFile;
  } else if (type == Directory) {
    return parseDirectory;
  }

  return null;
}