forked from rollup/rollup
/
main.js
39 lines (33 loc) · 763 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
function _mergeNamespaces(n, m) {
m.forEach(function (e) {
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
if (k !== 'default' && !(k in n)) {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
});
return Object.freeze(n);
}
const d = {
fn: 42,
hello: 'hola'
};
const foo = 100;
var ns = /*#__PURE__*/_mergeNamespaces({
__proto__: null,
default: d,
foo: foo
}, [d]);
const stuff = 12;
console.log(stuff);
console.log(d.fn);
console.log(foo);
console.log(ns);
exports.fn = d.fn;
exports.foo = foo;
exports.stuff = d.stuff;