1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.transformFile = transformFile;
|
---|
7 | exports.transformFileAsync = transformFileAsync;
|
---|
8 | exports.transformFileSync = transformFileSync;
|
---|
9 | function _gensync() {
|
---|
10 | const data = require("gensync");
|
---|
11 | _gensync = function () {
|
---|
12 | return data;
|
---|
13 | };
|
---|
14 | return data;
|
---|
15 | }
|
---|
16 | var _index = require("./config/index.js");
|
---|
17 | var _index2 = require("./transformation/index.js");
|
---|
18 | var fs = require("./gensync-utils/fs.js");
|
---|
19 | ({});
|
---|
20 | const transformFileRunner = _gensync()(function* (filename, opts) {
|
---|
21 | const options = Object.assign({}, opts, {
|
---|
22 | filename
|
---|
23 | });
|
---|
24 | const config = yield* (0, _index.default)(options);
|
---|
25 | if (config === null) return null;
|
---|
26 | const code = yield* fs.readFile(filename, "utf8");
|
---|
27 | return yield* (0, _index2.run)(config, code);
|
---|
28 | });
|
---|
29 | function transformFile(...args) {
|
---|
30 | transformFileRunner.errback(...args);
|
---|
31 | }
|
---|
32 | function transformFileSync(...args) {
|
---|
33 | return transformFileRunner.sync(...args);
|
---|
34 | }
|
---|
35 | function transformFileAsync(...args) {
|
---|
36 | return transformFileRunner.async(...args);
|
---|
37 | }
|
---|
38 | 0 && 0;
|
---|
39 |
|
---|
40 | //# sourceMappingURL=transform-file.js.map
|
---|