@sohanemon/utils 5.0.8 → 5.0.9

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.
@@ -1,3 +1,4 @@
1
+ import { isSSR } from './utils';
1
2
  export function shield(operation) {
2
3
  if (operation instanceof Promise) {
3
4
  return operation
@@ -9,6 +10,12 @@ export function shield(operation) {
9
10
  return [null, data];
10
11
  }
11
12
  catch (error) {
13
+ if (isSSR) {
14
+ console.info(`🛡 [shield] ${operation.name} failed →`, error);
15
+ }
16
+ else {
17
+ console.info(`%c🛡 [shield] %c${operation.name}`, 'color:#f87171;font-weight:bold;', 'color:#aaa;', error);
18
+ }
12
19
  return [error, null];
13
20
  }
14
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sohanemon/utils",
3
- "version": "5.0.8",
3
+ "version": "5.0.9",
4
4
  "author": "Sohan Emon <sohanemon@outlook.com>",
5
5
  "description": "",
6
6
  "type": "module",