message: chore: minor optimize getTransformer
diff: @@ -176,19 +176,22 @@ export default class ScriptTransformer {
  }
  private _getTransformer(filename: Config.Path) {
  - let transform: Transformer | null = null;
  if (!this._config.transform || !this._config.transform.length) {
  return null;
  }
  const transformPath = this._getTransformPath(filename);
  - if (transformPath) {
  +
  + if (!transformPath) {
  + return null;
  + }
  +
  const transformer = this._transformCache.get(transformPath);
  - if (transformer != null) {
  + if (transformer) {
  return transformer;
  }
  - transform = require(transformPath);
  + let transform: Transformer = require(transformPath);
  if (!transform) {
  throw new TypeError('Jest: a transform must export something.');
  @@ -203,7 +206,7 @@ export default class ScriptTransformer {
  );
  }
  this._transformCache.set(transformPath, transform);
  - }
  +
  return transform;
  }
  