aiden-shared-calculations-unified 1.0.53 → 1.0.55
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.
- package/index.js +6 -23
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7,27 +7,10 @@
|
|
|
7
7
|
* functions for use within the calculations.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const requireAll
|
|
11
|
-
const path
|
|
12
|
-
|
|
13
|
-
// --- Utils (Manually Exported) ---
|
|
14
|
-
const firestoreUtils = require('./utils/firestore_utils');
|
|
10
|
+
const requireAll = require('require-all');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const firestoreUtils = require('./utils/firestore_utils');
|
|
15
13
|
const mappingProvider = require('./utils/sector_mapping_provider');
|
|
16
|
-
const priceProvider
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const calculations = requireAll({
|
|
20
|
-
dirname: path.join(__dirname, 'calculations'), // Use __dirname to get the correct path
|
|
21
|
-
filter: /(.+)\.js$/, // Only load .js files
|
|
22
|
-
recursive: true, // Load from subdirectories
|
|
23
|
-
map: name => name.replace(/_/g, '-') // Convert snake_case filenames to kebab-case keys
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
module.exports = {
|
|
27
|
-
calculations,
|
|
28
|
-
utils: {
|
|
29
|
-
...firestoreUtils,
|
|
30
|
-
...mappingProvider,
|
|
31
|
-
...priceProvider // <-- ADD THIS
|
|
32
|
-
}
|
|
33
|
-
};
|
|
14
|
+
const priceProvider = require('./utils/price_data_provider');
|
|
15
|
+
const calculations = requireAll({ dirname: path.join(__dirname, 'calculations'), filter: /(.+)\.js$/, recursive: true, map: name => name.replace(/_/g, '-') });
|
|
16
|
+
module.exports = { calculations, utils: { ...firestoreUtils, ...mappingProvider, ...priceProvider } };
|