getHandler method

dynamic getHandler(
  1. dynamic file
)

Implementation

getHandler(file) {
  for (var i = 0, l = handlers.length; i < l; i += 2) {
    var regex = handlers[i];
    var loader = handlers[i + 1];

    if (regex.global) regex.lastIndex = 0; // see #17920

    if (regex.test(file)) {
      return loader;
    }
  }

  return null;
}