electron/lib/sandboxed_renderer/api/exports/electron.js

26 lines
495 B
JavaScript
Raw Normal View History

'use strict'
const moduleList = require('@electron/internal/sandboxed_renderer/api/module-list')
const handleESModule = (m) => {
// Handle Typescript modules with an "export default X" statement
if (m.__esModule) return m.default
return m
}
for (const {
2018-09-13 16:10:51 +00:00
name,
load,
enabled = true,
private: isPrivate = false
} of moduleList) {
if (!enabled) {
continue
}
Object.defineProperty(exports, name, {
enumerable: !isPrivate,
get: () => handleESModule(load())
})
}