Break apart the File class into multiple files and add type definitions.
This commit is contained in:
13
packages/babel-core/src/transform.js
Normal file
13
packages/babel-core/src/transform.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// @flow
|
||||
import loadConfig from "./config";
|
||||
import runTransform, { type FileResult } from "./transformation";
|
||||
|
||||
export default function transform(
|
||||
code: string,
|
||||
opts?: Object,
|
||||
): FileResult | null {
|
||||
const config = loadConfig(opts);
|
||||
if (config === null) return null;
|
||||
|
||||
return runTransform(config, code);
|
||||
}
|
||||
Reference in New Issue
Block a user