UNPKG

1.09 kBJavaScriptView Raw
1(function (factory) {
2 if (typeof module === "object" && typeof module.exports === "object") {
3 var v = factory(require, exports);
4 if (v !== undefined) module.exports = v;
5 }
6 else if (typeof define === "function" && define.amd) {
7 define(["require", "exports"], factory);
8 }
9})(function (require, exports) {
10 "use strict";
11 Object.defineProperty(exports, "__esModule", { value: true });
12 exports.globals = exports.external = exports.isShim = exports.isHpcc = void 0;
13 const node_libs = ["child_process", "fs", "node-fetch", "os", "path", "semver", "safe-buffer", "tmp", "xmldom"];
14 exports.isHpcc = (id) => id.indexOf("@hpcc-js") === 0;
15 exports.isShim = (id) => exports.isHpcc(id) && id.indexOf("-shim") > 0;
16 function external(id) {
17 return (exports.isHpcc(id) && !exports.isShim(id)) || node_libs.indexOf(id) >= 0;
18 }
19 exports.external = external;
20 function globals(id) {
21 if (id.indexOf("@hpcc-js") === 0) {
22 return id;
23 }
24 return undefined;
25 }
26 exports.globals = globals;
27});