@universal-packages/adapter-resolver
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -19,14 +19,8 @@ "use strict"; | ||
const moduleExportNameCRegex = `.*${(0, change_case_1.pascalCase)(type)}$`; | ||
const moduleExportNameA = Object.keys(importedModule).find((key) => !!new RegExp(moduleExportNameARegex).exec(key)); | ||
const moduleExportNameB = Object.keys(importedModule).find((key) => !!new RegExp(moduleExportNameBRegex).exec(key)); | ||
const moduleExportNameC = Object.keys(importedModule).find((key) => !!new RegExp(moduleExportNameCRegex).exec(key)); | ||
if (moduleExportNameA) { | ||
gatheredAdapters.push(importedModule[moduleExportNameA]); | ||
} | ||
else if (moduleExportNameB) { | ||
gatheredAdapters.push(importedModule[moduleExportNameB]); | ||
} | ||
else if (moduleExportNameC) { | ||
gatheredAdapters.push(importedModule[moduleExportNameC]); | ||
} | ||
const matchingExportKeys = Object.keys(importedModule) | ||
.filter((key) => { | ||
return !!new RegExp(moduleExportNameARegex).exec(key) || !!new RegExp(moduleExportNameBRegex).exec(key) || !!new RegExp(moduleExportNameCRegex).exec(key); | ||
}) | ||
.map((moduleName) => importedModule[moduleName]); | ||
gatheredAdapters.push(...matchingExportKeys); | ||
} | ||
@@ -33,0 +27,0 @@ catch (error) { |
{ | ||
"name": "@universal-packages/adapter-resolver", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Module loader based on adapter parameters.", | ||
@@ -5,0 +5,0 @@ "author": "David De Anda <david@universal-packages.com> (https://github.com/universal-packages)", |
Sorry, the diff of this file is not supported yet
15719
112