mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
57d1aaf80f
swc_ecma_codegen: - Fix codegen of `\r\n` in template literals when targeting `es2020`. (denoland/deno#10282) swc_ecma_parser: - Support non-identifier getters in typescript. (#1708) swc_ecma_transforms_typescript: - Skip `export {}` if it was not a module. (#1706) - Skip `export {}` if the result is module without it. (#1706)
31 lines
940 B
TypeScript
31 lines
940 B
TypeScript
"use strict";
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
} else {
|
|
var newObj = {
|
|
};
|
|
if (obj != null) {
|
|
for(var key in obj){
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
|
};
|
|
if (desc.get || desc.set) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
newObj.default = obj;
|
|
return newObj;
|
|
}
|
|
}
|
|
(async ()=>{
|
|
const example = await Promise.resolve().then(function() {
|
|
return _interopRequireWildcard(require('./example'));
|
|
});
|
|
console.log(example.foo);
|
|
})();
|