2019-10-01 13:49:56 +00:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
function electronBindingSetup(binding, processType) {
|
|
|
|
return function electronBinding(name) {
|
|
|
|
try {
|
|
|
|
return binding(`atom_${processType}_${name}`);
|
|
|
|
}
|
|
|
|
catch (error) {
|
|
|
|
if (/No such module/.test(error.message)) {
|
|
|
|
return binding(`atom_common_${name}`);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2019-01-17 18:22:05 +00:00
|
|
|
}
|
2019-10-01 13:49:56 +00:00
|
|
|
exports.electronBindingSetup = electronBindingSetup;
|