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