Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.transformFileAsync = exports.transformFileSync = exports.transformFile = void 0;
|
---|
7 |
|
---|
8 | function _gensync() {
|
---|
9 | const data = require("gensync");
|
---|
10 |
|
---|
11 | _gensync = function () {
|
---|
12 | return data;
|
---|
13 | };
|
---|
14 |
|
---|
15 | return data;
|
---|
16 | }
|
---|
17 |
|
---|
18 | var _config = require("./config");
|
---|
19 |
|
---|
20 | var _transformation = require("./transformation");
|
---|
21 |
|
---|
22 | var fs = require("./gensync-utils/fs");
|
---|
23 |
|
---|
24 | ({});
|
---|
25 |
|
---|
26 | const transformFileRunner = _gensync()(function* (filename, opts) {
|
---|
27 | const options = Object.assign({}, opts, {
|
---|
28 | filename
|
---|
29 | });
|
---|
30 | const config = yield* (0, _config.default)(options);
|
---|
31 | if (config === null) return null;
|
---|
32 | const code = yield* fs.readFile(filename, "utf8");
|
---|
33 | return yield* (0, _transformation.run)(config, code);
|
---|
34 | });
|
---|
35 |
|
---|
36 | const transformFile = transformFileRunner.errback;
|
---|
37 | exports.transformFile = transformFile;
|
---|
38 | const transformFileSync = transformFileRunner.sync;
|
---|
39 | exports.transformFileSync = transformFileSync;
|
---|
40 | const transformFileAsync = transformFileRunner.async;
|
---|
41 | exports.transformFileAsync = transformFileAsync; |
---|
Note:
See
TracBrowser
for help on using the repository browser.