|
@@ -0,0 +1,33 @@
|
|
|
+const parser = require('./parser');
|
|
|
+
|
|
|
+let instance = null;
|
|
|
+
|
|
|
+module.exports.from = function (path) {
|
|
|
+ if (instance === null) {
|
|
|
+ instance = new parser(path);
|
|
|
+ } else {
|
|
|
+ instance.from(path);
|
|
|
+ }
|
|
|
+ return instance;
|
|
|
+};
|
|
|
+
|
|
|
+module.exports.setup = function (source, dest) {
|
|
|
+ if (instance === null) {
|
|
|
+ instance = new parser(path);
|
|
|
+ } else {
|
|
|
+ instance.from(path);
|
|
|
+ }
|
|
|
+ instance.to(dest);
|
|
|
+ return instance;
|
|
|
+};
|
|
|
+
|
|
|
+module.exports.get = function () {
|
|
|
+ return instance;
|
|
|
+};
|
|
|
+
|
|
|
+module.exports.result = function () {
|
|
|
+ if (instance === null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return instance.result;
|
|
|
+};
|