UNPKG

1.27 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/utils/reach-router-add-basecontext-export-loader.js"],"names":["source","replace","match","exportList","test"],"mappings":";;;;;AAAe,kBAASA,MAAT,EAAiB;AAC9B;AACA,SAAOA,MAAM,CAACC,OAAP,CAAe,qBAAf,EAAsC,CAACC,KAAD,EAAQC,UAAR,KAAuB;AAClE;AAEA,QAAI,wBAAwBC,IAAxB,CAA6BD,UAA7B,CAAJ,EAA8C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,aAAOD,KAAP;AACD,KARD,MAQO;AACL,aAAQ,YAAWC,UAAW,iBAA9B;AACD;AACF,GAdM,CAAP;AAeD","sourcesContent":["export default function(source) {\n // all it does is adding BaseContext to list of exports\n return source.replace(/export\\s+{([^}]+)}/m, (match, exportList) => {\n // return `export { ${exportList}, BaseContext }`\n\n if (/[,\\s]BaseContext[,\\s]/.test(exportList)) {\n // If BaseContext is already in export list - do nothing.\n // At the time of writing this, BaseContext is not exported,\n // but this can change in future version of @reach/router\n // and we don't want to export same thing multiple times\n // as this would cause parsing errors:\n // \"Module parse failed: Duplicate export 'BaseContext'\"\n return match\n } else {\n return `export { ${exportList}, BaseContext }`\n }\n })\n}\n"],"file":"reach-router-add-basecontext-export-loader.js"}
\No newline at end of file