mayo-firebase-config 1.2.9 → 1.2.11

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.
@@ -14,16 +14,23 @@ const react_native_1 = require("react-native");
14
14
  const mayo_logger_1 = require("mayo-logger");
15
15
  const { FirebaseConfigExtractor } = react_native_1.NativeModules;
16
16
  const extractFirebaseConfig = () => __awaiter(void 0, void 0, void 0, function* () {
17
- mayo_logger_1.Logger.info('TOTO Starting Firebase config extraction...', null, { tag: 'mayo-firebase-config-extractor' });
18
- const config = yield FirebaseConfigExtractor.extractConfig();
19
- if (config && typeof config === 'object' && Object.keys(config).length > 0) {
20
- mayo_logger_1.Logger.info('Successfully extracted Firebase config', null, { tag: 'mayo-firebase-config-extractor' });
17
+ try {
18
+ mayo_logger_1.Logger.info('Starting Firebase config extraction...', null, { tag: 'mayo-firebase-config-extractor' });
19
+ const config = yield FirebaseConfigExtractor.extractConfig();
20
+ if (config && typeof config === 'object' && Object.keys(config).length > 0) {
21
+ mayo_logger_1.Logger.info('Successfully extracted Firebase config', null, { tag: 'mayo-firebase-config-extractor' });
22
+ }
23
+ else {
24
+ mayo_logger_1.Logger.warn('Failed to extract valid Firebase config or the config is empty', null, { tag: 'mayo-firebase-config-extractor' });
25
+ }
26
+ // Be cautious about logging potentially sensitive information
27
+ mayo_logger_1.Logger.error('Extracted Firebase config:', { config }, { tag: 'mayo-firebase-config-extractor' });
28
+ return config;
21
29
  }
22
- else {
23
- mayo_logger_1.Logger.warn('Failed to extract valid Firebase config or the config is empty', null, { tag: 'mayo-firebase-config-extractor' });
30
+ catch (error) {
31
+ // Handle the error appropriately
32
+ mayo_logger_1.Logger.error('Error extracting Firebase config', error, { tag: 'mayo-firebase-config-extractor' });
33
+ throw error;
24
34
  }
25
- // This log may expose sensitive information, so be cautious about using it in a production environment
26
- mayo_logger_1.Logger.info('Extracted Firebase config:', { config }, { tag: 'mayo-firebase-config-extractor' });
27
- return config;
28
35
  });
29
36
  exports.extractFirebaseConfig = extractFirebaseConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mayo-firebase-config",
3
- "version": "1.2.9",
3
+ "version": "1.2.11",
4
4
  "license": "MIT",
5
5
  "author": "Mohamed Bennekrouf",
6
6
  "main": "dist/index.js",
@@ -3,7 +3,7 @@ module.exports = {
3
3
  platforms: {
4
4
  android: {
5
5
  sourceDir: './android',
6
- packageInstance: 'new FirebaseConfigExtractorModule(reactContext)'
6
+ // packageInstance: 'new FirebaseConfigExtractorModule(reactContext)'
7
7
  },
8
8
  },
9
9
  },
@@ -5,18 +5,24 @@ import { FirebaseConfig } from 'mayo-firebase-config';
5
5
  const { FirebaseConfigExtractor } = NativeModules;
6
6
 
7
7
  export const extractFirebaseConfig = async (): Promise<FirebaseConfig> => {
8
- Logger.info('TOTO Starting Firebase config extraction...', null, { tag: 'mayo-firebase-config-extractor' });
8
+ try {
9
+ Logger.info('Starting Firebase config extraction...', null, { tag: 'mayo-firebase-config-extractor' });
9
10
 
10
- const config: FirebaseConfig = await FirebaseConfigExtractor.extractConfig();
11
+ const config: FirebaseConfig = await FirebaseConfigExtractor.extractConfig();
11
12
 
12
- if (config && typeof config === 'object' && Object.keys(config).length > 0) {
13
- Logger.info('Successfully extracted Firebase config', null, { tag: 'mayo-firebase-config-extractor' });
14
- } else {
15
- Logger.warn('Failed to extract valid Firebase config or the config is empty', null, { tag: 'mayo-firebase-config-extractor' });
16
- }
13
+ if (config && typeof config === 'object' && Object.keys(config).length > 0) {
14
+ Logger.info('Successfully extracted Firebase config', null, { tag: 'mayo-firebase-config-extractor' });
15
+ } else {
16
+ Logger.warn('Failed to extract valid Firebase config or the config is empty', null, { tag: 'mayo-firebase-config-extractor' });
17
+ }
17
18
 
18
- // This log may expose sensitive information, so be cautious about using it in a production environment
19
- Logger.info('Extracted Firebase config:', { config }, { tag: 'mayo-firebase-config-extractor' });
19
+ // Be cautious about logging potentially sensitive information
20
+ Logger.error('Extracted Firebase config:', { config }, { tag: 'mayo-firebase-config-extractor' });
20
21
 
21
- return config;
22
+ return config;
23
+ } catch (error) {
24
+ // Handle the error appropriately
25
+ Logger.error('Error extracting Firebase config', error, { tag: 'mayo-firebase-config-extractor' });
26
+ throw error;
27
+ }
22
28
  };