FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
atom/src/module-utils.js at master · buzz/atom · GitHub
buzz
/
atom
Public
forked from
atom/atom
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
atom
/
src
/
module-utils.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (20 loc) · 626 Bytes
Breadcrumbs
atom
/
src
/
module-utils.js
Copy path
File metadata and controls
21 lines (20 loc) · 626 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// a require function with both ES5 and ES6 default export support
function
requireModule
(
path
)
{
const
modul
=
require
(
path
)
;
if
(
modul
===
null
||
modul
===
undefined
)
{
// if null do not bother
return
modul
;
}
else
{
if
(
modul
.
__esModule
===
true
&&
(
modul
.
default
!==
undefined
&&
modul
.
default
!==
null
)
)
{
// __esModule flag is true and default is exported, which means that
// an object containing the main functions (e.g. activate, etc) is default exported
return
modul
.
default
;
}
else
{
return
modul
;
}
}
}
exports
.
requireModule
=
requireModule
;
Back
|
FazBrowse Home
|
New Git URL