Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101777242
MakeNamespaceObjectRuntimeModule.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 13, 14:39
Size
972 B
Mime Type
text/x-c++
Expires
Sat, Feb 15, 14:39 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
24228077
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
MakeNamespaceObjectRuntimeModule.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict"
;
const
RuntimeGlobals
=
require
(
"../RuntimeGlobals"
);
const
Template
=
require
(
"../Template"
);
const
HelperRuntimeModule
=
require
(
"./HelperRuntimeModule"
);
class
MakeNamespaceObjectRuntimeModule
extends
HelperRuntimeModule
{
constructor
()
{
super
(
"make namespace object"
);
}
/**
* @returns {string} runtime code
*/
generate
()
{
const
{
runtimeTemplate
}
=
this
.
compilation
;
const
fn
=
RuntimeGlobals
.
makeNamespaceObject
;
return
Template
.
asString
([
"// define __esModule on exports"
,
`
$
{
fn
}
=
$
{
runtimeTemplate
.
basicFunction
(
"exports"
,
[
"if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {"
,
Template
.
indent
([
"Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });"
]),
"}"
,
"Object.defineProperty(exports, '__esModule', { value: true });"
])};
`
]);
}
}
module
.
exports
=
MakeNamespaceObjectRuntimeModule
;
Event Timeline
Log In to Comment