1 |
|
2 |
|
3 |
|
4 | type TransformFile = {
|
5 | (filename: string, callback: Function): void,
|
6 | (filename: string, opts: ?Object, callback: Function): void,
|
7 | };
|
8 |
|
9 | export const transformFile: TransformFile = (function transformFile(
|
10 | filename,
|
11 | opts,
|
12 | callback,
|
13 | ) {
|
14 | if (typeof opts === "function") {
|
15 | callback = opts;
|
16 | }
|
17 |
|
18 | callback(new Error("Transforming files is not supported in browsers"), null);
|
19 | }: Function);
|
20 |
|
21 | export function transformFileSync() {
|
22 | throw new Error("Transforming files is not supported in browsers");
|
23 | }
|
24 |
|
25 | export function transformFileAsync() {
|
26 | return Promise.reject(
|
27 | new Error("Transforming files is not supported in browsers"),
|
28 | );
|
29 | }
|