Studying all day long)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
3.8 KiB

2 years ago
{"version":3,"file":"named-exports.min.js","sources":["../../src/extras/named-exports.js"],"sourcesContent":["/*\n * Named exports support for legacy module formats in SystemJS 2.0\n * \n * Note: This extra is deprecated as the behaviour is now the default in core,\n * so will be removed in the next major.\n */\n(function (global) {\n var systemJSPrototype = global.System.constructor.prototype;\n\n // hook System.register to know the last declaration binding\n var lastRegisterDeclare;\n var systemRegister = systemJSPrototype.register;\n systemJSPrototype.register = function (name, deps, declare) {\n lastRegisterDeclare = typeof name === 'string' ? declare : deps;\n systemRegister.apply(this, arguments);\n };\n\n var getRegister = systemJSPrototype.getRegister;\n systemJSPrototype.getRegister = function () {\n var register = getRegister.call(this);\n // if it is an actual System.register call, then its ESM\n // -> dont add named exports\n if (!register || register[1] === lastRegisterDeclare || register[1].length === 0)\n return register;\n\n // otherwise it was provided by a custom instantiator\n // -> extend the registration with named exports support\n var registerDeclare = register[1];\n register[1] = function (_export, _context) {\n // hook the _export function to note the default export\n var defaultExport, hasDefaultExport = false;\n var declaration = registerDeclare.call(this, function (name, value) {\n if (typeof name === 'object' && name && name.__useDefault)\n defaultExport = name.default, hasDefaultExport = true;\n else if (name === 'default')\n defaultExport = value;\n else if (name === '__useDefault')\n hasDefaultExport = true;\n _export(name, value);\n }, _context);\n // hook the execute function\n var execute = declaration.execute;\n if (execute)\n declaration.execute = function () {\n execute.call(this);\n // do a bulk export of the default export object\n // to export all its names as named exports\n\n if (hasDefaultExport)\n for (var exportName in defaultExport) {\n if (\n Object.prototype.hasOwnProperty.call(defaultExport, exportName) // Check if epoxrt name is not inherited, safe for Object.create(null)\n && exportName !== 'default' // default is not a named export\n ) {\n _export(exportName, defaultExport[exportName]);\n }\n }\n };\n return declaration;\n };\n return register;\n };\n})(typeof self !== 'undefined' ? self : global);\n"],"names":["global","lastRegisterDeclare","systemJSPrototype","System","constructor","prototype","systemRegister","register","name","deps","declare","apply","this","arguments","getRegister","call","length","registerDeclare","_export","_context","defaultExport","hasDefaultExport","declaration","value","__useDefault","default","execute","exportName","Object","hasOwnProperty","self"],"mappings":"CAMA,SAAWA,GACT,IAGIC,EAHAC,EAAoBF,EAAOG,OAAOC,YAAYC,UAI9CC,EAAiBJ,EAAkBK,SACvCL,EAAkBK,SAAW,SAAUC,EAAMC,EAAMC,GACjDT,EAAsC,iBAATO,EAAoBE,EAAUD,EAC3DH,EAAeK,MAAMC,KAAMC,YAG7B,IAAIC,EAAcZ,EAAkBY,YACpCZ,EAAkBY,YAAc,WAC9B,IAAIP,EAAWO,EAAYC,KAAKH,MAGhC,IAAKL,GAAYA,EAAS,KAAON,GAA8C,IAAvBM,EAAS,GAAGS,OAClE,OAAOT,EAIT,IAAIU,EAAkBV,EAAS,GAiC/B,OAhCAA,EAAS,GAAK,SAAUW,EAASC,GAE/B,IAAIC,EAAeC,GAAmB,EAClCC,EAAcL,EAAgBF,KAAKH,MAAM,SAAUJ,EAAMe,GACvC,iBAATf,GAAqBA,GAAQA,EAAKgB,cAC3CJ,EAAgBZ,EAAKiB,QAASJ,GAAmB,GACjC,YAATb,EACPY,EAAgBG,EACA,iBAATf,IACPa,GAAmB,GACrBH,EAAQV,EAAMe,KACbJ,GAECO,EAAUJ,EAAYI,QAiB1B,OAhBIA,IACFJ,EAAYI,QAAU,WAKpB,GAJAA,EAAQX,KAAKH,MAITS,EACF,IAAK,IAAIM,KAAcP,GAEnBQ,IAAiBC,eAAed,KAAKK,EAAgBO,IACnC,YAAfA,GAEHT,EAAQS,EAAYP,EAAcO,MAIrCL,GAEFf,GAtDX,CAwDmB,oBAATuB,KAAuBA,KAAO9B"}