chore: rename atom-binding-setup.ts to electron-binding-setup.ts (#17949)

This commit is contained in:
Milan Burda 2019-04-29 16:57:32 +02:00 committed by Alexey Kuzmin
parent 6f83977f47
commit 18b77a4de6
7 changed files with 8 additions and 8 deletions

View file

@ -0,0 +1,13 @@
export function electronBindingSetup (binding: typeof process['_linkedBinding'], processType: typeof process['type']): typeof process['electronBinding'] {
return function electronBinding (name: string) {
try {
return binding(`atom_${processType}_${name}`)
} catch (error) {
if (/No such module/.test(error.message)) {
return binding(`atom_common_${name}`)
} else {
throw error
}
}
}
}