Move "transformFile" to "transform" to match worker interface

Reviewed By: cpojer

Differential Revision: D6968803

fbshipit-source-id: 7dee92d5a58e18bb1ee0d5cd5748acd44cde5b18
This commit is contained in:
Miguel Jimenez Esun 2018-02-16 11:37:43 -08:00 committed by Facebook Github Bot
parent b129827fa2
commit e651b81881
3 changed files with 5 additions and 5 deletions

View File

@ -158,7 +158,7 @@ class Bundler {
resetCache: opts.resetCache,
sourceExts: opts.sourceExts,
transformCode: (module, code, transformCodeOptions) =>
this._transformer.transformFile(
this._transformer.transform(
module.path,
module.localPath,
code,

View File

@ -64,7 +64,7 @@ describe('Transformer', function() {
const transformOptions = {arbitrary: 'options'};
const code = 'arbitrary(code)';
new Transformer(opts).transformFile(
new Transformer(opts).transform(
fileName,
localPath,
code,
@ -108,7 +108,7 @@ describe('Transformer', function() {
expect.assertions(6);
return transformer
.transformFile(fileName, localPath, '', true, {})
.transform(fileName, localPath, '', true, {})
.catch(function(error) {
expect(error.type).toEqual('TransformError');
expect(error.message).toBe(

View File

@ -91,7 +91,7 @@ module.exports = class Transformer {
return await this._worker.minify(filename, code, sourceMap);
}
async transformFile(
async transform(
filename: string,
localPath: LocalPath,
code: string,
@ -123,7 +123,7 @@ module.exports = class Transformer {
return data.result;
} catch (err) {
debug('Failed transformFile file', filename);
debug('Failed transform file', filename);
if (err.loc) {
throw this._formatBabelError(err, filename);