Making Fredy an ESM project (#70)

Making Fredy an ESM project
This commit is contained in:
Christian Kellner
2023-03-13 13:42:43 +01:00
committed by GitHub
parent 7d0ec72a0c
commit 2c5eceb0c1
69 changed files with 862 additions and 1567 deletions

View File

@@ -1,12 +1,10 @@
module.exports = {
_tmpStore: {},
let tmpStore = {};
send: (serviceName, payload) => {
this._tmpStore = { serviceName, payload };
return [Promise.resolve()];
},
get: () => {
return this._tmpStore;
},
export const send = (serviceName, payload) => {
tmpStore = { serviceName, payload };
return [Promise.resolve()];
};
export const get = () => {
return tmpStore;
};

View File

@@ -1,11 +1,8 @@
const db = {};
exports.setKnownListings = (jobKey, providerId, listings) => {
export const setKnownListings = (jobKey, providerId, listings) => {
if (!Array.isArray(listings)) throw Error('Not a valid array');
db[providerId] = listings;
};
exports.getKnownListings = (jobKey, providerId) => {
export const getKnownListings = (jobKey, providerId) => {
return db[providerId] || [];
};