diff --git a/src/serviceproviders.js b/src/serviceproviders.js index 7f1d085..7d53436 100644 --- a/src/serviceproviders.js +++ b/src/serviceproviders.js @@ -13,25 +13,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -exports.list = [ +const list = [ 'dns', 'xmpp', 'twitter', 'hackernews', ] -exports.data = { +const data = { dns: require('./serviceproviders/dns'), xmpp: require('./serviceproviders/xmpp'), twitter: require('./serviceproviders/twitter'), hackernews: require('./serviceproviders/hackernews'), } -exports.match = (uri) => { +const match = (uri) => { let matches = [], sp - serviceprovidersList.forEach((spName, i) => { - sp = serviceproviders[spName] + list.forEach((spName, i) => { + sp = data[spName] if (sp.reURI.test(uri)) { matches.push(sp.processURI(uri)) } @@ -39,3 +39,7 @@ exports.match = (uri) => { return matches } + +exports.list = list +exports.data = data +exports.match = match