mentie 0.2.33 → 0.2.35

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/modules/cache.js CHANGED
@@ -24,7 +24,7 @@ export function cache( key, value ) {
24
24
  }
25
25
 
26
26
  // Warn if the key contains 'undefined'
27
- if( key.includes( 'undefined' ) ) {
27
+ if( key?.includes( 'undefined' ) ) {
28
28
  log.warn( `The cache key ${ key } contains 'undefined', this may indicate a bug in your cache logic` )
29
29
  }
30
30
 
@@ -112,7 +112,7 @@ export const is_emulator = env.is_emulator()
112
112
  * Checks if the code is running in a development environment.
113
113
  * @returns {boolean} Returns true if the code is running in a development environment, otherwise returns false.
114
114
  */
115
- export const is_github_actions = process.env.GITHUB_ACTIONS == true
115
+ export const is_github_actions = typeof process !== 'undefined' && process.env?.GITHUB_ACTIONS == true
116
116
 
117
117
  // ///////////////////////////////
118
118
  // Mode and loglevel detection
@@ -12,7 +12,7 @@
12
12
  * make_retryable( () => fetch( 'https://api.com/data' ) )
13
13
  * @see {@link https://www.npmjs.com/package/promise-retry}
14
14
  */
15
- export async function make_retryable( async_function, { retry_times = 5, cooldown_in_s = 10, cooldown_entropy = true, logger = null } ) {
15
+ export async function make_retryable( async_function, { retry_times = 5, cooldown_in_s = 10, cooldown_entropy = true, logger = null }={} ) {
16
16
 
17
17
  // Function dependencies
18
18
  const { default: Retrier } = await import( 'promise-retry' )
@@ -69,7 +69,7 @@ export async function make_retryable( async_function, { retry_times = 5, cooldow
69
69
  * @returns {Promise<Array>} - A promise that resolves to an array of results from the async functions.
70
70
  * @see {@link https://www.npmjs.com/package/promise-parallel-throttle}
71
71
  */
72
- export async function throttle_and_retry( async_function_array = [], { max_parallel = 2, retry_times=2, cooldown_in_s=5, cooldown_entropy=false, logger, fail_fast = true } ) {
72
+ export async function throttle_and_retry( async_function_array = [], { max_parallel = 2, retry_times=2, cooldown_in_s=5, cooldown_entropy=false, logger, fail_fast = true }={} ) {
73
73
 
74
74
  // Function dependencies
75
75
  const { default: Throttle } = await import( 'promise-parallel-throttle' )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mentie",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "Mentor's toolbelt",
5
5
  "type": "module",
6
6
  "main": "index.js",