fromPath static method

DocType fromPath(
  1. String filePath
)

Infers the DocType from a file path extension. Throws ArgumentError if the extension is unrecognised.

Implementation

static DocType fromPath(String filePath) {
  final ext = filePath.split('.').last.toLowerCase();
  return DocType.fromExtension(ext);
}