-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (20 loc) · 627 Bytes
/
index.js
File metadata and controls
24 lines (20 loc) · 627 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// AM: does the file need to exist?
// cache pre-existing global values
var globals = ['d3'],
globalValues = {};
globals.forEach(function (g) {
if (g in global) globalValues[g] = global[g];
});
// ensure availability of d3 in global namespace
// eslint-disable-next-line no-undef
d3 = require('d3');
// load and export vega
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('./idl');
// eslint-disable-next-line no-undef
module.exports = idl;
// restore pre-existing global values
globals.forEach(function (g) {
if (g in globalValues) global[g] = globalValues[g];
else delete global[g];
});