atom-binding-setup.js 342 B

1234567891011121314
  1. module.exports = function atomBindingSetup (binding, processType) {
  2. return function atomBinding (name) {
  3. try {
  4. return binding(`atom_${processType}_${name}`)
  5. } catch (error) {
  6. if (/No such module/.test(error.message)) {
  7. return binding(`atom_common_${name}`)
  8. } else {
  9. throw error
  10. }
  11. }
  12. }
  13. }