2018-09-22 12:28:50 +00:00
|
|
|
'use strict'
|
|
|
|
|
2018-09-20 03:43:26 +00:00
|
|
|
const moduleList = require('@electron/internal/sandboxed_renderer/api/module-list')
|
2018-08-27 18:16:52 +00:00
|
|
|
|
2019-02-14 22:29:20 +00:00
|
|
|
const handleESModule = (m) => {
|
|
|
|
// Handle Typescript modules with an "export default X" statement
|
|
|
|
if (m.__esModule) return m.default
|
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2018-08-27 18:16:52 +00:00
|
|
|
for (const {
|
2018-09-13 16:10:51 +00:00
|
|
|
name,
|
|
|
|
load,
|
|
|
|
enabled = true,
|
|
|
|
private: isPrivate = false
|
|
|
|
} of moduleList) {
|
2018-08-27 18:16:52 +00:00
|
|
|
if (!enabled) {
|
|
|
|
continue
|
2017-02-27 17:14:36 +00:00
|
|
|
}
|
2018-08-27 18:16:52 +00:00
|
|
|
|
|
|
|
Object.defineProperty(exports, name, {
|
|
|
|
enumerable: !isPrivate,
|
2019-02-14 22:29:20 +00:00
|
|
|
get: () => handleESModule(load())
|
2018-08-27 18:16:52 +00:00
|
|
|
})
|
|
|
|
}
|