UNPKG

734 BJavaScriptView Raw
1// @flow
2
3// duplicated from transform-file so we do not have to import anything here
4type TransformFile = {
5 (filename: string, callback: Function): void,
6 (filename: string, opts: ?Object, callback: Function): void,
7};
8
9export 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
21export function transformFileSync() {
22 throw new Error("Transforming files is not supported in browsers");
23}
24
25export function transformFileAsync() {
26 return Promise.reject(
27 new Error("Transforming files is not supported in browsers"),
28 );
29}