UNPKG

692 BJavaScriptView Raw
1"use strict";
2var fs = require("fs");
3exports.introspectionFromFile = function (file) {
4 return new Promise(function (resolve, reject) {
5 if (fs.existsSync(file)) {
6 try {
7 var fileContent = fs.readFileSync(file, 'utf8');
8 if (!fileContent) {
9 reject("Unable to read local introspection file: " + file);
10 }
11 resolve(JSON.parse(fileContent));
12 }
13 catch (e) {
14 reject(e);
15 }
16 }
17 else {
18 reject("Unable to locate local introspection file: " + file);
19 }
20 });
21};
22//# sourceMappingURL=introspection-from-file.js.map
\No newline at end of file