@colisweb/rescript-toolkit 2.29.0 → 2.29.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "2.29.0",
3
+ "version": "2.29.1",
4
4
  "scripts": {
5
5
  "clean": "rescript clean",
6
6
  "build": "rescript build",
@@ -1,37 +1,37 @@
1
1
  open BsSentryReactNative
2
2
 
3
- @val @scope("process.env") external nodeEnv: string = "NODE_ENV"
3
+ @val external isDev: bool = "__DEV__"
4
4
 
5
5
  let debugStyle = "background-color: #208E9C; color: white; padding: 5px; font-size: 10px;"
6
6
  let warningStyle = "background-color: #FFAD2D; color: white; padding: 5px; font-size: 10px;"
7
7
  let errorStyle = "background-color: #FF4714; color: white; padding: 5px; font-size: 10px;"
8
8
 
9
9
  let debug = str => {
10
- if nodeEnv !== "production" {
10
+ if isDev {
11
11
  Js.Console.log3("%cDEBUG", debugStyle, str)
12
12
  }
13
13
  }
14
14
 
15
15
  let debug2 = (str, str2) => {
16
- if nodeEnv !== "production" {
16
+ if isDev {
17
17
  Js.Console.log4("%cDEBUG", debugStyle, str, str2)
18
18
  }
19
19
  }
20
20
 
21
21
  let warning = str => {
22
- if nodeEnv !== "production" {
22
+ if isDev {
23
23
  Js.Console.log3("%cWARN", warningStyle, str)
24
24
  }
25
25
  }
26
26
 
27
27
  let warning2 = (str, str2) => {
28
- if nodeEnv !== "production" {
28
+ if isDev {
29
29
  Js.Console.log4("%cWARN", warningStyle, str, str2)
30
30
  }
31
31
  }
32
32
 
33
33
  let error = str => {
34
- if nodeEnv !== "production" {
34
+ if isDev {
35
35
  Js.Console.log3("%cERROR", errorStyle, str)
36
36
  } else {
37
37
  open Sentry
@@ -42,7 +42,7 @@ let error = str => {
42
42
  }
43
43
 
44
44
  let error2 = (str, str2) => {
45
- if nodeEnv !== "production" {
45
+ if isDev {
46
46
  Js.Console.log4("%cERROR", errorStyle, str, str2)
47
47
  } else {
48
48
  open Sentry