eligius 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -631,16 +631,20 @@ function _generateSourceCode(importPaths) {
|
|
|
631
631
|
|
|
632
632
|
return "import {" + imp.systemName + "} from '" + ((_imp$path = imp.path) != null ? _imp$path : 'eligius') + "';";
|
|
633
633
|
}));
|
|
634
|
+
result.push("import { ISimpleResourceImporter } from 'eligius';");
|
|
635
|
+
result.push('');
|
|
634
636
|
result.push('const imports: Record<string, any> = {');
|
|
635
637
|
result.push.apply(result, importPaths.map(function (imp) {
|
|
636
638
|
return imp.systemName + ": { '" + imp.systemName + "': " + imp.systemName + " },";
|
|
637
639
|
}));
|
|
638
640
|
result.push('};');
|
|
641
|
+
result.push('');
|
|
639
642
|
result.push('class EligiusResourceImporter implements ISimpleResourceImporter {');
|
|
640
643
|
result.push('import(name: string): Record<string, any> {');
|
|
641
644
|
result.push('if (imports.hasOwnProperty(name)) { return imports[name]; }');
|
|
642
645
|
result.push('throw Error(`Unknown systemName: ${name}`);');
|
|
643
646
|
result.push('}}');
|
|
647
|
+
result.push('');
|
|
644
648
|
result.push('export default EligiusResourceImporter;');
|
|
645
649
|
return result.join('\n');
|
|
646
650
|
}
|